Skip to contentSkip to conversation

Behavior of 'mount --bind' and umount

DISCUSSION Nicolas Dichtel 1 participant 1 message Dec 27, 2013 VFS

lore
Share & tools
lore
#0 lore raw

Hi all,

I've a question about this command.
Let's take a simple test:

$ touch foo
$ echo foo > foo
$ touch bar
$ mount --bind foo bar
$ cat bar
foo
$ umount foo

On some files system/distribution/kernel, the last command returns an error (on debian for example):

$ umount foo
umount: foo: not mounted

or unmount bar (on ubuntu for example):

$ umount foo
$ cat bar
$

I did not find the reason of this difference, any help is welcome.

Thank you,
Nicolas