linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* OK to mount multiple FS in one dir?
@ 2001-02-05  3:08 Michael D. Crawford
  2001-02-06  0:06 ` Peter Samuelson
  0 siblings, 1 reply; 10+ messages in thread
From: Michael D. Crawford @ 2001-02-05  3:08 UTC (permalink / raw)
  To: linux-kernel

I was groping around my FAT/NTFS directories from Linux, mounting and 
unmounting them into
/mnt, and was suprised at some point that I got the message "/dev/sda5 
already mounted or
/mnt busy".  (I'm using a SCSI disk, use hda* for IDE).

Upon further examination, I found that I'd accidentally mounted 
/dev/sda1 (VFAT) on /mnt
while /dev/sda5 (NTFS) was still mounted there.  The NTFS files remained 
invisible until
I'd unmounted /dev/sda1 and then I could see them again.

This is with the 2.4.1 kernel on a Pentium III machine with an Adaptec 
29160 SCSI
controller.

I found I could mount three partitions on /mnt, and they'd all show up 
as mounted at
/mnt in the "mount" command, but if I unmounted one of them (only tried 
with the currently
visible one), then it appeared that there were no filesystems mounted 
there, but I could
continue umounting until the other two were gone.

I'm suprised this works.  Note that the kernel rejected an attempt to 
mount a filesystem
that was already mounted, but not to mount a filesystem at a point that 
was already in use.
It looks like there is a stack of mounts on the mount point.

Looking at Documentation/Changes, I see that I need util-linux 2.10o.  I 
had 2.10l.  But I
had the 2.10r util-linux sources on my machine and installed mount and 
umount from it, and
I find that it gets it right mostly when I mount and unmount multiple 
things, with the
exception that if /dev/sda5 was mounted before /dev/sda1, then if I give 
the command
"umount /dev/sda5", sda1 is the one that gets unmounted rather than 
sda5, so it takes the
most recently mounted filesystem rather than the one you specify.

Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com

   Tilting at Windmills for a Better Tomorrow.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-05  3:08 OK to mount multiple FS in one dir? Michael D. Crawford
@ 2001-02-06  0:06 ` Peter Samuelson
  2001-02-06 19:47   ` Thorsten Glaser Geuer
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Samuelson @ 2001-02-06  0:06 UTC (permalink / raw)
  To: Michael D. Crawford; +Cc: linux-kernel


[Michael D. Crawford]
> I found I could mount three partitions on /mnt

Yes.  New feature, appeared in the 2.4.0test series, or shortly before.

> and they'd all show up as mounted at /mnt in the "mount" command, but
> if I unmounted one of them (only tried with the currently visible
> one), then it appeared that there were no filesystems mounted there,
> but I could continue umounting until the other two were gone.

util-linux gets rather confused by this feature.  They say newer
versions fix this.

> But I had the 2.10r util-linux sources on my machine and installed
> mount and umount from it, and I find that it gets it right mostly
> when I mount and unmount multiple things, with the exception that if
> /dev/sda5 was mounted before /dev/sda1, then if I give the command
> "umount /dev/sda5", sda1 is the one that gets unmounted rather than
> sda5, so it takes the most recently mounted filesystem rather than
> the one you specify.

I think this is a kernel limitation.  'umount' takes '/dev/sda5' and
turns it into '/mnt/test' and calls umount("/mnt/test").  The kernel
then unmounts whatever is on "top" of /mnt/test.

I don't think there's anything umount can do about this behavior.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-06  0:06 ` Peter Samuelson
@ 2001-02-06 19:47   ` Thorsten Glaser Geuer
  2001-02-06 20:46     ` Wakko Warner
  0 siblings, 1 reply; 10+ messages in thread
From: Thorsten Glaser Geuer @ 2001-02-06 19:47 UTC (permalink / raw)
  To: Michael D. Crawford, Peter Samuelson; +Cc: linux-kernel

----- Original Message ----- 
From: "Peter Samuelson" <peter@cadcamlab.org>
To: "Michael D. Crawford" <crawford@goingware.com>
Cc: <linux-kernel@vger.kernel.org>
Sent: Tuesday, 6. February 2001 00:06
Subject: Re: OK to mount multiple FS in one dir?


> 
> [Michael D. Crawford]
> > I found I could mount three partitions on /mnt
> 
> Yes.  New feature, appeared in the 2.4.0test series, or shortly before.
> 
> > and they'd all show up as mounted at /mnt in the "mount" command, but
> > if I unmounted one of them (only tried with the currently visible
> > one), then it appeared that there were no filesystems mounted there,
> > but I could continue umounting until the other two were gone.
> 
> util-linux gets rather confused by this feature.  They say newer
> versions fix this.
> 
> > But I had the 2.10r util-linux sources on my machine and installed
> > mount and umount from it, and I find that it gets it right mostly
> > when I mount and unmount multiple things, with the exception that if
> > /dev/sda5 was mounted before /dev/sda1, then if I give the command
> > "umount /dev/sda5", sda1 is the one that gets unmounted rather than
> > sda5, so it takes the most recently mounted filesystem rather than
> > the one you specify.
> 
> I think this is a kernel limitation.  'umount' takes '/dev/sda5' and
> turns it into '/mnt/test' and calls umount("/mnt/test").  The kernel
> then unmounts whatever is on "top" of /mnt/test.
> 
> I don't think there's anything umount can do about this behavior.

What about userland umount checking which device is umounted and
refusing to umount it or at least issuing a printf warning?

> 
> Peter

-mirabilos

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-06 19:47   ` Thorsten Glaser Geuer
@ 2001-02-06 20:46     ` Wakko Warner
  2001-02-07  6:25       ` Peter Samuelson
  2001-02-25  6:08       ` Alexander Viro
  0 siblings, 2 replies; 10+ messages in thread
From: Wakko Warner @ 2001-02-06 20:46 UTC (permalink / raw)
  To: linux-kernel

> > > I found I could mount three partitions on /mnt
> > 
> > Yes.  New feature, appeared in the 2.4.0test series, or shortly before.

I have a question, why was this idea even considered?

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-06 20:46     ` Wakko Warner
@ 2001-02-07  6:25       ` Peter Samuelson
  2001-02-07  7:00         ` John R Lenton
  2001-02-07 22:49         ` David L. Nicol
  2001-02-25  6:08       ` Alexander Viro
  1 sibling, 2 replies; 10+ messages in thread
From: Peter Samuelson @ 2001-02-07  6:25 UTC (permalink / raw)
  To: Wakko Warner; +Cc: linux-kernel


[Wakko Warner]
> I have a question, why was this idea even considered?

Al Viro likes Plan9 process-local namespaces.  He seems to be trying to
move Linux in that direction.  In the past year he has been hacking the
semantics of filesystems and mounting, probably with namespaces as an
eventual goal, and this is one of the things that has fallen out of the
implementation.

A more useful thing to fall out of the same hacking is loopback
mounting -- i.e. the same filesystem mounted multiple places.  In
Linux-land I guess we call it 'mount --bind'.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-07  6:25       ` Peter Samuelson
@ 2001-02-07  7:00         ` John R Lenton
  2001-02-25  6:10           ` Alexander Viro
  2001-02-07 22:49         ` David L. Nicol
  1 sibling, 1 reply; 10+ messages in thread
From: John R Lenton @ 2001-02-07  7:00 UTC (permalink / raw)
  To: Peter Samuelson; +Cc: Wakko Warner, linux-kernel

On Wed, Feb 07, 2001 at 12:25:10AM -0600, Peter Samuelson wrote:
> 
> [Wakko Warner]
> > I have a question, why was this idea even considered?
> 
> Al Viro likes Plan9 process-local namespaces.  He seems to be trying to
> move Linux in that direction.  In the past year he has been hacking the
> semantics of filesystems and mounting, probably with namespaces as an
> eventual goal, and this is one of the things that has fallen out of the
> implementation.

Aren't "translucid" mounts the idea behind this?
-- 
John Lenton (john@grulic.org.ar) -- Random fortune:
For courage mounteth with occasion.
		-- William Shakespeare, "King John"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-07  6:25       ` Peter Samuelson
  2001-02-07  7:00         ` John R Lenton
@ 2001-02-07 22:49         ` David L. Nicol
  2001-02-25  6:12           ` Alexander Viro
  1 sibling, 1 reply; 10+ messages in thread
From: David L. Nicol @ 2001-02-07 22:49 UTC (permalink / raw)
  To: Peter Samuelson; +Cc: Wakko Warner, linux-kernel

Peter Samuelson wrote:
 
> A more useful thing to fall out of the same hacking is loopback
> mounting -- i.e. the same filesystem mounted multiple places.  In
> Linux-land I guess we call it 'mount --bind'.
> 
> Peter

Does this kind of thing play nice with nfs and coda, in terms of
change notifications and write-backs? In distributed FS we've got
the same thing mounted multiple places, of course, but not on the
same machine



-- 
                      David Nicol 816.235.1187 dnicol@cstp.umkc.edu
                           Pedestrians always have the right of way

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-06 20:46     ` Wakko Warner
  2001-02-07  6:25       ` Peter Samuelson
@ 2001-02-25  6:08       ` Alexander Viro
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Viro @ 2001-02-25  6:08 UTC (permalink / raw)
  To: Wakko Warner; +Cc: linux-kernel



