1. Never rush to restart the system. The cause of the problem should be reached early.
2. Check whether the disk space is full.
When the disk is found to be full, do not rush. perform the operation with caution, analyze the cause carefully, and then handle it with caution. Note that the following 10 strokes do not need to be executed in sequence. Some of them may have to be used in a batch, and some of them may need to be deleted. 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.
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 important file systems and compares them to analyze the files that are frequently read/written.
# 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 the directory that occupies a large space
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 partitions
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