umount.cifs leaves entries in /etc/mtab
Environment
- Red Hat Enterprise Linux 4.8
Issue
- Unmount of
CIFSmount leaves entries inmtabfile at/etc/mtab.
Resolution
- Apply the following errata which addresses this issue: RHBA-2011-0242
Root Cause
-
The
umount.cifsprocess creates /etc/mtab~ as a lockfile during operation. When the lock file existsumount.cifsreturns error messages:# umount /mnt/samba getting lock file /etc/mtab~ failed with File exists Mount table locked -
Kernel actually umounts the filesystem, leaving the stale entry in /etc/mtab. This is well-known behavior even in general umount as well.
-
However, /sbin/umount.cifs differs from general umount procedure that it does not remove all matching lines from mtab. This behavior would result in multiple entries in mtab, even in hundreds of them in case of using autofs.
-
Patch proposed to rewrite lock scheme. The patch will make umount.cifs wait until the lock is acquired.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
