No space left on device solves Linux system disk space full method

Source: Internet
Author: User
Tags system log

Due to the original installation of the system design unreasonable, some partition is too small, and network communication failure, such as the rapid growth of log files and other reasons may appear to be full of disk space, resulting in the inability to read and write disk, the application can not be executed and so on.

(for example, the/home space is full):

1. Regular scanning of important file systems, and comparison, analysis of those files often read and write #ls –lr/home >;files.txt #diff filesold.txt files.txt through the analysis of the growth of the predicted space, but also to consider the non-regular reading and writing Compressed to reduce space consumption.2. View inodes consumption of a file system full of space#df –i/home If there are a large number of inode available, it means that large files occupy space, otherwise it is possible to take up a large number of small files.3. Find a directory with a larger footprintView the space occupied by/home #du –hs/home View/home occupies more than 1000m #du |awk ' $1>;2000 '4. Find files with larger footprint#find/home–size +2000k 5. Find files that you recently modified or created touch a file of the time you want: # touch-t 08190800 Test #find/home-newer test-print 6. Delete the system log such as delete generated core,mbox files #find/-name Core|xargs RM–RFDelete Log #rm-rf/var/log/*7. Make a link to the partition in a space partition, do not have the spatial partition to do the link #ln-S/home/usr/home 8. Find the process that consumes a lot of space according to the different application, find out the corresponding process.   Analyze the cause. 9. Check and repair the file system #fsck –y/home 10. Restart the machine with the above 10 strokes, you should be able to solve most of the problems, but the key is to plan the partition during installation. In addition, found that the disk is full, can not be urgent, careful operation, carefully analyze the reasons, and then carefully deal with. Need to be aware that the above ten strokes do not need to be executed sequentially, some may be a trick to seal the larynx, some may require a number of strokes and use, delete operation must be careful.   If not, only take the "hard" approach of adding hard drives and reinstalling the system. You can also: cd \ du-h--max-depth=1|grep g|sort-n find the largest directory after entering the directory and then run du-h--max-depth=1|grep g|-n If no results can be run du-h- -max-depth=1|grep M|sort-n Find out later to see whether the useful documents are useless to delete

No space left on device to solve the Linux system disk space full method

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.