Due to the unreasonable design during system installation, the rapid growth of log files due to network communication faults, and other reasons, such as the full disk space, may lead to the inability to read and write disks, the application cannot be executed. Here are some tips for you (taking the full/home space as an example ):
1. Regularly scans and compares important file systems to analyze frequently read/write files.
# Ls-LR/Home> export files.txt
# Diff filesold.txt files.txt
By analyzing and predicting the growth of space, you can also consider compressing infrequently read/write files to reduce the occupied space.
2. View inodes consumption of file systems with full space
# DF-I/home
If there is a large number of inode available, it means that large files occupy space. Otherwise, a large number of small files may occupy space.
3. Find a directory with a large footprint
View space occupied by/home
# Du-HS/home
View/home occupied space exceeds 1000 MB
# Du | awk '$1>; 100'
4. Find out the files that occupy a large space
# Find/home-size + 2000 K
5. Find the most recently modified or created File
Touch a file that you want at the following time:
# Touch-T 08190800 Test
# Find/home-newer test-print
6. delete system logs.
Delete generated files such as core and mbox
# Find/-name core | xargs Rm-RF
Delete logs
# Rm-RF/var/log /*
7. link the partition
Links to partitions with no space
# Ln-S/home/usr/home
8. Find out the process that consumes a lot of space
Find the corresponding process based on different applications. Analyze the cause.
9. Check and repair the File System
# Fsck-y/home
10. Restart the machine
With the above 10 tips, most problems should be solved, but the key is to plan the partitions during installation. In addition, when the disk is found to be full, do not rush, operate with caution, carefully analyze the cause, and then respond with caution. Note that the above 10 moves do not need to be executed in sequence. Some may have to seal the throat, and some may need to use the same number of moves. You must be careful when deleting the moves. If not, simply add a hard disk and reinstall the system.
You can also:
CD \
Du-h -- Max-depth = 1 | grep G | sort-n
Find the largest directory and enter it.
Run Du-h -- Max-depth = 1 | grep G |-n
Run Du-h -- Max-depth = 1 | grep M | sort-N if no result exists.
Find a useful File
Delete it if it is useless.