Linux system disk prompts are full, but the size of the files on the disk and the size of the usage is not consistent, this is the case of disk loss, then what is the program to occupy the disk space? The following small series for you to introduce the next Linux lost disk space method.
Users who are often exposed to Linux may encounter this problem frequently:
Received a disk alarm, said that the XXX partition is full, then log on to the server DF A look, found that the disk is really full, and then you want to find out which directory is full, so du-s * a look, but found that all the size of subdirectories and DF Show total has been using disk space is not, sometimes even a lot of difference , so I wondered: where did my disk space go?
Here are 3 kinds of situations:
The Linux system takes the filename. The file at the beginning of the (dot) is considered a hidden file, and an operator like Bash will not match the hidden file, so if there is a larger hidden file under the root directory, it will not be du-sh *, the solution is: Du-sh. [^.] * 。
Non-empty directory is mount
When other partitions are generally mounted, it is recommended to mount to an empty directory, so what happens if you mount to a non-empty directory? For example, the/MNT directory was originally documented, and then the sudo mount/dev/sda6/mnt was executed. In fact, the Mount command can be fully implemented, the mount of the partition can be normal access, but the original in the/mnt file, now have access to, including du also can not see the size, but the disk space is still occupied, because if you umount/mnt later, All the original documents will be back.
The size of a file and the amount of disk space may not be exactly the same, such as a program has been open a file called log is written, and the middle of someone with the log command to clear the contents of the log, will produce such a file.
Above is the Linux to retrieve the lost disk space method Introduction, mainly is in the article three kinds of circumstance to occupy the disk space, the disk space is full can begin to clean up from these aspects.
Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 welcome you to join