Thursday, December 20, 2012

umount: /dev/sdd: device is busy

This article is a follow-up on a previous article [1].  When we tried to unmount one of the file system, it failed with the following messages:

# umount /dev/sdd
umount: /dev/sdd: device is busy
umount: /dev/sdd: device is busy

In the following sections, we will summarize what we have found.

What Was Keeping the Device Busy?

On Linux platforms, you can use fuser command to find what processes have been keeping your device busy. The fuser command lists the process numbers of local processes that use the local or remote files specified by the File parameter. For block special devices, the command lists the processes that use any file on that device.  For example, here is what we have found with fuser command:
# fuser -m /dev/sdd
/dev/sdd:            24381c 24393ce 24449ce

In the listing, each process number is followed by a letter indicating how the process uses the file[2]:
cUses the file as the current directory.
eUses the file as a program's executable object.
rUses the file as the root directory.
sUses the file as a shared library (or other loadable object).

What Application It Is Given a Process Number?

To find which application it is given its process number, you can use:

#  ps auxw|grep  24381
oracle   24381  0.0  0.0  63868  1160 ?        S    Dec19   0:00 /bin/sh -f /home/oracle/atg/IDM_11gR1.PS4.RC4/Oracle_IDM1/bin/emctl asstart agent

# ps auxw|grep  24393
oracle   24393  0.0  0.0  88552 10904 ?        S    Dec19   0:01 /home/oracle/atg/IDM_11gR1.PS4.RC4/Oracle_IDM1/perl/bin/perl /home/oracle/atg/IDM_11gR1.PS4.RC4/Oracle_IDM1/bin/ agent /home/oracle/atg/IDM_11gR1.PS4.RC4/Instances/asinst_1/EMAGENT/EMAGENT/sysman/log/emagent.nohup

# ps auxw|grep  24449
oracle   24449  0.0  0.3 318624 38424 ?        Sl   Dec19   0:09 /home/oracle/atg/IDM_11gR1.PS4.RC4/Oracle_IDM1/bin/emagent

In our case, the above orphaned processes still hang around after the following command:

  • $MW_HOME/asinst_1/bin/opmnctl  stopall

Normally, "opmnctl stopall"[5] should be able to stop opmn and all managed processes.  However, there are some mis-configured host names in our Management Agent property file:
  • $MW_HOME/asinst_1/EMAGENT/EMAGENT/sysman/config/
which have caused orphaned processes unresponsive.

After stopping these orphaned processes by force, we are able to unmount /dev/sdd file system and have it checked by e2fsck command.

1 comment:

Blogger said...

There's a chance you're qualified to receive a Sony PlayStation 4.