ZFS root File System
Dan Nelson
dnelson at allantgroup.com
Fri Feb 27 20:43:04 PST 2009
In the last episode (Feb 27), Matthew Dillon said:
> My experience with one of our people trying to do the same thing w/
> HAMMER... we got it working, but it is not necessarily cleaner.
>
> I'd rather just boot from a small UFS /boot partition on 'a' (256M or
> 512M), followed by swap on 'b', followed by the big-ass root partition on
> 'd' using your favorite filesystem.
>
> The boot code already pretty much handles this state of affairs, one only
> needs:
>
> (1) To partition it this way.
>
> (2) Add line to /boot/loader.conf pointing the kernel at the actual root,
> e.g. (in my case):
>
> vfs.root.mountfrom="hammer:ad6s1d"
>
> (3) Adjust sysctl kern.bootfile in e.g. /etc/sysctl.conf. Since the
> boot loader thinks the kernel is on / instead of /boot (because
> /boot is the root from the point of view of the bootloader), it might
> set this to "/kernel" instead of "/boot/kernel". So you may have to
> override it to make crash dumps and name lists work properly.
>
> (4) Add a mount for the little /boot partition in /etc/fstab.
I find it better (and easier to recover if something bad happens) if you
create a /.boot filesystem with /boot and copies of
/{bin,sbin,lib,libexec,etc} from your root partition, then symlink /boot in
your root partition to /.boot/boot. That way you have a minimal system with
recovery tools in case your non-UFS root has problems of any sort, and /boot
always points to what you (and makefiles) think it should. If you have root
on mirrored disks, you can gmirror /.boot too. Works great for ZFS; should
work for HAMMER.
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-stable
mailing list