Subject: Re: Boot device confusion
To: None <tech-kern@netbsd.org>
From: Daniel Carosone <dan@geek.com.au>
List: tech-kern
Date: 06/22/2005 12:11:09
--3BZbN51TFvUEXf+G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 21, 2005 at 09:02:58PM -0400, Allen Briggs wrote:
> > This also strikes me as unlikely to work if the BIOS RAID is a pure
> > mirror of identical drives - won't the sizes be the same inside and
> > outside the ld/wd disklabel?
>=20
> At least in the cases I've seen, the configuration is stored on the
> disk in reserved sectors

So the sizes *are* different, to account for these sectors...  I
gathered they must have been, or the idea wouldn't have occurred to
you in the first place; I wondered if that was because you were using
BIOS RAID0, since I gather at least some of these BIOS RAID hacks
store config on the controller/motherboard, rather than the disk (or
at least we should anticipate that one foolishly will).

How annoying that they don't put their reserved labels at the start,
and thus cause such confusion and ambiguity.

> (and those sectors are not accessible through the RAID).

But they are accessible through the wd devices, and this does mean
that the wd0 disklabel needs to be adjusted:

  - a disk with a previous label from bare use, now being folded into a
    mirror, has a label that marks those reserved sectors as usable.

  - the wd0 label for an RAID0 ataraid would be larger than the physical=20
    disk, but would hit the reserved sectors (I guess at the end of
    the disk?) before running off.

> > Finally: The only immediate problem I can see with disabling (or
> > preempting) the component drives for findroot (by default, overridable
> > via hardwired config root) is if these BIOS RAID tools allow partial
> > or mixed RAID ld volumes on the one disk, rather than working only
>=20
> I haven't seen this yet, but I've only used the Promise and Adaptec
> BIOS.

There is at least also highpoint and silicon image (both cmdide and
satalink), and Intel's AHCI. I guess VIA, too, though I've not seen
one of those, and no doubt others and more to come.

> > For example: a small mirrored root 'volume'
> > for booting and some other RAID level for the rest,
>=20
> I'd actually like to be able to do this here, so I'll probably go
> ahead and end up using RAIDframe on these machines now.

You're going to have even more label-based fun here, if you want to be
able to boot off the BIOS mirror.  You can (have to) line up the
labels, so that while ataraid-ld0 spans the entire disk, ld0a for
root/boot only uses a small amount of space, and the rest (ld0e, say,
and thus also wd0e and wd1e) is a partition for RAIDframe. =20

Doing it this way will avoid wd0e (and thus RAIDframe) hitting the
BIOS's reserved label sectors, though it'd be nicer if you knew
explicitly where they were.

However, you're going to have to prevent RAIDframe from looking at
ld0e, or it will see something very strange, possibly parts of each of
the other disks' RAIDframe labels, or at best the same disk twice;
this probably means you can't use raid autoconfig. AND you're going to
have to avoid all other access to ld0 outside of ld0a, because
otherwise the ld mirror will trash RAIDframe's not-really-mirrored
data.

Despite the ugliness, it does mean you can really boot off the mirror
even when the primary disk fails, and use (say) RAID5 for your bulk
data across several other disks as well.  You might also consider
loading the kernel from some other non-disk device(s), such as a flash
widget or even network, and having root-on-RF.  If the BIOS can boot
from a list of devices without complaining about a disk disappearing,
you can even just let it try one disk then the other without being
aware of mirroring.

All of these complexities are for more advanced setups; it would be
very nice for the simple end user to have simple BIOS RAID setups Just
Work, and I think your suggestion is pretty much the way to go for
that.

> > The common case would be for booting from a BIOS mirror, and thus it's
> > probably a sensible default; it might be nice if wdN were still
> > available as choices for 'boot -a' though, as well as tweakable with
> > kernel config.
>=20
> Yah.  As long as the BIOS sees the components, the loader should be
> able to use them.

Sure.  My point was just to be careful about how we disable the
component disks as root candidates after the loader has finished and
the kernel has probed an ataraid ld0; even if findroot() won't use wd0
or wd1, it should still be in the list for manual selection after
'boot -a'.

--
Dan.
--3BZbN51TFvUEXf+G
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFCuMi9EAVxvV4N66cRAiTlAJ4kwjP0rU/JttrXeo74BCMLudUlKwCglq9b
d66h0zePRsKBQLHcrdkbmYw=
=JW3/
-----END PGP SIGNATURE-----

--3BZbN51TFvUEXf+G--