Subject: Re: overlap, was Re: Work-in-progress "wedges" implementation
To: Jason Thorpe <thorpej@shagadelic.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 09/24/2004 18:29:23
--G6nVm6DDWH/FONJq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Sep 24, 2004 at 06:22:10PM -0700, Bill Studenmund wrote:
> On Fri, Sep 24, 2004 at 05:30:31PM -0700, Jason Thorpe wrote:
> > The problem I am getting at is... take a look at a BSD disklabel on a=
=20
> > PC, where that disk also has an MBR, possibly shared with another OS=20
> > (e.g. Windows):
> >=20
> > #        size    offset     fstype [fsize bsize cpg/sgs]
> >  a: 294250496  16386300     4.2BSD   4096 32768    64  # (Cyl.   1020 -=
=20
> >  19336*)
> >  b:   2098948 310636796       swap                     # (Cyl.  19336*-=
=20
> >  19466*)
> >  c: 296349444  16386300     unused      0     0        # (Cyl.   1020 -=
=20
> >  19466*)
> >  d: 312735744         0     unused      0     0        # (Cyl.      0 -=
=20
> >  19466*)
> >  e:  16386237        63       NTFS                     # (Cyl.      0*-=
=20
> >   1019)
>=20
> Here's what I was expecting would happen for this case. An MBR parser=20
> would read the base MBR partition layout, and add wedges for the Windows=
=20
> and the NetBSD MBR partitions. The NetBSD disklabel reader (or the=20
> NetBSD-disklabel-in-MBR-reader) would then read the disklabel and add=20
> partitions. It'd ignore 'c' and 'd' as they aren't needed. It would add a=
=20
> wedge for 'a' and 'b'. It would not add a wedge for 'e' as 'e' is outside=
=20
> of the parent wedge.

Oh, here's a devfs (thus we don't need to solve it now but we can be
assued the issue's been thought about and can be addressed) idea to add to
this case. When we find a NetBSD disklabel partition that's outside of the
NetBSD MBR partition, after we load all the found wedges, we go looking on
the whole device to see if we find a wedge that matches this partition. We=
=20
then can create an alias (say a symlink in devfs, or some sort of alias=20
node) to this other wedge. So something that really wants wd0e can get the=
=20
right wedge. Obviously in the long run you'd want to stop refering to=20
wd0e, but you want to do that anyway. :-)

Take care,

Bill

--G6nVm6DDWH/FONJq
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFBVMnzWz+3JHUci9cRAvSeAKCSApoX3X6yjamAcuQMuj1caJlFFgCcCN/r
O+EEVBLT3piTPjfIItu3YqU=
=0E8g
-----END PGP SIGNATURE-----

--G6nVm6DDWH/FONJq--