gptzfsboot targeting wrong vdev
Christian Kratzer
ck-lists at cksoft.de
Mon Jul 6 13:10:26 UTC 2020
Hi,
I have a couple of freebsd based zfs servers on 12.1-RELEASE-p6 that have zfs root and separate geli procted zfs data pools.
I have been booting these off usb sticks or sdcards with a copy of /boot
and the geli keys and then subsequently mounting root from the zfsroot pool.
root at zfs1:/home/ck # zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zp1 3.62T 242G 3.39T - - 3% 6% 1.00x ONLINE -
zp2 21.8T 13.2T 8.51T - - 13% 60% 1.00x ONLINE -
zroot 127G 112G 15.1G - - 30% 88% 1.00x ONLINE -
root at zfs1:/home/ck #
In above setup zroot is an unencrypted two ssd vdev with just the OS on it.
The disks for zp1 and zp2 are encrypted using geli via keys provided in loader.conf.
Above setup is working fine whilst I keep /boot on the usb stick.
I have tried again to get rid of the usb stick and booting directly from the mirror on zroot.
I have following in my loader.conf
# zfs
zfs_load="YES"
vfs.root.mountfrom="zfs:zroot/ROOT/default"
vfs.zfs.boot.primary_pool="17582686064334413803"
vfs.zfs.boot.primary_vdev="9317482241260982593"
I got the guid values using
root at zfs1:/usr/src # zpool get guid zroot
NAME PROPERTY VALUE SOURCE
zroot guid 17582686064334413803 default
root at zfs1:/usr/src # zfs get guid zroot/ROOT/default
NAME PROPERTY VALUE SOURCE
zroot/ROOT/default guid 9317482241260982593 -
I also have following setup on the devices that are part of zroot
root at zfs1:/home/ck # gpart show ada0
=> 40 468862048 ada0 GPT (224G)
40 1024 1 freebsd-boot (512K)
1064 134217728 2 freebsd-swap (64G)
134218792 33554432 3 freebsd-zfs (16G)
167773224 33554432 4 freebsd-zfs (16G)
201327656 267534424 5 freebsd-zfs (128G)
468862080 8 - free - (4.0K)
root at zfs1:/home/ck #
When booting from ada0 I get following:
ZFS: i/o error - all block copies unavailable
ZFS: can't read MOS of pool zp1
gptzfsboot: failed to mount default pool zp1
FreeBSD/x86 boot
At least it seems that my bios is loading the zfs loader from the correct gpt partition.
But I cannot figure out why it is still trying to boot from zp1 and not zroot.
I have not been able to break out into the loader via serial console to inspect if those vfs values are really there.
I do see them if I boot via my usb stick copy of /boot
root at zfs1:/home/ck # kenv | grep vfs
vfs.root.mountfrom="zfs:zroot/ROOT/default"
vfs.zfs.boot.primary_pool="17582686064334413803"
vfs.zfs.boot.primary_vdev="9317482241260982593"
root at zfs1:/home/ck #
This should all be unrelated to geli as I only need the zroot pool mounted at this point in time which is unencrypted.
I am a bit lost at this stage and would have following questions if anybody can help me:
1. Am I getting the correct guid values for the primary_pool and _vdev or am I misundestanding the requirements ?
2. How can I break into the loader to inspect or set kenv values ?
3. Should I perhaps try exporting zp1 and zp2 so as only to have zroot visible ?
4. Can I try setting the vfs variables from /config ? How would the syntax for that be ?
Anything else I can do or check to get this to work ?
Greetings
Christian
--
Christian Kratzer CK Software GmbH
Email: ck at cksoft.de Wildberger Weg 24/2
Phone: +49 7032 893 997 - 0 D-71126 Gaeufelden
Fax: +49 7032 893 997 - 9 HRB 245288, Amtsgericht Stuttgart
Mobile: +49 171 1947 843 Geschaeftsfuehrer: Christian Kratzer
Web: http://www.cksoft.de/
More information about the freebsd-fs
mailing list