[zfs-discuss] Boot Mirror

Chris Siebenmann cks at cs.toronto.edu
Tue Apr 12 20:45:46 EDT 2016


> With openindiana, the process to mirror the boot volume is painless
> and straightforward. With linux, the best I know is to boot from the
> installation cd/usb, and then manually partition and manually setup
> mirroring, and leave a second (third) partition which will later be
> used for zfs mirroring. It's all a lot of hassle, and even worse when
> a drive fails and you have to then prepare a new volume for mirroring,
> manually, without the "convenience" of the OS installation tools -
> which weren't amazingly convenient themselves because of all the
> manual partitioning and stuff.

 CentOS 7 does mirroring at install time the sensible way: you tell
it you want a RAID-1 mirror that is so large, and it magically makes it
happen. If you want to save space for a ZFS mirrored vdev, I would take
the hack way of configuring an additional RAID-1 mirrored chunk during
installation and then disassembling that RAID-1 mirror afterwards to
turn it into a ZFS pool. This is a little annoying (and you might even
be able to avoid it, check what the installer lets you do here), but
at least it's a one-time thing.

(I believe it would be possible to automate all of this with Kickstart
if you wanted to, but I'm assuming that's overkill. And if you're going
with fully automated installs I believe Ubuntu can also be set up to do
the same thing.)

 If you're doing disk replacement after install and using identical
replacement disks, the easy tool for copying partitioning from one
disk to another is either sfdisk (for sufficiently small disks that
are using MBR partitioning) or sgdisk for disks that are using GPT
partitioning[*]. This is the rough equivalent of using Illumos/OmniOS
prtvtoc | fmthard to copy partitioning from one disk to another.
Any Linux distribution will support this, not just CentOS 7. You
then use mdadm (and zpool) to reattach the partitions on the new
disk to the old disk in order to heal the mirrors and so on, but
this is not fundamentally different from Illumos.

	- cks
[*: copying GPT partitioning with sgdisk is a little bit involved. See
    https://utcc.utoronto.ca/~cks/space/blog/linux/CopyingGPTPartitioning
]


More information about the zfs-discuss mailing list