Bug 475366 - umount is unable to un-mount by filesystem label
umount is unable to un-mount by filesystem label
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-08 17:56 EST by Tim Gelter
Modified: 2012-07-17 09:12 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-17 09:12:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tim Gelter 2008-12-08 17:56:00 EST
Description of problem:
I've been teaching Linux courses for a while now and have been trying to
figure out the reason why umount does not support un-mounting volumes by
label. I thought that maybe it was due to the fact that under Linux,
volumes may be mounted to multiple mount points which could cause
confusion to users if they attempt to un-mount a directory only to see
that an entirely different directory was un-mounted instead. However,
after a bit of experimentation, I found that umount is able to un-mount
a volume by device (as opposed to unmounting by directory). Upon
un-mounting by device name, the most recently mounted location is
un-mounted first, followed by the next, and so forth. Couldn't this same
logic be used when un-mounting by label?
Thanks a lot!

Version-Release number of selected component (if applicable):
util-linux-2.13-0.44.el5

How reproducible:
Mount a block device containing a label. Attempt to un-mount that device by label.

Steps to Reproduce:
1. Create a new ext2/3 filesystem. (mkfs.ext{2,3} /path/to/block/device)
2. Add the label. (e2label /path/to/block/device mylabel)
3. Mount by label. (mount LABEL=mylabel /mnt)
4. Attempt to un-mount by label. (umount LABEL=mylabel)
  
Actual results:
[root@station6 ~]# mount LABEL=foo /mnt
[root@station6 ~]# umount LABEL=mylabel
umount: LABEL=mylabel: not found

Expected results:
No error on attempting to umount the device

Additional info:
none
Comment 1 Karel Zak 2009-04-08 08:30:42 EDT
(In reply to comment #0)
> I found that umount is able to un-mount
> a volume by device (as opposed to unmounting by directory). Upon
> un-mounting by device name, the most recently mounted location is
> un-mounted first, followed by the next, and so forth. Couldn't this same
> logic be used when un-mounting by label?

 Yeah, I think we can use the same logic. ... but this feature is not implemented yet.

[Moving to Fedora, the feature has to be implemented upstream first. I don't think we need to back port this feature to RHEL5.]
Comment 2 Tim Gelter 2009-04-08 13:49:55 EDT
Just a clarification so someone doesn't get confused by this in the future, I introduced the following typo with this report:

Actual results:
[root@station6 ~]# mount LABEL=foo /mnt
[root@station6 ~]# umount LABEL=mylabel
umount: LABEL=mylabel: not found

"mount LABEL=foo" should read "mount LABEL=mylabel"
Comment 3 Bug Zapper 2009-06-09 06:11:19 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Karel Zak 2010-01-08 06:41:35 EST
Added to the upstream TODO file.
Comment 5 Bug Zapper 2010-03-15 08:20:33 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Bug Zapper 2010-07-30 06:33:56 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Steve Tyler 2011-06-04 17:12:15 EDT
This inconsistency keeps tripping me up, too. A workaround is to use findfs:
$ sudo umount `findfs LABEL=spare1`

[stephent@walnut ~]$ sudo mount LABEL=spare1 /mnt/spare1
[stephent@walnut ~]$ mount | grep `findfs LABEL=spare1`
/dev/sda3 on /mnt/spare1 type ext4 (rw)
[stephent@walnut ~]$ sudo umount LABEL=spare1
umount: LABEL=spare1: not found
[stephent@walnut ~]$ sudo umount `findfs LABEL=spare1`
[stephent@walnut ~]$ mount | grep `findfs LABEL=spare1`
[stephent@walnut ~]$
Comment 8 Karel Zak 2012-07-17 09:12:00 EDT
The new umount(8) implemenation (based on libmount) allow to use

 # umount LABEL=foo

it's avaialable in util-linux >= 2.21 (Fedora 17)

Note You need to log in before you can comment on or make changes to this bug.