Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 2002 14:55:39 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mark Valentine <mark@thuvia.demon.co.uk>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, "M. Warner Losh" <imp@bsdimp.com>, cvs-committers@freebsd.org, cvs-all@freebsd.org, Mikhail Teterin <mi+celsius@aldan.algebra.com>
Subject:   Re: cvs commit: src/lib/libdisk Makefile chunk.c write_alpha_dis
Message-ID:  <XFMail.20021025145539.jhb@FreeBSD.org>
In-Reply-To: <200210251837.g9PIbGiI077709@dotar.thuvia.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 25-Oct-2002 Mark Valentine wrote:
>> From: jhb@freebsd.org (John Baldwin)
>> Date: Fri 25 Oct, 2002
>> Subject: Re: cvs commit: src/lib/libdisk Makefile chunk.c write_alpha_dis
> 
>> Huh?  The da0 is repetitive, too.  Look at my fstab:
>> 
>> /dev/ad0s2b             none            swap    sw              0       0
>> /dev/ad0s2a             /               ufs     rw              1       1
>> /dev/ad0s2g             /usr            ufs     rw              2       2
>> /dev/ad0s2f             /tmp            ufs     rw              2       2
>> /dev/ad0s2e             /var            ufs     rw              2       2
>> /dev/ad0s1              /windows        msdos   ro,noauto,longnames 0   0
>> 
>> isn't it pretty obvious why the 's2' is there?
> 
> No.  The 's' seems to stand for 'partition index', and if you're lucky
> the '2' will be the current index (from an origin of '1', I think, I can
> never remember, especially seeing all those '0's around) into the MBR
> partition table for a partition with type 0xa5.  But maybe it won't be
> tomorrow.
> 
> I know my system will boot tomorrow because by specifying /dev/da0a
> I'm more closely echoing the algorithm used by other operating systems
> on the disk to locate their partitions.

So according to you (using this argument of mount or the kernel or somebody
looking at foo0a and going "oh, you really mean foo0s3a so I'll fix it up
for you") I should be able to do "mount /dev/ad0 /windows" and it should
just do the right thing, right?  That's exactly the same thing that you are
asking for.  Or better yet, just 'mount -t msdos /windows' and someone
(mount? kernel?) is supposed to magically walk all the disk devices and
find some msdos filesystem and mount it.

What you really want to be able to do is closer to what julian described
where a volume knows where it is supposed to be mounted and when it is
inserted or detected it just gets mounted in the right place.

However, /etc/fstab is not that.  /etc/fstab is not even close to that
and perpetuating one specific hack instead of solving the general case
problem is not a clean way of doing things.  Especially when perpetuating
the hack involves adding hacks to the code that make it a lot harder to
solve the general problem.

Seriously.  What you want is logical volume names.  GEOM does not provide
that.  The old kernel code didn't either.  What you want is to add an
extra layer to do the physical <-> logical mapping.  If you want to work
on that, go for it.  Please don't try and pollute the layer that is in
charge of handling physical layout with that however.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021025145539.jhb>