ZFS-only booting on FreeBSD
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sat Feb 19 12:01:54 UTC 2011
On 18/02/2011 15:59, Daniel Staal wrote:
>
> I've been reading over the ZFS-only-boot instructions linked here:
> <http://wiki.freebsd.org/ZFS> (and further linked from there) and have one
> worry:
>
> Let's say I install a FreeBSD system using a ZFS-only filesystem into a
> box with hotswapable hard drives, configured with some redundancy. Time
> passes, one of the drives fails, and it is replaced and rebuilt using the
> ZFS tools. (Possibly on auto, or possibly by just doing a 'zpool
> replace'.)
>
> Is that box still bootable? (It's still running, but could it *boot*?)
Why wouldn't it be? The configuration in the Wiki article sets aside a
small freebsd-boot partition on each drive, and the instructions tell
you to install boot blocks as part of that partitioning process. You
would have to repeat those steps when you install your replacement drive
before you added the new disk into your zpool.
So long as the BIOS can read the bootcode from one or other drives, and
can then access /boot/zfs/zpool.cache to learn about what zpools you
have, then the system should boot.
> Extend further: If *all* the original drives are replaced (not at the same
> time, obviously) and rebuilt/resilvered using the ZFS utilities, is the
> box still bootable?
Yes, this will still work. You can even replace all the drives
one-by-one with bigger ones, and it will still work and be bootable (and
give you more space without *requiring* the system be rebooted).
> If not, what's the minimum needed to support booting from another disk,
> and using the ZFS filesystem for everything else?
This situation is described in the Boot ZFS system from UFS article
here: http://wiki.freebsd.org/RootOnZFS/UFSBoot
I use this sort of setup for one system where the zpool has too many
drives in it for the BIOS to cope with; works very well booting from a
USB key.
In fact, while the partitioning layout described in the
http://wiki.freebsd.org/RootOnZFS articles is great for holding the OS
and making it bootable, for using ZFS to manage serious quantities of
disk storage, other strategies might be better. It would probably be a
good idea to have two zpools: one for the bulk of the space built from
whole disks (ie. without using gpart or similar partitioning), in
addition to your bootable zroot pool. Quite apart from wringing the
maximum usable space out of your available disks, this also makes it
much easier to replace failed disks or use hot spares.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20110219/94f7cc99/signature.pgp
More information about the freebsd-questions
mailing list