ZFS - best practices, alternate root

Charles Sprickman spork at bway.net
Wed Apr 7 07:53:29 UTC 2010


Howdy,

I'm starting to roll out zfs in production and my primary method for doing 
any remote rescue work is to do a network boot that loads a mfsroot image 
with a number of extra tools (including zpool and zfs commands) and 
loader.conf options that load zfs.ko and opensolaris.ko.

I've been documenting a number of the gotchas and little non-obvious 
things I've found when running a root on zfs setup.  One place where I'm 
getting stuck is working with the zfs root pool when I'm booted off 
alternate media.  For example, I do a network boot and a "zpool list" 
shows no pools, so I do a "zpool import -f zroot".  Is this correct?  When 
I'm done do I need to do an export and import cycle to get things ready 
for booting off the local zfs pool on reboot?

The other little point of confusion is dealing with mounting the zfs root 
filesystem when in my netboot environment.  Mounting say, just the root fs 
manually (ie: mount -t zfs zroot /mnt) works, but when I unmount it and do 
a "zfs list", I see that zfs now thinks "/mnt" is the new mountpoint. 
I've been digging around opensolaris docs, and I'm not seeing what the 
proper way is to "temporarily" alter a zfs mountpoint.  I know that I can 
manually set it back to legacy root, but it's bad news if I forget that 
step.

Lastly, say I've imported the pool, mounted root, altered something on the 
mounted zfs filesystem, unmounted it, set the mountpoint back to legacy 
root, what's the proper way to prep the pool to be ready for my next 
normal boot.  Do I need to do the "zpool export/import" shuffle and copy 
the /boot/zfs/boot.cache back over in this situation?

Thanks,

Charles


More information about the freebsd-fs mailing list