can not umount rbind mounts

Bug #759394 reported by Phillip Susi
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: util-linux

mkdir /mnt/dev
mount --rbind /dev /mnt/dev
umount /mnt/dev

The umount fails because of the sub mounts that the recursive bind also bind mounted under /mnt/dev, which you have to remove manually first. When you mount with --rbind, umount should be able to reverse the process, unmounting all recursively bound mounts.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in util-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcel Meyer (meyerm-launchpad) wrote :

Please check if "umount -l" helps you in this case.

Revision history for this message
Stéphane Gourichon (stephane-gourichon-lpad) wrote :

Hi.

Same problem here. Some partitions still appear in `mount` output and `/proc/mounts` but can't be unmounted via either device name or mount point.
Repeatedly trying `umount -l` with device names and mount points finally managed to get the partitions unmounted.

Yet it feels awkward, like a worn out door lock that locks okay but you have to shake for a while to have it unlock.

This is very likely not Ubuntu specific, e.g.
http://unix.stackexchange.com/questions/120827/recursive-umount-after-rbind-mount

Revision history for this message
Ivan Zakharyaschev (imz) wrote :

This worked for me correctly -- https://unix.stackexchange.com/a/264488/4319 :

mount --rbind /dev /mnt/test
mount --make-rslave /mnt/test
umount -R /mnt/test

It was important to have the two first commands as two separate commands: do not combine --rbind and --make-rslave in one invocation of mount.

Without --make-rslave , the behavior was unwanted (and not successful):

* umount -l would affect the original old mountpoints, too,
* and umount -R would be affected by the busy (open) files under the original old mountpoints. (Very unexpected...)

Changed in util-linux (Ubuntu):
status: Confirmed → Opinion
Phillip Susi (psusi)
Changed in util-linux (Ubuntu):
status: Opinion → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.