Best method of making a disk 'clone' daily?

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,374
I have a 500GB SSD and a 750GB HDD in my NAS which I'd like to have, once a day, a full backup of the SSD.
If the SSD goes bang, I can always replace it and recover from the 750GB.

Would the best thing to be just do something like a cron job?
zfs snap SSD@midnight
zfs send SSD@midnight | zfs recv -f 750GBKUP

?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
There are "snapshot tasks" and "replication tasks" in the UI - no need to hack your own script.

See for example my 7 (currently) replication tasks:
Bildschirmfoto 2020-10-19 um 09.47.02.png

I snapshot everything hourly and keep these for a week. The replication tasks copy the 12:00 am snapshots daily from SSD/VM pool to my HDD/Storage pool and to a remote system named "freenas2". These are kept for 2 weeks.

Everything is 100% automated. Give it a try.
 
Last edited:

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,374
Having done this, it resulted in the system cloning my iocage dataset and then confusing the heck out of the system.
Is there any way for it to put a 'cold, dumb' snapshot on there?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
Having done this, it resulted in the system cloning my iocage dataset and then confusing the heck out of the system.
Is there any way for it to put a 'cold, dumb' snapshot on there?
iocage only works in one pool. if you have multiple it will only work on the configured pool. how did you get it to confuse the system?
"cold, dumb" snapshot is what a snapshot is, nothing will use it unless you tell it to
if you are using ~11.3 and later, you can exclude iocage from either the snapshot task or the replication
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
I clone e.g.
  • ssd/vms - where the zvols of my virtual machines reside
  • ssd/iocage/jails - all data of all of my jails

There is no need to clone the topmost iocage dataset for backup.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,374
iocage only works in one pool. if you have multiple it will only work on the configured pool. how did you get it to confuse the system?
"cold, dumb" snapshot is what a snapshot is, nothing will use it unless you tell it to
if you are using ~11.3 and later, you can exclude iocage from either the snapshot task or the replication

A late reply, sorry.

The probem is, I'd like a backup of that data, in making the backup iocage thought it belonged on the new drive, not the old one.
Is there no way to make the backup without the system trying to use it?
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,374
I clone e.g.
  • ssd/vms - where the zvols of my virtual machines reside
  • ssd/iocage/jails - all data of all of my jails

There is no need to clone the topmost iocage dataset for backup.


That makes sense, so as long as I don't clone the root, I'm fine?
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
I clone the entire iocage to another system, it doesnt try and use it. I'm not cloning it to the root of the pool though, maybe that's related?
jls/iocage > bkps/jls/iocage
much if freenas is trial-and-error in my experience. the docs exist but mostly all it tells you is "here is replications. we can replicate. it works. really", the only way to find out how it actually behaves is to try it and see, or read the forums for someone who already tried it.
 
Top