• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Unmounting a Windows Share Fails in Linux

by admin

The Problem

Unable to unmount a Windows share mount point using umount command. This Windows share is not being used by any processes recently.

When executing umount command, following error is seen;

# umount: /mycloud: device is busy.
  (In some cases useful info about processes that use
  the device is found by lsof(8) or fuser(1))

The Solution

The error “umount: device is busy” means that the mount point is being held up by the server due to some reason. An lsof command is executed to find some open file descriptors.

# lsof /mycloud/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 39176 oracle cwd DIR 0,25 0 54427649 /mycloud/primdb/rman
rsync 39176 oracle 1r REG 0,25 6678585344 54428135 /mycloud/primdb/rman/.RMDBPRD_LVL0_20170910_s145161_p1.WxJoHy (deleted)
rsync 39176 oracle 3u REG 0,25 5449449472 54428147 /mycloud/primdb/rman/.RMDBPRD_LVL0_20170910_s145161_p1.uqhidN

This PID could not be killed even with the kill command.

# kill -9 39176
# lsof /mycloud/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 39176 oracle cwd DIR 0,25 0 54427649 /mycloud/primdb/rman
rsync 39176 oracle 1r REG 0,25 6678585344 54428135 /mycloud/primdb/rman/.RMDBPRD_LVL0_20170910_s145161_p1.WxJoHy (deleted)
rsync 39176 oracle 3u REG 0,25 5449449472 54428147 /mycloud/primdb/rman/.RMDBPRD_LVL0_20170910_s145161_p1.uqhidN

When checked, an rsync process which writes to this mount point is still in D state due to IO block which occurred some time ago.

# ps aux |grep rsync
root 30103 0.0 0.0 103304 804 pts/0 S+ 10:24 0:00 grep rsync
oracle 39176 0.0 0.0 110956 96 ? D Sep10 17:48 rsync -av --delete /eva/primdb/rman/ /mycloud/primdb/rman/

As this process is in uninterruptable sleep state, this process could not be killed. This is the reason why it is not able to unmount the Windows share from the server.

The D state processes could not be killed using kill command as these are like orphaned entries in the process list without a parent. So it is recommended to do a server reboot for killing any such D state processes.

If a reboot is not possible at the moment as in case of production servers, then wait until the IO becomes available again so that the process will wake up and get completed. However, it is not recommended to wait more than a month as gradually the server load might climb up if there are more such D state processes in the server.

Filed Under: Linux

Some more articles you might also be interested in …

  1. sudoedit: command not found
  2. How to allow ssh with empty passwords in Linux
  3. How To Store iptables Rules To Survive Across Reboots in CentOS/RHEL
  4. How to Install and Configure Kerberos in CentOS/RHEL 7
  5. CentOS / RHEL : How to find if a network port is open or not?
  6. Linux OS service ‘auditd’
  7. How to gzip all or specific files in Linux
  8. “device-mapper: resume ioctl failed: Invalid argument” – error on running lvcreate/lvresize/lvextend
  9. Manual Changes Made To /etc/hosts Or /etc/sysconfig/network-scripts/ifcfg-* Are Lost
  10. httpd Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright