lkml.org 
[lkml]   [1996]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Overmounting a filesystem
Date
>>>> Currently it seems Linux does not permit overmounting a filesystem
>>>> (mounting a filesystem on top of another, on the same path).

>> he really wanted something like:
>>
>> mount /dev/hda2 /home
>> ... do things
>> mount /dev/hda3 /home
>>
>> Is that right? If so, it's true you can't do that currently.
>
> The point is whether the second mount should implicitly umount the
> old disk, or just hide it. /etc/mtab currently can't handle stacked
> mounts (same for /proc/mounts). Also mount(8) will have some trouble
> selecting the correct entry from /etc/fstab.

This should work:

mount /dev/hda2 /home
... do things in /home (hda2)
mount /dev/hda3 /home
... do things in /home (hda3)
umount /home
... do things in /home (hda2)
umount /home

Mounts need to be in a stack. For /proc/mounts, /etc/mtab,
and /etc/fstab, the order should be significant. The active
mount goes first in the file, followed by others below it.

It would be _great_ if this would work too:

mount /dev/hda2 /home
mount /dev/hda3 /home
umount /dev/hda2 # Rip mount out from under other one

That's no so important though. A stack would be good enough.
BTW, mount might ask for a --force option before doing this.
It's a bit like hard linking your directories.


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.021 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site