Boot with ZFS failed with error 2

Hello forum,

I am stuck at the boottime of a freshly installed FreeBSD System 9 on amd64 with zfs and geli.

During boottime I have to enter the geli passwords for the devices and the associated keys, this is working (I see the .eli devices in the mount prompt later). After successfully attach geli I get the error message:
Code:
Mounting from zfs:zpool failed with error 2.

I booted already several times into live fs and adjusted some of the properties like mountpoint to / and legacy, can mount on / off.

What else I might want to check?

Thanks,
Eyebone
 
You need to 'regenerate' the /boot/zfs/zpool.cache file.

To do that, boot from FreeBSD live CD, then after attaching the GELI devices do:
Code:
# zpool import -f -o cachefile=/tmp/zpool.cache -o altroot=/mnt YourPoolName
# cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache
# zpool export YourPoolName
# zpool import YourPoolName
 
vermaden said:
You need to 'regenerate' the /boot/zfs/zpool.cache file.

To do that, boot from FreeBSD live CD, then after attaching the GELI devices do:
Code:
# zpool import -f -o cachefile=/tmp/zpool.cache -o altroot=/mnt YourPoolName
# cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache
# zpool export YourPoolName

Thanks! Your posting remembered me that I always give the cache the name of the pool and the boot loader is searching for zpool.cache and not for mypool.cache.
 
I have the same problem, however the zpool.cache regeneration did not work for me, does the mount point property must be set to legacy on the pool?
 
The pool must not be in "exported" state when trying to boot from it. Redo the
Code:
# zpool import -f -o cachefile=/tmp/zpool.cache -o altroot=/mnt YourPoolName
# cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache
# zpool export YourPoolName
then # zpool import YourPoolName and reboot
 
I first tried the @vermaden without reading to the end of the thread and it didn't work. The extra bit from @HarryE was required. Even though I had reset /boot/loader.conf to the new name of my root pool, I still had to enter it by hand at mountroute.

Strangely, I now see in /boot/loader.conf that
Code:
vfs.root.mountfrom="zfs:oldname/root"
This is neither the new name I see with zpool list (the same I had to give at the mountroute prompt). Is it going to boot next time without help? I don't know.

Would be nice if the critical @vermaden post could be edited with the extra bit in the fashion of StackExchange.
 
Last edited by a moderator:
Back
Top