few ideas for zfsloader (boot environments)

Andriy Gapon avg at icyb.net.ua
Thu Apr 29 16:30:03 UTC 2010


on 16/03/2010 21:07 Andriy Gapon said the following:
> 3. Currently ZFS boot chain lacks an ability to switch bootfs property of a pool.
> So, if a (new) boot environment is not quite bootable and bootfs points to it,
> then an alternative boot media (e.g. livecd) is needed to correct the situation.
> Implementing selection of a boot filesystem in ZFS boot chain seems like a hard task.
> Alternative idea: a new FreeBSD-specific pool property, nextbootfs.  This property
> would designate a boot filesystem for the next boot and would be automatically
> reset by a boot loader at sufficiently early stage.  If the next boot doesn't
> succeed, then we are back to the regular bootfs property, if it does succeed, then
> bootfs can be safely changed to the new value.

I've git it all backwards.
It is hard to implement nextbootfs property, see my other post about nextboot.
It is possible to implement boot environment selection in zfs boot code.

We could use the same approach as in OpenSolaris version of GRUB.
E.g. have a file in root filesystem of a pool (the filesystem that has the same
name as the pool) named, say, boot/boot.list that would have a one-per-line list
of supposedly bootable filesystems in a pool.
zfsboot would read that file and present the list to a user.  Entry selected by
bootfs would be a default one.  If user chooses a different filesystem, then the
boot code would try it for boot (find loader, etc).

BTW, it's already possible to use FreeBSD+ZFS+GRUB and have this ability (in some
form).  But it would great to have that "natively".

Couple of useful links:
http://grub.enbug.org/GRUB2FreeBSDZFS
http://www.mail-archive.com/grub-devel@gnu.org/msg15161.html
Thanks to Navdeep for the GRUB work!

BTW, Navdeep, was there any progress on your grub+zfsloader patch?
Or GRUB folks plainly refused it?

-- 
Andriy Gapon


More information about the freebsd-fs mailing list