Linux disk space is insufficient, but DF is used, but at least half of the disk space is not used.

Source: Internet
Author: User

Linux does not have enough disk space, but DF-Ah shows that there is nearly half of the space. How can this problem be reported?

 

 

In fact, it is very simple, because the node is used up, and a file corresponds to a node. the space we mentioned here is actually block, the block has space, but the node has no space.

 

 

Why is this happening?

Using tune2fs-L/dev/sdd1, we can see that the block size is large, and the space allocated by the node becomes very small.

 

 

 

In this disk, all PHP files with a size of 1-2 kb are stored. Naturally, it occupies the node

 

 

How can this problem be solved?

The block size must be adapted. If a file such as 1-2 kb is stored, the first block can beat 1024 bytes, but the disk occupies 4096 bytes.

If you want to store videos and large image files, use 4096.

 

Note that the data on the node must be larger than the block, because it does not make sense that the number of node nodes is greater than the block. A file must occupy one block, in more cases, more blocks are occupied.

 

 

In this way, you can reformat the disk

Mke2fs-J-B 1025-I 2048/dev/sdb1

 

Format mke2fs:

-J: Specify the ext3 file format to be disk-oriented.

-B: Specify the block size,

-I: Specify the node size.

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.