如何umount目前device busy的文件系统(fuser简单用法)?


(1)用fuser命令的四步:
1.确认挂接点有那些进程需要杀掉

       # fuser -cu /mount_point

2.向进程发出SIGKILL信号:

        # fuser -ck /mount_point

3.确认看是否还有进程在访问挂接点

         # fuser -c /mount_point

4.umount挂接点

         #  umount /mount_point

# fuser -u /dev/vg01/lvol1
This lists process IDs and login names of processes using /dev/vg01/lvol1.


# fuser -u /etc/passwd
This lists process IDs and login names of processes that have the passwd file open.


# fuser -uc /opt
This lists process IDs and login names of processes that have open files in the /opt file system.
 

# fuser -ku /dev/vg01/lvol1
This terminates all processes that are preventing logical volume lvol1 of volume group vg01

 

 

很多时候,不能umount,除了检查是否有应用程序尚在该目录打开文件之外,还要注意是否有用户远程登录在系统上,当前目录在该文件系统中,实在不行,就fuser -k吧。总能解决的,但要跟应用端确认。

转载请注明源自www.AIXChina.net,请保留版权.
原文地址:http://www.aixchina.net/club/viewthread.php?tid=1990

方法二:

------------------------------------------------------------------------------------------------------

 

mount: Device busy

 
 
Problem(Abstract)
This technote explains why attempts to mount or umount an IBM® Rational® ClearCase® VOB on UNIX® or Linux® results in the error message Device busy.
 
 
Symptom
 
 
 
Cause

Mount Example:

$ /usr/atria/bin/cleartool mount /vobs/myvob
Mounting MVFS filesystem /vobs/myvob
mount: Device busy


Unmount Example:

$ /usr/atria/bin/cleartool umount /vobs/myvob
Unmounting MVFS filesystem /vobs/myvob
mount: Device busy


Note: Running the above commands as root also results in the same error.


The message device busy is not a ClearCase error rather the message is being passed from the underlying operating system and indicates one of two scenarios:

  1. If the Device Busy error message is received while attempting to mount a directory, this indicates that a user is in the mount point or the directory is already mounted.
  2. If the Device Busy error message is received while attempting to unmount a directory, this indicates that a user or a process has an open file on that filesystem.
 
 
Resolving the problem

Determine which user is utilizing the mounted directory:

 

  1. Use one of the operating system commands (such as fuser) to return a list of process IDs and user names that are currently using the directory mounted under the local_mount_point. This will help determine whether the process can be killed or to wait until it completes.

    Example: fuser -uc /vobs/myvob

    Note: This command works on Solaris®, IRIX®, HP-UX®, Linux®, and AIX®. The above example assumes the fuser utility is defined in your path variable.
  2. If fuser -uc /vobs/myvob returns an Invalid argument error, it might mean the VOB is already unmounted. Run the command ps -ef | grep /vobs/myvob to confirm.
  3. Make sure that /vobs/myvob is not the user's current working directory or anyone else's on that same client host when unmounting.
  4. Run the command mount with no options to check the table of mounts and search for any possible problems, or grep for /vobs/myvob.
  5. If the above steps do not help then try restarting ClearCase.
  6. If step #4 does not help, attempt to reboot the host.