Re: Overmounting a filesystem
Jeff Voskamp [MFCF] (javoskam@math.uwaterloo.ca)
Tue, 9 Apr 1996 16:46:31 -0400 (EDT)
>On Tue, 9 Apr 1996, H. Peter Anvin wrote:
>> > On 9 Apr 1996, H. Peter Anvin wrote:
>> >
>> > > Currently it seems Linux does not permit overmounting a filesystem
>> > > (mounting a filesystem on top of another, on the same path).
>> >
>> > Just tried it, and it works:
>> >
>> > /dev/hda1 on / type ext2 (rw)
>> > /dev/hda2 on /home type ext2 (rw)
>> > /proc on /proc type proc (rw)
>> > /dev/hda3 on /home/eddie type ext2 (rw)
>> >
>>
>> Try mounting /dev/hda3 on /home, on top of /dev/hda2 instead. That's
>> what I'm talking about.
>
>Ok, I tried that and the attempt was rejected. I still think that is the
>logical think for Linux to do.
>
>Why would you want to do such a thing anyway? If you need a filesystem
>mounted onto another, make a subdirectory for that filesystem. Mounting a
>filesystem in a populated directory hides the existing files anyway, how
>do you benefit?
Design a "overlay" filesystem.
If you attempt to read a file that exists in the overlay you get the overlay.
If it doesn't exist you get the file beneath. When writing to a file, it
gets created in the overlay. Appends get a bit hairy sometimes.
Combine that with the loop filesystem and you have a neat way of handling
multiple kernel source configurations - mount the machine specific stuff
on top of /usr/src/linux.
Or mount the hard drive over a live portion
on the CDROM - it will eventually tell you all the files you beat on locally.
Also
>...
>IMHO, this all seems to boil down to laziness.
Nope, just wanting to do strange things.
>Please convince me otherwise, I very well may have tunnel vision on this
>subject.
Hopefully this gives you a few ideas.
Jeff Voskamp