All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* how to unmount an rbind mount ?
@ 2016-04-12 21:19 Jason Vas Dias
  0 siblings, 0 replies; only message in thread
From: Jason Vas Dias @ 2016-04-12 21:19 UTC (permalink / raw
  To: linux-kernel

Good day -

Please could anyone advise -

Once one has mounted an alias mount with the 'rbind' option, so that
mounts underneath it are also mounted under the new path, how can
one unmount that filesystem safely without un-mounting the original
mountpoints  ?

For example, I do this for chroots :
    $  for d in /dev /proc /sys; do mount -o rbind $d $chroot/$d; done

Now, if I want to unmount the chroot device, I cannot do eg. :
    $ unmount ${chroot}/dev
because this will fail since /dev/pts /dev/mqueue etc are still mounted ;
if I do:
    $ unmount -R ${chroot}/dev
or
    $ unmount ${chroot}/dev/pts
then /dev/pts will be unmounted from the root device filesystem -
the situation is much more horrid to try and unmount ${chroot}/sys or
${chroot}/run .

Personally, I think this is rather buggy behaviour by Linux, since I told the
kernel I only want to BIND the path ${chroot}/dev to /dev - and recursively
bind names beneath ${chroot}/dev/* to /dev/*, with the 'rbind' option, ie. to
make an alias of ${chroot}/dev/* for /dev/* - NOT to actually re-mount the
devices there .  So I think umount should be clever enough to 'un-bind'
sub-mounts of mounts with the 'rbind' option, rather than unmount the
devices from the root filesystem, which is what currently happens.
It does make chroot filesystems very difficult to unmount safely !
Linux badly needs a better umount, IMHO .

Are there any plans to improve umount behavior wrt rbind mounts ?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-12 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12 21:19 how to unmount an rbind mount ? Jason Vas Dias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.