How Linux retrieves lost disk space

Source: Internet
Author: User

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:

Hide Files

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.

Empty file

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

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.