Using fuser command "resource busy" problem

Problem scenario: An error is reported when unmounting, as follows:

--Execute the unmount command:

[root@centos208 /]# umount /image/

umount.nfs: /image: device is busy

umount.nfs: /image: device is busy

 

Solution:

1. View the process using the mount folder

[root@centos208 /]# fuser -v -m /image/

USER        PID ACCESS COMMAND

/image/:             root       2133 ..c.. bash

2. Kill all related processes: kill -9 2133

3. Parameter description:

     -v indicates verbose mode. Processes are displayed in ps, including PID, USER, COMMAND, ACCESS fields

    -m indicates the file system or block device (in mount state) where the specified file is located. All processes accessing the file system are listed.

 

Extension:

Concept: The fuser command is used to display information about all processes that are using the specified file, file system or sockets.

fuser is often used to diagnose "resource busy" problems on a system, usually when you want to umount the specified mount point. If you want to kill all processes that are using a specified file, file system or sockets, you can use the -k option.

--Kill all processes related to the resource, which is equivalent to automatically executing the solution described above

fuser -k /image

--Continue the command: fuser -k -i /image, there is a confirmation prompt when ending each process

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326189289&siteId=291194637