Linux disk space is not enough to do, Disk Cleanup method

Source: Internet
Author: User
Tags file system sort touch

Because the original installation system design is unreasonable, some zoning is too small, as well as network communication failures and other causes of log file speed growth and other reasons can be displayed as disk space full, resulting in the inability to read and write the disk, the application can not execute. Here are a few tips for you (take/home space full as an example):

  1. Regular scanning of important file systems, and comparison, analysis of those documents often read and write

#IS-ir/home>;files.txt

#diff Filesold.txt Files.txt

By analyzing the growth of the predicted space, you can also consider compressing the infrequently read and write files to reduce space usage.

  2. View the inodes consumption of the space file system

#df-i/home

If there are a large number of inpde available, indicating that large files occupy space, no thief may be a large number of small files occupy space.

  3. Find a large footprint directory

View space occupied by/home

#du-hs/home

View footprint over 1000m under/home

#du/awk ' $1>;2000 '

  4. Find a document that occupies a larger space

#find/home-size +2000k

  5. Find the most recently modified or created file

First touch a file with the time you want as follows

#TOUCH-T 08190800 Test

#find/home-newer Test-print

Delete Log

#rm-rf/var/log/*

  7. Make connections to partitions

In a space partition, make a connection to an empty partition

#in-s/home/use/home

  8. Find a process that consumes a lot of space

According to the different application, find the corresponding process, analyze the reason.

  9. Check and Repair file system

#fsck-y/home

  10. Reboot 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 when installing. Also found that the disk is quite, not urgent, careful operation, serious analysis of the reasons, and then carefully deal with. Need to note that the above ten strokes do not need sequential execution, some may be a recruit seal throat, some may need to use several strokes, delete operation must be careful. If not, only to take the additional hard drive, reinstall the system and other "hard" way

It's OK:

cd/

Du-h--max-depth=q/grep M/sort-n

Find the largest directory and enter the directory

Run Du-h-max-depth=1/grep M/sort-n again

Find out if it's a useful file after you look it up

Delete it if it doesn't work.

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.