Re: About /etc/mtab and /proc/mounts

Miquel van Smoorenburg
2003-02-27T23:43:54Z

In article <3E5E91B2.8EACF7D0@daimi.au.dk>,
Kasper Dupont <kasperd@daimi.au.dk> wrote:
>The only case that couldn't be done from userspace is mounting of the
>root. Now some people might say nobody would need that feature, and it
>could be done using initrd and some pivot_root stuff anyway.

Well, the kernel already has a simple rootfs built-in, on top of
which the real root filesystem gets mounted at boot-time.

Also POSIX makes a difference between '/' and '//'. '//' might
point to a different namespace.

So why not mount rootfs on '//', mount the real rootfilesystem
on //root, then chroot to //root (while keeping it possible to
chdir("//") ).

If mkdir and rmdir is added to rootfs, you could even mount //mtab.d
there, or //proc, or //devfs, whatever you want to have available
when the root filesystem is being fscked or not even mounted yet.
Perhaps the kernel should mount all those pseudofilesystems there
by default even.

Apollo/DomainOS had this '//' thing, used for something different
(it was the equivalent of their /net autofs mountpoint) but it
worked quite well and didn't get in the way of normal '/' operation.

Mike.
--
Anyone who is capable of getting themselves made President should
on no account be allowed to do the job -- Douglas Adams.