You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for pid in $(ps --no-headers -xao pid); do
nsenter -t $pid umount --recursive --all-targets /dev/sdb
done
I would have expected "umount from util-linux 2.32.1 (libmount 2.32.1: btrfs, assert, debug)" option --all-targets to function when a device without partition number is specified.
Actual result:
# mount /dev/sdb2 /mnt/sdb2
# umount --recursive --all-targets /dev/sdb
umount: /dev/sdb: not mounted
Expected result:
# umount --recursive --all-targets /dev/sdb
[root@d2 ~]# lsblk /dev/sdb2
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb2 8:18 1 28.7G 0 part
Note: even the code sample above doesn't result in all partitions on /dev/sdb to get unmounted.
Is my expectation wrong?
PS Otherwise it would be nice to have a -quiet or -noerror flag, so one can execute # umount --recursive --all-targets /dev/sdb*
without the "not mounted" output:
umount: /dev/sdb: not mounted
umount: /dev/sdb1: not mounted
The text was updated successfully, but these errors were encountered:
ProBackup-nl
changed the title
umount --all-targets only unmounts partitions not devices
umount --all-targets only unmounts partitions not all partitions on a device
Jul 30, 2018
Unfortunately your expectation is wrong. The command umount has no clue about whole-disk and partitions concept. It works with individual block devices only. The solution is to use sdb*.
The options -quiet seems like good idea -- I'll implement it.
The command umount supports things like --all-targets and --recursive
to umount all nodes in specified tree. Sometimes it makes sense to
aggressively use wildcards like /dev/sdb* and in this case --quiet
seems like a good choice
umount --quiet --all-targets /dev/sdb*
to suppress 'not mounted' error messages. The new option suppress only
these error messages and nothing else.
Addresses: #672
Signed-off-by: Karel Zak <kzak@redhat.com>
Having /dev/sdb2 mounted in /mnt/sdb2,
and having read comment 1 from the year 2013 for bug 916216, especially the code sample:
I would have expected "umount from util-linux 2.32.1 (libmount 2.32.1: btrfs, assert, debug)" option
--all-targets
to function when a device without partition number is specified.Actual result:
Expected result:
Note: even the code sample above doesn't result in all partitions on /dev/sdb to get unmounted.
Is my expectation wrong?
PS Otherwise it would be nice to have a -quiet or -noerror flag, so one can execute
# umount --recursive --all-targets /dev/sdb*
without the "not mounted" output:
The text was updated successfully, but these errors were encountered: