System Information -> Local Disk Space

I think I have found a bug!

When you go to System Information page and refer to Local Disk Space information is shown incorrectly, at least in my case. It's written that I have 7.57 TB and that it's used 438.19 GB when I'm sure that it's used only around 42 GB in total - which is ten time more difference?

I checked it with du -ch / | grep total to make sure that I'm correct - answer was 42 GB?

Could you please check and fix it?

Status: 
Closed (fixed)

Comments

Hmm, that does indeed sound unusual!

What output does this command produce:

df -h

Ilia's picture
Submitted by Ilia on Tue, 03/26/2013 - 08:24

It produces the correct output, just as expected!

What else it could be?

Could you post the output from the df -h command on your system? I'd like to see what disks are mounted, and what sizes they have.

Ilia's picture
Submitted by Ilia on Tue, 03/26/2013 - 15:36

Sure, Jammie, here:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb2              63G  685M   60G   2% /
tmpfs                  32G     0   32G   0% /dev/shm
/dev/sdb1             504M  100M  379M  21% /boot
/dev/sdb6              16G  173M   15G   2% /tmp
/dev/sdb3              32G  1.2G   29G   4% /usr
/dev/sdb5              32G  637M   30G   3% /var
/dev/mapper/var       276G  227M  261G   1% /var/lib/mysql
/dev/mapper/home      6.7T   42G  6.3T   1% /home
Ilia's picture
Submitted by Ilia on Tue, 03/26/2013 - 16:49

Jamie, for your information, these are encrypted partitions with luks:

/dev/mapper/var       276G  227M  261G   1% /var/lib/mysql
/dev/mapper/home      6.7T   42G  6.3T   1% /home

Ok, so the reason for the discrepancy is that Linux by default reserves 5% of every filesystem for the root user. And when Virtualmin displays the space free, it takes that into account. You can see this frm the df line for the /home filesystem :

/dev/mapper/home      6.7T   42G  6.3T   1% /home

Note how 6.3T + 42G does not equal 6.7T.

Ilia's picture
Submitted by Ilia on Wed, 03/27/2013 - 02:29

Is there a way to rely on

du -ch / | grep total
44G     total

Other wise it's not clear how much space is occupied? :) Or just make it optional for those who wan't to use default and who wants to use du

P.S. Working on backup idea! Will come back to our thread when done with some results..

We can't use du to get disk usage, as that would take a long time to run on a large filesystem.

What you might consider instead is using tunefs to reduce the fraction of disk space reserved for root.

Ilia's picture
Submitted by Ilia on Wed, 03/27/2013 - 12:54

Ok, do I do this with:

tune2fs -m 1 /dev/sda??

Do I do it for each physical drive or only once? Or I do it on each partition? /sda1 sda2 sda3 sdb1 sdb2 etc?

You need to do it for each partition.

Ilia's picture
Submitted by Ilia on Wed, 03/27/2013 - 13:03

Oh, yes now it fine! And I suppose that base on the following I will not run into any problems??

If you set the reserved block count to zero, it won't affect performance much except if you run for long periods of time (with lots of file creates and deletes) while the filesystem is almost full (i.e., say above 95%), at which point you'll be subject to fragmentation problems. Ext4's multi-block allocator is much more fragmentation resistant, because it tries much harder to find contiguous blocks, so even if you don't enable the other ext4 features, you'll see better results simply mounting an ext3 filesystem using ext4 before the filesystem gets completely full. If you are just using the filesystem for long-term archive, where files aren't changing very often (i.e., a huge mp3 or video store), it obviously won't matter.

https://www.redhat.com/archives/ext3-users/2009-January/msg00026.html

Yes, it's true that if the FS gets and stays really full performance will suffer.

Disk usage is showing used 15gb when I do a du I only see 3.8gb used of space.Attached is an image of this.

Please note even though both connections have different hostnames one as rac.revnet the other server.revnet they are both the same system. As I have a microserver I use the PCIE 'HP remote access card' to manage the server which uses its own network port and hostname.

drguild - what filesystem type are you using there? btrfs, ext, or something else?

It is ext4 which is the default in ubuntu.

I have a feeling some of it could be reserved from what I saw root reserves space or something but unsure.

Ok, the reason for the mismatch is that space reserved for root is counted as used.

So 222 - 207 = 15 GB used.

Automatically closed -- issue fixed for 2 weeks with no activity.