Subject: Re: Config ...
To: Eduardo E. Horvath <eeh@one-o.com>
From: Matthew Jacob <mjacob@feral.com>
List: tech-kern
Date: 08/21/1998 10:32:11
On Fri, 21 Aug 1998, Eduardo E. Horvath wrote:

> On Fri, 21 Aug 1998, Matthew Jacob wrote:
> 
> > The question is, what will you call the root disk in /etc/fstab? Will
> > it be the globally unique name or the boot name? The boot name usually
> > specifies how you were able to get to it from the boot prom. In OBP
> > namespaces this is a device tree. In BIOS name spaces, it's the BIOS
> > code (0x80 and above.). The global name, or the construction of it,
> > may be a very expensive process timewise and subsystem wise. And anyway,
> > you may want a root device separate from what you loaded the kernel
> > from.
> 
> For consistency you would want to use whatever scheme you use to identify
> the device when the system is running.  That way your configuration
> remains relatively static across H/W reconfigs.  You would also want to
> use this name for `boot -a'.  (Whether you can do this is another issue.)

I'm not sure about this. Currently, in single user, a 'mount' command
sez "root_disk" is the currently mounted partition. So, maybe things
can change depending on run state.

> 
> > > When would you create the device name?
> > 
> > That's an open question (:-)). I think as late as possible- possibly
> > not until open time and use a VFS to get to it.
> 
> The problem, of course is that you can't access the device until you 
> have a device node for it, and you need the device's name to generate the 
> node. 
> 

Well, yes.

> > Perhaps a cheezy little hack early in rc.single that builds system
> > unique disk identifiers (based upon the hierarchy of WWN, VPD/Inquiry
> > INFO, <other>, Disk Label Identifier) for all probed disks, and uses
> > *that* to match (with aliases for ease of use) with entities in
> > /etc/fstab. Or perhaps this could be a VFS mounted first with the
> > kernel cons'ing up the names? Would this be an acceptable first
> > pass?
> 
> You don't want to have to depend on anything to get into single-user mode.
> In fact you don't want to have to even mount the root partition
> read/write.

I'm not worried *too* much about single-user as you really don't have
anything mounted yet- you just know (via the current config mechanism)
which device instance (Umm- I haven't checked single user nfs on this,
someone correct me if this is wrong) inside it takes to read and write 
blocks, filesystems, etc... The trick here is in getting the names
redone on the way out of single user. Currently this requires that
/etc/fstab is correct, and yes, this is a read-only mount. I fix
this regularly by forcemounting the new 'correct' root manually
and editting fstab when I change locations of the disk. I see
nothing wrong in principle in automating this operation, either
in the rewriting of fstab or in requiring a VFS mount on the
way out of single user in order to get the unique names in
fstab matched up to the actual wiring underneath.