[OpenIndiana-discuss] in desperate need of fsck.zfs

Jim Klimov jimklimov at cos.ru
Wed Jul 25 06:45:09 UTC 2012


2012-07-25 1:48, Richard Elling wrote:
>> How do I backup/restore zfs labels?
>
> Your zfs labels are ok, otherwise you could not import the pool.
>   -- richard

The idea was to enable him to try TXG rollbacks, and if things
become even worse (by some definition), i.e. if he rolls back
too far, then he can put back labels which reference newer TXG
numbers. My hope is that if he only imports this pool in readonly
mode, reappearance of newer TXGs would be to an extent vaid
(i.e. they would point to correct on-disk structures)...

I might be wrong to do so, but during my experiments I just used
DD to copy off or replace from backup the first 512K and the last
512K of each slice (partition) actually used by the ZFS pool to
hold data. These locations should hold the L0 L2 and L1 L3 labels.
Note that each disk's labels are individual, and if all is ok
(consistent), the 4 labels of one disk should be the same.

If your pool gets imported upon system startup, and can't be
exported nor accessed, Ray might want to remove the zfs-pool
reference file /etc/zfs/zpool.cache, so only rpool gets imported
upon boot. Then, to prevent adding the problematic pool from
getting added into the cache file, always use something like:
   zpool import -R / (other params) poolname-or-GUID

The -R part quickly sets the flag to not use a cachefile.

HTH,
//Jim




More information about the OpenIndiana-discuss mailing list