Re: disk naming proposal & devfs

James Mastros (root@jennifer-unix.dyn.ml.org)
Sun, 11 Jan 1998 23:35:52 -0500 (EST)


On Mon, 12 Jan 1998, Richard Gooch wrote:
> Larry McVoy writes:
> > The short summary is: can we please add a mechanism to the system that
> > names the /name/ of the data we want, not the /location/ of the data
> > we want? Something like /dev/usr that is a symlink to the real name of
> > where ever /usr plugged into the system today? This is most helpful to
> > people that move stuff around in their system.
>
> OK in principle...

I like... with devfs, we can acatually do this. (Better then current
scheme, better, perhaps, then exact nameing, if used in addition to, rather
then as a replacement to.)

> > /*
> > * Take a file system pointer and a dev pointer, read the last
> > * mount point from the super block, and add a node in for that
> > * mount point.
> > *
> > * I.e., if /dev/sda3 was "/usr", then add a symlink like so:
> > *
> > * /dev/usr -> /dev/sda3
> > *
> > * Handle "/" specially, make that one be
> > *
> > * /dev/root -> /dev/sda1
> > */
>
> What happens if I have the following:
> /dev/sda5 /home
> /dev/sdb1 /home/group1
> /dev/sdc1 /home/group2
>
> Because I have something mounted on /home, then your scheme requires a
> /dev/home symlink. But since you also need a /dev/home/group1 symlink,
> you're stuffed, because /dev/home needs to be a directory.
> One way around this is to translate the '/' to '!', so you would get:
> % cd /dev/mounts
> % ls -l
> ! -> /dev/sda2
> !home -> /dev/sda5
> !home!group1 -> /dev/sdb1
> !home!group2 -> /dev/sdc1

OK, fine. The principe is undisturbed.

> > The point is to be able to have the different partitions be //location
> > idependent//. So if a disk is added, or moved from controller to
> > controller, then the system can come up without needing to ask any
> > questions or having /etc/fstab changed. fstab can look something like
> >
> > /dev/root / ext2 defaults 1 1
> > /dev/usr /usr ext2 defaults 1 2
>
> I don't see how this could possibly work. If I haven't yet mounted
> /usr, how can the system know what /dev/usr is (in your naming
> scheme)?

So before you start refering to it as /dev/root, you mount and then umount
it there (using one of the other two naming schemes). Or you use tune2fs or
the -M flag to mke2fs.

To implement this, we would need a fairly simple way to get this data...
perhaps by extending struct statfs to have more feilds, and making it kosher
to statfs non-mounted fses?

> Er, hold on. I think I see more what you're trying to do. You want to
> move /etc/fstab elsewhere, essentially. So each FS/partition will
> record where it should be mounted?

Exactly... the last-mounted location is already in the ext2 superblock (but
none of the others, AFIAK... but also, more then that. For example, "umount
/usr; e2fsck /dev/usr; mount /usr")

-=- James Mastros