ZFS How to backup ZFS special device

Is there a way to backup the ZFS special device ? I already have it setup as a mirror but you never know...I'd rather store the data periodically somewhere else as well since it's a major SPOF.
 
What do you mean by "special device"?

Do you mean file system? There are lots of recipes around for how to backup a ZFS file system (or snapshot or data set or ...), but I don't know what "special device" means in this context.
 
Not even with dd ? There must be a way to backup that data and safeguard it.
I couldn't find any documents as to the format in which metadata is saved. Which fs does the special device use ? Maybe it can be mounted and data copied off it ?
 
If you're that concerned, set up a 3 way mirror. You could make the 3rd member an external device, connect it, do the proper commands to attach it to the 2 way mirror, let it resilver, then detach it from the mirror. By doing that you would have an exact copy (not a bit for bit copy, but more of a file system copy) on an external device. You could then
lose one of the 2 or heck even both of the other devices in the mirror and still have it.

"zfs special device" makes no sense to me.

zfs metadata is all part of the zfs "filesystem" structure.

zfs metadata without the underlying blocks is not very useful, it would be like having all the UFS inodes and not having the data in the inodes.

zfs send | zfs receive to send snapshots to external devices is the standard way of backing up zfs datasets. You can probably do a recursive snapshot and get all of them.
If you do zpool status you see what vdevs make up your mirror, it's either a partition or an entire device, so you could always dd just a partition, but there is no guarantee that it would actually restore correctly on a new device.
 
that's a good idea with the 3 way mirror, I had thought about it but thought there might be something easier.
I was thinking something along the lines of:

dismount pool
rsync special device data ( in case it's just files stored on disk )
mount pool back
 
If you're that concerned, set up a 3 way mirror. You could make the 3rd member an external device, connect it, do the proper commands to attach it to the 2 way mirror, let it resilver, then detach it from the mirror. By doing that you would have an exact copy (not a bit for bit copy, but more of a file system copy) on an external device. You could then
lose one of the 2 or heck even both of the other devices in the mirror and still have it.

"zfs special device" makes no sense to me.

zfs metadata is all part of the zfs "filesystem" structure.

zfs metadata without the underlying blocks is not very useful, it would be like having all the UFS inodes and not having the data in the inodes.

zfs send | zfs receive to send snapshots to external devices is the standard way of backing up zfs datasets. You can probably do a recursive snapshot and get all of them.
If you do zpool status you see what vdevs make up your mirror, it's either a partition or an entire device, so you could always dd just a partition, but there is no guarantee that it would actually restore correctly on a new device.
There are 4 different kinds of VDEVS
-1.Regular
-2.Special device
-3.Log
-4.Cache
There must be info on the internet where each one is described.

I have a zfs-special device on my SSD for a zpool on HardDisk.
Ie. zpool list -v
Code:
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
ZHD         904G  53.2G   851G        -       96G     8%     5%  1.00x    ONLINE  -
  sda       832G  52.5G   780G        -       96G     8%  6.30%      -    ONLINE
special        -      -      -        -         -      -      -      -  -
  sdc      72.5G   763M  71.8G        -      392G    28%  1.02%      -    ONLINE
I my case the files are stored on sda and the metadata of the files on sdc.
 
Nope, setting up the 3 way mirror is easier; the OS/ZFS take care of everything else for you.
I would leave the 3 way mirror running, you'd need to lose all three devices to lose the data. If you have offsite backups, detaching the 3rd device gives you a head start on creating snapshots and using zfs send | zfs receive.
 
In my case if the SSD/specialvdev/sdc "crashes", I lose all data including the files stored on HD/sda. Because without metadata they are not readable.
 
That is interesting. Sounds like it's a potential performance enhancer, move the metadata for a pool to a separate device split IO between the two. The dangerous part is the you pretty much lose the pool if you lose sdc. Seems like one should set up a mirror for sdc and sda.
Anyway, the special device is not what OP wants. If you look at his post in #6, 3 way mirror would be the easiest since it's already a mirror, but automated zfs send | receive on datasets/pool would also work.
 
The metadata are inexorably linked to the actual data, and it's not sensible to want to back them up separately (because the first change you make to the file system will render the metadata backup obsolete). Back up your data to separate media (e.g. with zfs send) and the metadata will get backed up as well.
 
Back
Top