Linux has a disk footprint of 100% and no large files have been found to run out of disk.

Source: Internet
Author: User

Linux root partition utilization 100%, but the view/partition under the directory is not large, not occupied full, how to deal with this?
Restart is sure to work, the current situation: after re-restart application, space released
1, lsof | grep deletd
2. Reboot restart
Linux has a disk footprint of 100% and no large files have been found to run out of disk.
Using DF-LH under Linux
When viewing disks:
/DEV/SDA1 130G 123G 353M 100%
/
The disk is almost exhausted,
But my side is not to find out which large files are occupied.
1. If a large file is occupied, then the method of querying a file larger than a certain value:
Find/-size +100c-print
This is starting from the root disk to find files larger than 100 bytes (as for the number of bytes you can certainly set yourself)
You can use Find/-size +100c-exec ls-l {}\; To list file properties.
2, if only because some applications generate more log files, long time did not clean up after the occupation, the most obvious sign for the system space usage gradually increased, the daily increment basic difference is not small. The quickest way to do this is to ask the application vendor to clean up after the log is stored in the directory. If you can't find a vendor, then you have to do it yourself, write a script to check:
#!/bin/ksh
Use the du command to output the amount of disk space that all directories occupy, in G
Du-h >fs_du.log
Determine the size of each level of the directory, to find a large amount of the directory
Cat Fs_du.log|while Read Line fs_used
Do
If
[LINE? Geten]thenecho Fs_used >>result.log
Else
Exit
Fi
Done
View Run Results
More Result.log
This allows you to see a larger catalog, which is targeted to the appropriate directory to check to see exactly what is taking up the hard disk space.
(If [$LINE-ge 10] Here is to judge more than 10G of the directory, you can modify)
3, because of human error operation, causing some processes to be killed when no execution is completed, but the program in the cache is not released, still running, this will produce some temporary files occupy a large amount of disk space resources, this phenomenon is characterized by explosive growth, in a very short period of time will be full of disk space. The workaround:
1, if it is because the parent process is killed, the child process also runs, then the simplest, kill child process, will be released.
2, if you can use IPCS to confirm which user's process, then it is not difficult, along with the use of IPCRM on the line (this is not one by one cases, with the command to check the use of the method is very convenient)
3, the implementation process of users are more critical users such as: root users, Oracle users have instances, online production users and so on. It is recommended that you restart the server after confirming that the problem is caused by the shared cache.
4, you have deleted some large-scale files, or under the root disk to do
Du-h
The result of finding that the footprint is far less than 130G,DF is still 100% utilization. Then basically sure you have encountered a Linux bug, a direct restart can be resolved. (Of course, it is not necessarily a bug, I have encountered that program in writing a log, but delete the log after the space does not release the issue.) This is caused by the mechanism of Linux itself, just to stop the relevant program space will be released in fact, not your disk space is occupied, but your disk node exhausted. Use:
Df-i/dev/sdbx (x is logical partition)
command to view the I node condition.
WORKAROUND: Delete the empty file that occupies the I node,
Command:
Rm-rf/ -empty -a -type fThe/OPT partition is full of web logs, causing some services to not function properly, so rm-rf off these logs (nearly 11GB), but the service is still not back to normal, with DF-HT, the partition occupies or 100%:
[Email protected] opt]# DF-HT
But with the du-sh/opt command, see:
[Email protected]/]# du-sh/opt/
8.3g/opt/
These files should be deleted, but the space is not released, of course, the restart can be resolved, but will cause all the business disruption on the server, you can use the following command to view the deletion of file occupancy:
[Email protected] opt]# lsof |grep Delete

Linux has a disk footprint of 100% and no large files have been found to run out of disk.

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.