Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Resolve the umount.nfs: / data: device is busy problem

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Sometimes we encounter the following problems when we need to umount a mount directory:

[root@localhost /] # umount / data/

Umount.nfs: / data: device is busy

Use this command to view:

[root@localhost /] # fuser-m-v / data/

User process number permission command

/ data/: root 2798.. c.. Bash

Root 2996.. c.. Su

-v stands for verbose mode. The process is displayed in ps, including PID, USER, COMMAND, ACCESS fields

-m indicates the file system or block device on which the specified file resides (in the mount state). All processes accessing the file system are listed.

As shown above, two processes are occupied, kill them off, and then unmount them again.

[root@localhost /] # kill-9 2798

[root@localhost /] # kill-9 2996

[root@localhost /] # umount / data/

[root@localhost /] #

Success!

Overview of fuser

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

[root@gc-statis2] # fuser-m-v tests/

User process number permission command

Tests/: root 7300 F.ce. Php-fpm

Www 7301.. ce. Php-fpm

Www 7302.. ce. Php-fpm

Www 7303.. ce. Php-fpm

Www 7304.. ce. Php-fpm

Www 7305.. ce. Php-fpm

Www 7306.. ce. Php-fpm

Www 7307.. ce. Php-fpm

Www 7308.. ce. Php-fpm

Www 7309.. ce. Php-fpm

Root 18891.. c.. Bash

At the same time, fuser can be used to find which processes are using the specified port (network port).

[root@gc-statis2] # fuser-v-n tcp 80

User process number permission command

80/tcp: root 7975 F.... Nginx

Www 7976 F.... Nginx

Common scenarios in fuser

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

Fuser-k / path/to/your/filename

At this point, fuser sends SIGKILL to all processes that are using / path/to/your/filename. If you want to be prompted before sending, you can use the-I option.

Fuser-k-I / path/to/your/filename

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report