Where has my disk space gone

Hi, I’ve been running OSMC on a Pi2B for a while, regularly updating it. For a few months I’ve been backing up my linux (ClearOS) server to a 250GB 2.5" USB disk connected to the Pi. The Pi is currently powered by a 3A PSU and has been fine on it (no power warning). This week the backup (rsync) failed and I think I’ve tracked it down to a lack of space (apt-get clean freed ~1GB and it is working now) but I can’t see where it has gone. I have the following:

root@osmc:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        362M     0  362M   0% /dev
tmpfs           367M  5.1M  362M   2% /run
/dev/mmcblk0p2  7.0G  5.7G  920M  87% /
tmpfs           367M     0  367M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           367M     0  367M   0% /sys/fs/cgroup
/dev/mmcblk0p1  240M   21M  219M   9% /boot
/dev/sda1       230G  143G   75G  66% /mnt/USBDisk
tmpfs            74M     0   74M   0% /run/user/0

root@osmc:/# du -h --max-depth=1
47M     ./opt
0       ./sys
117M    ./var
4.0K    ./lib64
5.1M    ./run
91M     ./lib
6.2M    ./bin
5.0M    ./sbin
143G    ./mnt
4.0K    ./srv
21M     ./boot
4.0K    ./selinux
16K     ./lost+found
24K     ./tmp
5.0M    ./etc
8.0K    ./media
0       ./dev
du: cannot access './proc/1/task/1/fd/16': No such file or directory
du: cannot access './proc/570/task/570/fd/3': No such file or directory
du: cannot access './proc/570/task/570/fdinfo/3': No such file or directory
du: cannot access './proc/570/fd/4': No such file or directory
du: cannot access './proc/570/fdinfo/4': No such file or directory
0       ./proc
588M    ./usr
212K    ./root
200M    ./home
144G    .

The 143G is the USB disk mounted under /mnt.

root@osmc:/# fdisk -l

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0003d932

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   499711   497664  243M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      501760 15523839 15022080  7.2G 83 Linux

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdb75393d

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 488396799 488394752 232.9G 83 Linux

So I can see from fdisk -l I have 7.2GB, but the output of du -h does not give anywhere near 5.9GB excluding /mnt and /boot. How can I track down the missing space?

I am comfortable with the linux command line but more familiar with Fedora based systems.

1 Like

You’ve had a failed mount in /mnt. Something was written to that disk location while the mount had failed. A mounted device would not show the size of /mnt as 143G. (Ok, my mount indeed shows the size of mounted shares, my mistake) It looks like the data is in 144G . the / directory.

1 Like

Do you have a lot of files on your SD card?

@ActionA,
Good shout; that was it. I unmounted the drive and could see the other files which I’ve deleted.

root@osmc:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        362M     0  362M   0% /dev
tmpfs           367M  5.1M  362M   2% /run
/dev/mmcblk0p2  7.0G  1.1G  5.6G  17% /
tmpfs           367M     0  367M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           367M     0  367M   0% /sys/fs/cgroup
/dev/mmcblk0p1  240M   21M  219M   9% /boot
tmpfs            74M     0   74M   0% /run/user/0
/dev/sda1       230G  143G   75G  66% /mnt/USBDisk

:slight_smile:

@Sam_nazarko, thanks for the reply.

Nick