On Tue, 6 Feb 2001, Wakko Warner wrote:

> > > > I found I could mount three partitions on /mnt
> > > 
> > > Yes.  New feature, appeared in the 2.4.0test series, or shortly before.
> 
> I have a question, why was this idea even considered?

	Direct request from HPA. Autofs can win from having that (mounting
atop of mountpoint). I'd rather live without that stuff, but back then it
looked like an OK idea - we could do that. There is a better solution for
original problem, but...


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-07  7:00         ` John R Lenton
@ 2001-02-25  6:10           ` Alexander Viro
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Viro @ 2001-02-25  6:10 UTC (permalink / raw)
  To: John R Lenton; +Cc: Peter Samuelson, Wakko Warner, linux-kernel



On Wed, 7 Feb 2001, John R Lenton wrote:

> On Wed, Feb 07, 2001 at 12:25:10AM -0600, Peter Samuelson wrote:
> > 
> > [Wakko Warner]
> > > I have a question, why was this idea even considered?
> > 
> > Al Viro likes Plan9 process-local namespaces.  He seems to be trying to
> > move Linux in that direction.  In the past year he has been hacking the
> > semantics of filesystems and mounting, probably with namespaces as an
> > eventual goal, and this is one of the things that has fallen out of the
> > implementation.
> 
> Aren't "translucid" mounts the idea behind this?

Nope. Completely different beast - bindings have nothing to layered
filesystems. I.e. if we bind /foo to /bar then /foo/barf and /bar/barf
are the same object. Translucent-type would have one of them redirecting
all requests to another.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OK to mount multiple FS in one dir?
  2001-02-07 22:49         ` David L. Nicol
@ 2001-02-25  6:12           ` Alexander Viro
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Viro @ 2001-02-25  6:12 UTC (permalink / raw)
  To: David L. Nicol; +Cc: Peter Samuelson, Wakko Warner, linux-kernel



On Wed, 7 Feb 2001, David L. Nicol wrote:

> Peter Samuelson wrote:
>  
> > A more useful thing to fall out of the same hacking is loopback
> > mounting -- i.e. the same filesystem mounted multiple places.  In
> > Linux-land I guess we call it 'mount --bind'.
> > 
> > Peter
> 
> Does this kind of thing play nice with nfs and coda, in terms of
> change notifications and write-backs? In distributed FS we've got
> the same thing mounted multiple places, of course, but not on the
> same machine

There is no cache coherency problems since we have no copies to keep
in sync ;-) Dentry tree is shared by all instances.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-02-25  6:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-05  3:08 OK to mount multiple FS in one dir? Michael D. Crawford
2001-02-06  0:06 ` Peter Samuelson
2001-02-06 19:47   ` Thorsten Glaser Geuer
2001-02-06 20:46     ` Wakko Warner
2001-02-07  6:25       ` Peter Samuelson
2001-02-07  7:00         ` John R Lenton
2001-02-25  6:10           ` Alexander Viro
2001-02-07 22:49         ` David L. Nicol
2001-02-25  6:12           ` Alexander Viro
2001-02-25  6:08       ` Alexander Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).