Announcement

Collapse
No announcement yet.

filelight and df -h disk usage aren't the same

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    filelight and df -h disk usage aren't the same

    The kde disk usage app "filelight" shows that I'm only using 15.9 GB of a 50GB hard disk. See screenshot: http://zydecodigital.com/filelight.png

    However, "df -h" shows that I'm almost at capacity.

    randall@randall-VirtualBox:~$ df -h
    Filesystem Size Used Avail Use% Mounted on
    udev 995M 4.0K 995M 1% /dev
    tmpfs 202M 1.2M 201M 1% /run
    /dev/sda1 49G 46G 440M 100% /
    none 4.0K 0 4.0K 0% /sys/fs/cgroup
    none 5.0M 0 5.0M 0% /run/lock
    none 1008M 84K 1008M 1% /run/shm
    none 100M 20K 100M 1% /run/user
    none 230G 129G 101G 57% /media/sf_Public



    As a background, I'm using Kubuntu 14.04 32 bit on a VirtualBox virtual machine. sda1 is my root partition and sf_public is a shared Virtualbox folder on my host OS.

    How do I fix? I'm positive I'm not using the entire 50GB partition.

    #2
    No, you probably aren't, but usually, virtualbox's virtual 'drives' are dynamically sized, growing as needed, so it is not uncommon to see it at 100%. There is a virtual disk size as well as an actual disk size (you can see this in your virtual machine's configuration), and I guess one is reporting the first, and the other is reporting the second.

    Comment


      #3
      Originally posted by claydoh View Post
      No, you probably aren't, but usually, virtualbox's virtual 'drives' are dynamically sized, growing as needed, so it is not uncommon to see it at 100%. There is a virtual disk size as well as an actual disk size (you can see this in your virtual machine's configuration), and I guess one is reporting the first, and the other is reporting the second.

      Incorrect. The filelight screenshot and the df -h output are both captured from within the guest KUbuntu OS. I use Windows 10 as my host OS.

      It's some kind of bug with how KUbuntu/Linux is reading the disk usage. It seems filelight computes by checking every file size, whereas df -h only checks some kind of partition table entry or something. I'm not a sys admin hoping to get some help here.

      Comment


        #4
        There is a FAQ about this somewhere on the virtualbox site, lemme see if I can find it.

        What size did you set your virtual drive to when you installed Kubuntu?

        Comment


          #5
          Originally posted by claydoh View Post
          There is a FAQ about this somewhere on the virtualbox site, lemme see if I can find it.

          What size did you set your virtual drive to when you installed Kubuntu?
          50gb

          Comment


            #6
            Originally posted by Randall Toepfer View Post
            It's some kind of bug with how KUbuntu/Linux is reading the disk usage. It seems filelight computes by checking every file size, whereas df -h only checks some kind of partition table entry or something. I'm not a sys admin hoping to get some help here.
            Incorrect. The filelight screenshot below and the df -h output are both captured simultaneously from an actual Kubuntu install. It seems likely some kind of bug in how df computes disk usage in a dynamically allocated virtual drive.

            Code:
            stuart@office:~$ df -h
            Filesystem         Size  Used Avail Use% Mounted on
            /dev/sdg3          460G  301G  158G  66% /
            server:/           1.9T  1.1T  741G  61% /shared
            /dev/sda2          197G   74G  114G  40% /mnt/vm_drive
            /dev/sda3          732G  105G  627G  15% /backups
            Seriously, if you're looking for answers, it's better not to come to conclusions before gathering all the evidence. Obviously, something is going wrong on your end, but making pronouncements isn't going to help.

            According to your post on Virtualbox forums:

            Wrong Disk Free Space

            by Zydeco Digital » 10. Feb 2016, 22:48
            My host 0S is Windows 10. I have KUbuntu 14.04 guest OS. I had 3 shared folders from my host machine to my guest machine.

            When I ran filelight in KUbuntu, it told me I have 1% free space (out of 50GB). The shared folders were counting against the free space. So I shutdown my KUbuntu guest 0OS, removed the shared folders from the Virtualbox settings, rebooted, deleted the folders in the /media directory, and reran filelight. Now it shows I only use 19GB of my 50GB.

            However, if I do df -h on the command line it still shows only 1% free.

            randall@randall-VirtualBox:~$ df -h
            Filesystem Size Used Avail Use% Mounted on
            udev 995M 4.0K 995M 1% /dev
            tmpfs 202M 1.1M 201M 1% /run
            /dev/sda1 49G 46G 523M 99% /
            none 4.0K 0 4.0K 0% /sys/fs/cgroup
            none 5.0M 0 5.0M 0% /run/lock
            none 1008M 76K 1008M 1% /run/shm
            none 100M 20K 100M 1% /run/user


            Seems to be some kind of bug with the VirtualBox Guest OS Additions where the shared folder counts against the disk usage. How do I fix?


            the problem is "...some kind of bug with the VirtualBox Guest OS Additions where the shared folder counts against the disk usage."

            Might I suggest you begin at the beginning and post what you've tried (like removing shared folders) and any other evidence you've uncovered that might point to the problem. A quick google search reveals various reports that are similar to yours. I would suspect df and how virtual allocates sectors is the culprit as is outlined in this post: https://forums.virtualbox.org/viewtopic.php?f=6&t=54411

            I'd be curious to know what VBox says about the vdi disk size re. Virtual vs. Actual size...
            Attached Files

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              Incorrect. The filelight screenshot below and the df -h output are both captured simultaneously from an actual Kubuntu install. It seems likely some kind of bug in how df computes disk usage in a dynamically allocated virtual drive.

              Code:
              stuart@office:~$ df -h
              Filesystem         Size  Used Avail Use% Mounted on
              /dev/sdg3          460G  301G  158G  66% /
              server:/           1.9T  1.1T  741G  61% /shared
              /dev/sda2          197G   74G  114G  40% /mnt/vm_drive
              /dev/sda3          732G  105G  627G  15% /backups
              Seriously, if you're looking for answers, it's better not to come to conclusions before gathering all the evidence. Obviously, something is going wrong on your end, but making pronouncements isn't going to help.

              According to your post on Virtualbox forums:



              the problem is "...some kind of bug with the VirtualBox Guest OS Additions where the shared folder counts against the disk usage."

              Might I suggest you begin at the beginning and post what you've tried (like removing shared folders) and any other evidence you've uncovered that might point to the problem. A quick google search reveals various reports that are similar to yours. I would suspect df and how virtual allocates sectors is the culprit as is outlined in this post: https://forums.virtualbox.org/viewtopic.php?f=6&t=54411

              I'd be curious to know what VBox says about the vdi disk size re. Virtual vs. Actual size...
              From the point of view of the guest OS the image file size on the host OS should have no bearing, so I don't think that forum post is relevant. Yes I also posted in the VirtualBox forums, perhaps the guest OS additions package modifies the file system stats reported by df.

              Anyone else have a suggestion?

              Comment


                #8
                What does Dolphin say?

                Comment


                  #9
                  However, if I do df -h on the command line it still shows only 1% free.
                  ...
                  randall@randall-VirtualBox:~$ df -h
                  Filesystem Size Used Avail Use% Mounted on
                  udev 995M 4.0K 995M 1% /dev
                  tmpfs 202M 1.1M 201M 1% /run
                  /dev/sda1 49G 46G 523M 99% /
                  I don't know much about this topic, but I notice there's a contradiction above. This shows / as 99% free, not 1%.
                  Regards, John Little

                  Comment


                    #10
                    Originally posted by jlittle View Post
                    I don't know much about this topic, but I notice there's a contradiction above. This shows / as 99% free, not 1%.
                    No it doesn't, df numbers are: "Size" "Used" "Available" and "Usage %" (not "Free %")

                    On the actual issue, df uses the statfs syscall to read the filesystem metadata (superblocks) to get the disk usage, it doesn't really calculate anything (this explains why df is lightning fast as opposed to tools that traverse the filesystem and calculate actual file sizes, like "filelight" or the shell command "du"). So it could be the issue has something to do with statfs on dynamic virtualbox filesystems.
                    Last edited by kubicle; Feb 18, 2016, 05:12 AM.

                    Comment


                      #11
                      So going back to his original question "How do I fix" he just needs to trust something other than df? I don't use Virtualbox since I have no need for a Windows host but I have a number of virtual machines using KVM/QEMU. I generally just look at the disk usage in the file manager (such as Dolphin). Guess I'm lazy but can Randall not just do that since he is running a Kubuntu desktop?

                      Comment


                        #12
                        For what it's worth, on my Xenial vbox client, dynamic disk of 16GB (14 install, 2 swap), actual size 5GB, df and filelight show same percentages of use. I would suspect something is damaged or wrong with the filesystem or virtual disk. I don't see any bugs in df here.

                        Please Read Me

                        Comment

                        Working...
                        X