Disk Space Usage Deviation

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 磁盘空间使用率有偏差

| username: 胡杨树旁

Using df -h to check disk space usage, I found that Use% = 1.1/1.5 = 73%, but it shows the usage rate as 80%.

| username: 啦啦啦啦啦 | Original post link

Directly use df without the -h option to calculate.

| username: changpeng75 | Original post link

What file system?
When formatting the ext4 file system under Linux, there will be reserved space by default.

| username: 胡杨树旁 | Original post link

Yes, it’s in ext4 format.

| username: TiDBer_QYr0vohO | Original post link

In ext4 and many other file systems, by default, about 5% of the space is reserved for system processes. This prevents the file system from being completely filled, thereby ensuring the normal operation of the system.

| username: 胡杨树旁 | Original post link

Okay, understood. Thank you.

| username: changpeng75 | Original post link

You can use the tune2fs -m parameter to modify the reserved space.
tune2fs -m 1 /dev/nvme0n1p1 reserves 1% of the space. In extreme cases, you can set it to 0, which means no space is reserved.

| username: TiDBer_RjzUpGDL | Original post link

Learned.

| username: 呢莫不爱吃鱼 | Original post link

I see, thank you for the lesson.

| username: 小于同学 | Original post link

Got it.

| username: 这里介绍不了我 | Original post link

Just to keep a record.

| username: YuchongXU | Original post link

Normal situation

| username: Jack-li | Original post link

In the Linux operating system, space is reserved for the system.

| username: DBRE | Original post link

Learned.

| username: 小于同学 | Original post link

Got it.