0

I'm running Ubuntu on nVirtual Box. This vm has 2 disk mounted. One for the OS and for the media files. The media disk is mounted as sdb1. When I check for disk space using df -h, I'm getting 100% full on /dev/mapper/ubuntu--vg-root, the OS drive. The output is below

Filesystem                   Size  Used Avail Use% Mounted on
udev                         5.9G     0  5.9G   0% /dev
tmpfs                        1.2G  8.7M  1.2G   1% /run
/dev/mapper/ubuntu--vg-root   58G   55G   27M 100% /
tmpfs                        5.9G     0  5.9G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        5.9G     0  5.9G   0% /sys/fs/cgroup
/dev/sda1                    720M  109M  575M  16% /boot
/dev/sdb1                   1008G   13G  945G   2% /media/MT
tmpfs                        1.2G     0  1.2G   0% /run/user/1000

So I ran sudo du -d1 -h /, and it's reporting 79G of usage, with 75GB coming from the media disk (sdb1) mount. the output is as follow

584M    /var
4.0K    /srv
16M     /bin
16K     /lost+found
24K     /tmp
714M    /lib
13M     /sbin
4.0K    /mnt
75G     /media
1.4G    /usr
8.0K    /snap
8.7M    /run
du: cannot access '/proc/5965/task/5965/fd/4': No such file or directory
du: cannot access '/proc/5965/task/5965/fdinfo/4': No such file or directory
du: cannot access '/proc/5965/fd/3': No such file or directory
du: cannot access '/proc/5965/fdinfo/3': No such file or directory
0       /proc
6.4M    /etc
32K     /root
484M    /home
1.1G    /opt
4.0K    /lib64
0       /dev
0       /sys
108M    /boot
79G     /

So, practically, I am only using 4GB of space in the OS drive, but why is it reporting full?

I have tried the following command:

sudo apt-get clean
sudo apt-get autoremove --purge
sudo apt-get autoremove

I cleaned up /var/log to only about 17M remaining. I also followed this post with no luck. What am I missing??

  • Have you tried to reboot ? If you have deleted a large file that is still open by a program data will not be delete from the disk before the program closes. – Soren A Nov 23 '20 at 08:43

1 Answers1

0

From your df output, it looks like the /media directory is part of your root filesystem. Only /media/MT subdirectory is on another filesystem (/dev/sdb1), not the whole /media. /media/MT subdirectory takes 13G according to your df output, and the whole /media directory 75G according to your du output. So there must be 75-13=62G in /media directory outside of your sdb1 disk (outside of /media/MT subdirectory), ie. on the root filesystem. It's strange why df is reporting only 55G used on the root filesystem, but it is possible that du and df are counting differently. Anyway, try to move everything that's in your /media directory, but not in /media/MT subdirectory to that subdirectory. That should free up space on the root filesystem.

raj
  • 10,353