umount.cifs leaves entries in /etc/mtab

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 4.8

Issue

  • Unmount of CIFS mount leaves entries in mtab file at /etc/mtab.

Resolution

  • Apply the following errata which addresses this issue: RHBA-2011-0242

Root Cause

  • The umount.cifs process creates /etc/mtab~ as a lockfile during operation. When the lock file exists umount.cifs returns 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.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.