lsof command usage: View deleted space but not released process

Source: Internet
Author: User

View deleted files, space has no release, no then kill PID

Lsof-n |grep deleted


Lsof Introduction lsof (list open files) is a tool that lists open files for the current system.


Problem Description:

Service Alarm root partition utilization more than 95%, come up to see 96% utilization rate;

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/99/58/wKiom1lHd_DBY8mrAAALkx0jBwc936.png-wh_500x0-wm_ 3-wmp_4-s_384454434.png "title=" qq picture 20170609143710.png "alt=" Wkiom1lhd_dby8mraaalkx0jbwc936.png-wh_50 "/>

but/partition below the directory, each query add up also less than 4G space, the more out of the 40G do not know where?

Find query also found no large file;


Analysis Reason:

It may be that the space occupied by the system process is not released, resulting;

Through the command to see the discovery, PHP process a total of 3, are in the deleted state, the file size is just 40G, just is more out of space, to find the problem;


Workaround:

Find the corresponding PHP process number, kill can be;

[[email protected] webserver]# lsof -n / |grep deletedmysqld      2660   mysql    4u   REG     8,2           0  524290 /tmp/ ibsf7sxt  (Deleted) mysqld     2660   mysql     5u   reg    8,2            0  524305 /tmp/ibCCM4u4  (Deleted) mysqld     2660    mysql    6u   REG    8,2            0  524309 /tmp/ibKuAG2E  (Deleted) mysqld      2660   mysql    7u   REG     8,2           0  524315 /tmp/ibcLe4Bf  ( deleted) mysqld     2660   mysql   11u    reg    8,2           0   524316 /tmp/ibw2n1iq  (Deleted) php        7045     root    0r   REG    8,2         1172  524374 /tmp/sh-thd-1494029191  (Deleted) php         7045    root    2w    reg    8,2 42413952626  657428 /var/spool/at/spool/ a0100c017bf37c  (Deleted) php        7054     Root    0r   reg    8,2        1172  524374  /tmp/sh-thd-1494029191  (Deleted) php        7054     root    2w   reg    8,2 42413952626   657428 /var/spool/at/spool/a0100c017bf37c  (Deleted) php        12730    root    0r   REG     8,2        1172  524374 /tmp/sh-thd-1494029191   (Deleted) php       12730    root     2w   reg    8,2 42413952626  657428 /var/ spool/at/spool/a0100c017bf37c  (Deleted) mysqld    17855   mysql     4u   reg    8,2           0   524384 /tmp/ibxBS5jf  (Deleted) mysqld    17855   mysql     5u   REG    8,2            0  524385 /tmp/ibmrNzfL  (Deleted) mysqld     17855   mysql    6u   reg    8,2            0  524386 /tmp/ibVDS3ah  ( deleted) mysqld    17855   mysql    7u    reg    8,2           0   524387 /tmp/ibx6ytrj  (Deleted) mysqld    17855   mysql    13u   REG    8,2           0   524388 /tmp/ibOhb8xQ  (Deleted)



No files found in the corresponding directory

[Email protected] webserver]# ll/var/spool/at/spool/

Total dosage 0

[Email protected] webserver]# kill-9 7045

[Email protected] webserver]# kill-9 7054

[Email protected] webserver]# kill-9 12730


Review the discovery process without PHP again

[Email protected] webserver]# lsof-n/|grep deleted

mysqld 2660 MySQL 4u REG 8,2 0 524290/tmp/ibsf7sxt (deleted)

Mysqld 2660 MySQL 5u REG 8,2 0 524305/tmp/ibccm4u4 (deleted)

Mysqld 2660 MySQL 6u REG 8,2 0 524309/tmp/ibkuag2e (deleted)

Mysqld 2660 MySQL 7u REG 8,2 0 524315/tmp/ibcle4bf (deleted)

Mysqld 2660 MySQL 11u REG 8,2 0 524316/tmp/ibw2n1iq (deleted)

mysqld 17855 MySQL 4u REG 8,2 0 524384/tmp/ibxbs5jf (deleted)

Mysqld 17855 MySQL 5u REG 8,2 0 524385/tmp/ibmrnzfl (deleted)

Mysqld 17855 MySQL 6u REG 8,2 0 524386/tmp/ibvds3ah (deleted)

Mysqld 17855 MySQL 7u REG 8,2 0 524387/tmp/ibx6ytrj (deleted)

Mysqld 17855 MySQL 13u REG 8,2 0 524388/tmp/ibohb8xq (deleted)


View space has been restored:

[[email protected] webtserver]# df-h file system capacity used with available percent mount point/dev/sda2 49G 4.4G 42G 10%/tmpfs 16G 0 16G 0%/dev/shm


This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1939816

lsof command usage: View deleted space but not released process

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.