[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub-setup on ZFS (Re: [PATCH] Enable `grub-probe -t device' resolu

From: Seth Goldberg
Subject: Re: grub-setup on ZFS (Re: [PATCH] Enable `grub-probe -t device' resolution on ZFS)
Date: Sun, 15 Aug 2010 23:56:40 -0700 (PDT)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

Quoting Robert Millan, who wrote the following on Wed, 4 Aug 2010:

2010/8/4, Seth Goldberg <address@hidden>:
I don't think this is the appropiate place for this kind of sanity check.
Keep in mind "grub-probe -t device" has many purposes, and for some of
(e.g. determining the partmap) the ZFS status is irrelevant.

   Hmm.  I do see your point here, but then I'd ask how you plan to handle
ensuring that all disks in a mirror are properly updated with boot/core.
I think the proper thing would be either to have grub-probe output a set of
devices, onto which grub-setup would iterate and install boot/core, or
implement an abstraction that allows that to happen behind the scenes.  How
does this work for lvm or other raids?

There are two approaches, one of them is simply to run grub-install for each
of the intended devices.  This is what Debian scripts do, and is independant
on the content in the partitions of those devices (lvm, raid, zfs, whatever).

The other is giving grub-setup special knowledge of the abstraction. We do
this for RAID1, see the code around:

util/i386/pc/grub-setup.c:      devicelist = grub_util_raid_getmembers

which allows user to e.g. "grub-install /dev/md0". Then the scripts
embed raid.mod
into core.img, and (in principle) after core.img has been loaded GRUB has RAID
mirroring protection to access /boot/grub/.

I suppose it's possible to do something similar for ZFS mirror layouts.

I think that's a great idea. Doing it outside grub-setup seems a bit more error-prone to me (but that's actually what we do today in Solaris).

   The question is: should GRUB2's installation be implicit or explicit for
all members of a mirrored root pool when grub-setup is invoked.

Implicit approach only works for mirrored setup.  If you want to install to all
members in a non-mirrored pool, you still need explicit approach, so I'd only
implement implicit one if there's a clear benefit, such as the protection
offered by mirroring.  I would check if zfs.mod from grub-extras provides this
protection before trying to answer this question.

That's true -- right now, we only support root on an n-way mirrored pool. If support is expanded in the future, why wouldn't a similar grub_util_raid_getmembers() not work in an analagous way to the mirrored case?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]