Mount on top of / ??

Jeff Smith jsmith at alum.mit.edu
Thu Mar 31 17:32:00 EST 2005


--- Paul Lussier <p.lussier at comcast.net> wrote:

> 
> There are probably plenty of use cases for mounting
> multiple file
> systems on the same mount point.  For instance, suppose
> you have a
> mangled root file system, or even a read-only file system
> which
> prevents you from doing something you normally don't want
> to do
> (perhaps it's a security mechanism to limit the ability
> of someone
> who's cracked your system).  On this one occasion, you
> need to do
> something which is currently not possible.  But, by
> mounting another
> file system over that one, you now can, all without
> re-booting the
> system.  When you're done, you're now able to unmount the
> second file
> system and return the system to the state it was before.

I was reading a while ago (have to find it again) about a
union filesystem someone had developed for Linux.  Here,
you do mount 2 (or more) file systems over the same mount
point - and it has uses.  Examples given: 
1.  Mount a CD on the lower layer, and a regular filesystem
on top.  Looks read/write (and is), but the CD is
unchanged.  
2.  Mount a read-only kernel tree, do all the
compilation/etc.  All the object files are in the upper
(writable) part.  Unmount it, you are back to the
source-only.  Mount 3 layers - the original and another one
with your source changes (which hide the original for the
change files), another for the object files.  So, you can
make changes, but backing out is a matter of unmounting the
files.

jeff

> 
> This is probably far more useful if the file system in
> question is
> *not* root, but, as I stated before, it's easier to do
> the same for
> all rather than consider all the edge cases.

Yes, although I could see you using what I described above
for a root filesystem that was a boot CD on the bottom. 
Think your system is corrupted?  Reboot without the HD
layer, you're back to the clean original.  Now mount the
old changes onto another part of the tree and examine for
cracking activity.


> 
> Hmm, actually, a legitmate use case just came to mind,
> though, it
> does't involve root (but, since root is "just another
> file system :).
> 
> I often mount and unmount differnt file systems to /mnt
> all the time.
> Many times I'll have a CD mounted there.  Many times,
> when creating
> .iso images, I'll want to mount the image before burning
> it.  Even
> though I may have something already mounted on /mnt, I'll
> mount that
> image right over the existing file system mounted at /mnt
> to make sure
> it works correctly, or contains the right data.  When I'm
> done, I'll
> unmount that image, and still be able access whatever was
> there
> before.

Not tried that - but maybe a way to check if a new work on
a CD is useful/real?  Mount the ISO over the CD?



> 
> Sure, I could create various mount points under /mnt and
> mount things
> in different places, but then I waste time a) checking to
> see what
> mount points are there, and b) typing more than I need
> to.  Why waste
> time, when I can just mount something over something else
> that I don't
> care about at that single moment in time?  And, it's a
> lot more
> natural, for me anyway, to just type 'mount foo /mnt'
> than it is to
> type 'mount foo /mnt/foo'
> 

I use multiple on /media - and pmount/pumount.  My USB
stuff automatically to /media/usb, cd's to /media/cdrom (to
avoid confusion with "cd blah"), dvd's to /media/dvd.  Then
again, I have an internal DVD/CD Burner, and external
DVD+-R drive, so I can have 2.


> -- 
> 
> Seeya,
> Paul
> 

jeff





More information about the gnhlug-discuss mailing list