Example of a umount forced uninstall device under Linux

Source: Internet
Author: User

Umount command

Unpack the file system. Umount [-ahnrvv][-t < file system type >][file system]

Umount can dismount a file system currently attached to a Linux directory.

There was a problem with NFS access on the line, which caused the/data1 directory LS to be out of output and needed to be uninstalled. While the direct uninstall because the directory is being occupied by other processes, can not directly umount, here on the combination of fuser for umount Uninstall.

1. Direct Uninstall

[Root@localhost/]# umount/data1/img
Umount:/data1/img:device is busy
Umount:/data1/img:device is busy

2, the hint is occupied, use force uninstall

[Root@localhost/]# umount-f/data1/img
Umount2:device or resource busy
Umount:/data1/img:device is busy
Umount2:device or resource busy
Umount:/data1/img:device is busy

Note: When forced uninstall with the-f parameter it is generally recommended that you do the following later, in some cases it takes 1-2 minutes to process.

3, the use of umount-f, the problem remains. Using the Fuser command, first confirm that the process is consuming the directory

[Root@localhost/]# fuser-cu/data1/img
/data1/img:1757c (MySQL)

The above view finds that a MySQL user with a PID of 1757 takes up the directory.

4, to confirm that the process of MySQL can kill, you can directly use the Fuser K parameters to kill (also can manually stop 1757 process and then uninstall)

[Root@localhost/]# fuser-ck/data1/img
/data1/img:1757c

Note: Here K is the meaning of kill, be careful to use this parameter before confirming the confirmation.

In addition, when umount an exception, the lsof is often used to specify what processes occupy the file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.