Re: ZFS-only booting on FreeBSD



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@xxxxxxxxxxxxxxxxxxxxxx Kent, CT11 9PW

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • RE: Sudden wierd SATA problem on RELENG_7 (Re: ZFS hanging at kernel boot now, but didnt before... (
    ... I saw really strange stuff with one bad SATA cable on my 6 drive ZFS array. ... kernel boot now, but didn't before... ... and the system booted just fine on the remaining 4 drives. ... (gmirror on 500Mb partition on each of five disks, ...
    (freebsd-stable)
  • ZFS root file system fun, flash USB, swap
    ... To avoid issues with sharing the disks with ZFS and UFS, I am using a USB pendrive on which I copy the /boot directory. ... zpool create pool/root/usr ... zpool set mountpoint=legacy pool/root ...
    (freebsd-stable)
  • Re: RELENG_7: zfs mirror causes ata timeout
    ... I have two 500GB WD Caviar GP disks on a mini-itx GM965-based board ... ZFS -- instead, it appeared to be specific to the motherboard I was ... what was ad6 is ad4. ... these drives, ditto with an offline test? ...
    (freebsd-stable)
  • RE: ZFS disk replacement questions
    ... when you create the ZFS pool you will use the glabel'd names. ... ZFS will figure out the drives since they get labelled by ZFS ... enclosure "arraydrive00" and then glabel the individual disks with the ... While the generic atadriver will work for pretty much ...
    (freebsd-questions)
  • Re: Can I do it to Conduit?
    ... re-press the control key for each of the four characters to be sent. ... I wonder if zfs is as great as "they" say. ... I wonder what pattern is used to represent the disks on a BSD ... I haven't checked to see what they call the fibre channel drives, ...
    (rec.crafts.metalworking)