ZFS pool data recovery

Jonni Nakari jonni at egarden.fi
Wed Feb 20 15:06:33 UTC 2013


On 18.02.2013 16:06, Jonni Nakari wrote:
> I started "zpool import -nfFX vault" but it seems to take quite long.
>
> Some more information about my system:
> zpool vault consists of 5 block devices:
> whole disks: ada1, ada2, ada3
> cache: ada0s1e
> log: ada0s1d
>
> The system boots from a UFS filesystem ada0s1a.
The command
root@:/root # zpool import -nfFX vault

returned after few hours:
Would be able to return vault to its state as of Sun Feb 17 03:07:36 2013.
Would discard approximately 20 minutes of transactions.

So I ran
root@:/root # zpool import -fFX vault

and few hours later returned:
Pool vault returned to its state as of Sun Feb 17 03:07:36 2013.
Discarded approximately 20 minutes of transactions.

After that I could import the pool in the memstick environment. I 
unmounted all ZFS file systems and exported the zpool and rebooted. 
However when the system boots from the UFS root it fails to mount root 
from ZFS:
Trying to mount root from zfs:vault/root []...
Mounting from zfs:vault/root failed with error 2.

To get the system booting from ZFS root I tried several things including:
  - recreating the /boot/zfs/zpool.cache,
  - cloning the vault/root file system to vault/new_root,
  - setting the mountpoint of the root file system to / and legacy,
  - removed the cache and log devices from the zpool.
I finally gave up and copied the contents of the vault/root file system 
to a UFS file system at ada0s1d and changed the system to mount root 
from there. /tmp, /usr and /var are mounted fine from the ZFS.

I really would like to back using the ZFS root file system. I documented 
the commands I used in the memstick environment and dmesgs of the 
failing ZFS boots and made them available here:
http://upload.egarden.fi/ultra40_zfs_fail

Maybe someone can figure out what I'm doing wrong? Before the suspend to 
RAM incident the system booted up just fine.

I used the following trick to get the dmesgs: when the system booted up 
and failed to mount the ZFS root I entered ufs:da0 to the mountroot> 
prompt to get in to the memstick environment.

-- 
Jonni Nakari
jonni at egarden.fi
+358 50 4411 784



More information about the freebsd-questions mailing list