This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

backup of ZFS metadata?

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
geos
NewUser
NewUser
Posts: 10
Joined: 23 Mar 2017 23:18
Status: Offline

backup of ZFS metadata?

Post by geos »

consider a disk with old-fashioned ms-dos partition table on it. overwrite first 512B of the disk with garbage and you end up with problem of some sort. but if you have a backup of first 512B and overwrite "the garbage" in first sector with the backup content then the problem "dissapears" like no issue ever happened...

now, I'm wondering what is happening when one issue a command to destroy ZFS pool. is some metadata erased then? is something else happening under the hood that actually doesn't destroy the content? is there a chance that ZFS uses metadata at specific areas on each disk belonging to pool and that matadata can be backed-up and restored in case of emergency?

I have no deep knowledge on the subject and I'm not sure if it makes sense at all. I just used example above to picture the backup/restore procedure to make disk working again fast. I imagine that in case of some partial accidental overwritten some of the content would be gone but maybe, if (big if) such metadata could be restored at least the structure of the ZFS pool would still exists and some files -- not overwritten -- still accessible?

I would appreciate your explanation on the subject.

thank you,
geos

substr
experienced User
experienced User
Posts: 113
Joined: 04 Aug 2013 20:21
Status: Offline

Re: backup of ZFS metadata?

Post by substr »

It isn't likely that doing that with ZFS metadata would be of any use. ZFS has multiple copies of metadata on the disk to protect against a random corruption. If it was of any use, you would have to be doing it very frequently.

When you do a pool destroy, it just changes the metadata to show the pool is destroyed so the disks can be used in a new pool without getting a warning or error. You can attempt to reverse it if nothing else is done.

If you have a partition table on a disk, you might save a copy of that. Inside of ZFS, you can make frequent automatic snapshots and use zfs hold. For the rest, you make backups.

User avatar
JoseMR
Hardware & Software Guru
Hardware & Software Guru
Posts: 1058
Joined: 16 Apr 2014 04:15
Location: PR
Contact:
Status: Offline

Re: backup of ZFS metadata?

Post by JoseMR »

Hello MBR is old technology, you may want GPT for partition table redundancy, as for ZFS metadata locations, it uses different areas on the disk to store its metadata for redundancy, it is possible that you could create a script for image this disk locations with DD, though this requires the user to be highly familiar with the disk geometry and disk imaging practices in order to avoid catastrophe.

Having at least a pair of drives for redundancy is just more than enough in this subject IMHO, but if you still want to experiment, the you might want to Google and study the ZFS On-Disk Specification and label layouts, as well as for GPT/MBR.

Regards
System: FreeBSD 12 RootOnZFS Mirror, MB: Supermicro X8SI6-F, Xeon X3450, 16GB DDR3 ECC RDIMMs.
XigmaNAS RootOnZFS
Addons at GitHub
BastilleBSD
Boot Environments Intro
Resources Home Page

Post Reply

Return to “ZFS (only!)”