Re: disk naming proposal & devfs

Richard Gooch (rgooch@atnf.CSIRO.AU)
Mon, 12 Jan 1998 08:26:46 +1100


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...

> /*
> * 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

> 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)?

> As far as I know, no other Unix system (or VMS/NT for that matter) has
> such a system. IRIX did something like this (has a /dev/root symlink)
> but I don't think it is used to mount the file system, it is made after
> booting up.

That's because you have a chicken and egg problem :-)

> There is an issue with copied file systems (if you copied it with a dd
> if=/dev/sda1 of=/dev/sdb1 bs=1024000 then both super blocks would look
> like they wanted to be at the same place). In this case, I think mount
> should do two things:
>
> . ask the user (via the console if booting up) which one they meant
> . mark the other one as "usr~1" or something like that.
>
> You could have a date based scheme where the most recently unmounted one
> wins. So when the system goes down, it stashes the date along with the
> mount point in the super block.
>
> Anyway, that's a corner case and one that can be handled. The main thing I
> want is, in spite of the niceness of /dev/c1d2s0 or whatever, I'd just as
> soon think about /dev/root rather than the exact name. Exact names can be
> used for those people that want exact names.

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?

Regards,

Richard....