ZFS: deferring automounts/mounting root without bootfs [9.0-BETA2]
Rotate 13
rabgvzr at gmail.com
Mon Sep 19 15:29:42 UTC 2011
9.0-BETA2 system is booted off removable UFS volume, but root is
mounted from ZFS. I try to meet the following two goals:
1. Not use bootfs property (too many limitations mentioned in docs)
2. Use ZFS inheritable mountpoints and management (not clutter up
/etc/fstab... and not set mountpoint= on each child dataset!)
Config info is below. Result: System boots, but hangs with
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyv0: No
such file or directory
(and many similar messages) I think I need some way other than bootfs
to defer ZFS automatic mounting until after / is mounted.
Apparently mount is not functioning right. I am guessing that ZFS
tries to mount tank/usr, tank/var and so forth before root is mounted
(thus mounts fail). However this is just a guess - based on what
happens when I zpool import -f -o altroot. For obvious reason, I
don't have logs of above problem; and I cannot review the messages
that scrolled by, as this keyboard completely lacks a scroll lock key
(guilty: Dell).
Simplified config (have tried number of subtle variations):
zpool create -O canmount=off -O mountpoint=/ setuid=off tank /path/to/disk
zfs create -o mountpoint=legacy -o setuid=on tank/root
[...create datasets for /usr, /var, and so forth, inheriting root mountpoint...]
= On UFS volume: =
/boot/etc/fstab:
tank/root / zfs rw,noatime 0 0
/path/to/ufsboot /boot rw,noatime 0 0
/boot/loader.conf
zfs_load="YES"
vfs.root.mountfrom="zfs:tank/root"
= On ZFS volume: =
/etc/fstab:
tank/root / zfs rw,noatime 0 0
/etc/rc.conf:
zfs_enable="YES"
(also tried placing this on UFS volume in /boot/etc/rc.conf)
/boot on ZFS is kept in sync with /boot on UFS volume.
Note, zpool is exported/imported and zpool.cache properly placed in
/boot/zfs; before I did that, I got mountroot followed by panic.
Off hand note: I get lots of lock order reversals mounting
filesystems on 9.0-BETA2. But not specific only to ZFS.
Thanks for any advices in making work an unusual, but very useful configuration.
More information about the freebsd-fs
mailing list