1

I am running Ubuntu 16.04 in a VMWare VM.

My root partition /dev/mapper/vg_ldt-lv_root is almost full, which is mounted to /:

$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
udev                        3.9G     0  3.9G   0% /dev
tmpfs                       797M   80M  718M  10% /run
/dev/mapper/vg_ldt-lv_root   33G   30G  1.9G  94% /
tmpfs                       3.9G   54M  3.9G   2% /dev/shm
tmpfs                       5.0M  4.0K  5.0M   1% /run/lock
tmpfs                       3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1                   1.9G  160M  1.6G  10% /boot
tmpfs                       797M     0  797M   0% /run/user/998
tmpfs                       797M   88K  797M   1% /run/user/3841712
tmpfs                       797M     0  797M   0% /run/user/999

So I tried investigating where the disk space went. I used sudo ncdu but it only returns me 14.2GB:

ncdu 1.11 ~ Use the arrow keys to navigate, press ? for help          
--- / ----------------------------------------------------------------
    6.1 GiB [##########] /usr                                         
    3.4 GiB [#####     ] /home
    2.0 GiB [###       ] /var
    1.2 GiB [##        ] /opt
  917.0 MiB [#         ] /lib
  372.7 MiB [          ] /root
  156.7 MiB [          ] /boot
.  79.4 MiB [          ] /run
   30.8 MiB [          ] /etc
   14.6 MiB [          ] /sbin
   12.8 MiB [          ] /bin
   12.4 MiB [          ] /tmp
  456.0 KiB [          ] /dev
e  16.0 KiB [          ] /lost+found
   12.0 KiB [          ] /emul
    8.0 KiB [          ] /isec
    8.0 KiB [          ] /McAfee
    8.0 KiB [          ] /mnt
    8.0 KiB [          ] /media
    4.0 KiB [          ] /lib64
e   4.0 KiB [          ] /srv
e   4.0 KiB [          ] /cdrom
e   4.0 KiB [          ] /Quarantine
.   0.0   B [          ] /proc
    0.0   B [          ] /sys
@   0.0   B [          ]  initrd.img.old
@   0.0   B [          ]  initrd.img
@   0.0   B [          ]  vmlinuz.old
@   0.0   B [          ]  vmlinuz
e   0.0   B [          ] /net


 Total disk usage:  14.2 GiB  Apparent size:  13.9 GiB  Items: 871532

How can I find out where the other missing 15GB are?

2
  • 6
    sudo lsof | grep -i deleted may give you some clues May 23, 2018 at 17:43
  • If it's ext[34] then df -i / gives you the number of files. A huge number (millions) of small files would waste a relevant amount of space (usually 2K per file on average). May 23, 2018 at 17:58

1 Answer 1

3

Thanks to roaima, sudo lsof | grep -i deleted gave me the correct hint:

...
ACPI\x20P 115235 115264    user   18w      REG              252,0       71889    2090030 /home/user/.minikube/machines/minikube/minikube/Logs/VBox.log (deleted)
ACPI\x20P 115235 115264    user   19r      REG              252,0   157843456    2090240 /home/user/.minikube/machines/minikube/boot2docker.iso (deleted)
ACPI\x20P 115235 115264    user   20u      REG              252,0 16021913600    2090248 /home/user/.minikube/machines/minikube/disk.vmdk (deleted)
...

Long story short, I found out that on my Linux machine, VirtualBox was running in the background, having those three files still opened. I didn't know that Linux keeps disk space reserved for files that are opened but were deleted in the meantime.

I killed VirtualBox ("turning machine off and on again" might have been a good idea, too) and voilà:

$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
udev                        3.9G     0  3.9G   0% /dev
tmpfs                       797M   80M  718M  10% /run
/dev/mapper/vg_ldt-lv_root   33G   15G   17G  46% /
tmpfs                       3.9G   12M  3.9G   1% /dev/shm
tmpfs                       5.0M  4.0K  5.0M   1% /run/lock
tmpfs                       3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1                   1.9G  160M  1.6G  10% /boot
tmpfs                       797M     0  797M   0% /run/user/998
tmpfs                       797M   84K  797M   1% /run/user/3841712
tmpfs                       797M     0  797M   0% /run/user/999
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .