Skip to main content

Calculating the actual size of a drive



  • rbairwell

    What does:

    df -h

    report as usage on the drive? Your "du" command reports 49G used on my machine and for the mountpoint "/", df reports 50G used - so that's close enough for me.

    The ending of the "du" command (78G in your screen shot) will consist of all the items not excluded - so that 78G includes 5.8G of /usr, /5.7G of /var, 66G of of /home etc...

    I'm guessing the WHM interface and neofetch are both including the "space" taken up by VirtFS to provide the Jailed Shell environment (if I don't exclude /home/virtfs from "du" - i.e. "du -hxd1 / --exclude=/proc --exclude=/sys", the usage jumps up from 49G to 190G). Does include VirtFS corresponds to the "missing amount"?

    It is also possible that if the drive is failing, it could also be misreporting data.

  • JayConsulting

    Hello rbairwell!
    Thanks for you reply.

    df -h on the drive in question outputs the same as WHM.
    /dev/sdb1       226G  167G   50G  78% /

    Alright so the ending  of the "du" command with the excludes results in the "real" disk usage of the entire root dir( /). Thanks alot!

    The wierd thing is if i run du on the /home/virtfs it responds with a whopping 287GB, which doesnt make sense to me.

    [root@server2 ~]# du -sh /home/virtfs/
    287G    /home/virtfs/

    I really wanna ditch virtfs for cagedfs and CL, but not until ive figured this headscratcher out :P

    Anyway I could test the drives, like a memtest? It is a cloud server at hetzner, and does not have a dedicated drive.


Please sign in to leave a comment.