[Solved] Running out of disk space and don't know why

Hi,

My dietpi installation is running out of disk space and I don’t know why.

According to the “du” and “ncdu” commands I’m only using 3.56G out of 12G as seen on the screenshot.
But running df -h it says 11G are being used.

Important things that may help locate the problem:

  • It’s a 9 months old installation on a Odroid HC1 running plex, transmission, sonarr and other services.


  • Dietpi is bieng booted from an SSD with two partitions. One of 12G for the filesystem (the one with the problem).

I read another case where transmission would be the problem filling up space on the booting drive. I don’t know if this can be the case as my booting and data drive is the same SSD, just a different partition.

Any help or idea would be appreciated.

Regards,
Abraham


It’s your /dev/sda1 that is filling up

do a df -h and du -h on the /dev/sda1 partition and see which directory is using the most space…then figure out what is writing to that space…and figure out how to either blow out the un-needed files, and/or create a cron job to clean it up for you

Perhaps the PLEX database or something like that is on the /dev/sda1 partition…

Definitely need to dig deeper into what exactly is filling up the drive

Just be careful using root and deleting large block of files
https://www.cyberciti.biz/datacenter/linux-unix-bsd-osx-cannot-write-to-hard-disk/

Find out the largest directories or files eating disk space on a Unix-like systesm:

du -a /dev/sda1 | sort -n -r | head -n 10
du -cks * | sort -rn | head

Something is definitely filling up the drive…and not cleaning up after itself…
Where is your PLEX writing it’s “transcode” files?
/var/tmp?
Per the PLEX site…most linux flavors store em here
$PLEX_HOME/Library/Application Support/Plex Media Server/Cache/Transcode/Sync/

I changed mine to /tmp…so a cronjob will blow em out eventually
Found a program called tmpreaper…that might also blow out /tmp directory as needed

ncdu makes it easy (new curses) , starts in the directory you invoke it,
with the current users rights, su (or sudo) for full power, carefull !!!
It does take a while to scan all files before it starts (if there are many)

NEAT!
https://dev.yorhel.nl/ncdu

sudo apt-get install ncdu

Done…thanks!

Thank you so much to both of you for your replies.

It turned out I had files located under mount points. I found out this on a stackoverflow thread

Frequently if you mount a directory (say a sambafs) onto a filesystem that already had a file or directories under it, you lose the ability to see those files, but they’re still consuming space on the underlying disk.

This is why du and df were telling me different results.

Here’s how I solved it.

On Linux you can easily remount the whole root partition (or any other partition for that matter) to another place in you filesystem say /mnt for example, just issue a

mount -o bind / /mnt
then you can do a

du -h /mnt
and see what uses up your space.

This is the original thread

Hi, I have similar issue but I cannot execute any command:
dietpi@DietPi:~$ du -a /mnt | sort -n -r | head -n 10

There’s no output. Even if I want to enter folder I cannot.

Edit. I try to delete not used app folder but cannot:

sudo rm -rf /var/opt/nextpvr/
dietpi@DietPi:~/homepage$ Failed to write to log, write /home/dietpi/.hishtory/hishtory.log: no space left on device
Failed to write to log, write /home/dietpi/.hishtory/hishtory.log: no space left on device
Failed to write to log, write /home/dietpi/.hishtory/hishtory.log: no space left on device
Failed to write to log, write /home/dietpi/.hishtory/hishtory.log: no space left on device
2023/04/03 15:13:21 hishtory v0.206 fatal error at github.com/ddworken/hishtory/client/cmd/saveHistoryEntry.go:24: failed to retrieve history entries that haven't been uploaded yet: DB query error: disk I/O error (4874)
dietpi@DietPi:~/homepage$ df -h
System plików   rozm. użyte dost. %uż. zamont. na
udev             7,8G     0  7,8G   0% /dev
tmpfs            1,6G  158M  1,4G  10% /run
/dev/sda1        235G  223G     0 100% /
tmpfs            7,8G   12K  7,8G   1% /dev/shm
tmpfs            5,0M  4,0K  5,0M   1% /run/lock
tmpfs             50M  408K   50M   1% /var/log
tmpfs            4,9G  1,1M  4,9G   1% /tmp
/dev/sdd1        7,3T  3,1T  3,9T  45% /mnt/skyhawk
/dev/sdc         2,7T  1,2T  1,4T  46% /mnt/Toshiba
/dev/sdb1        5,5T  2,4T  3,1T  44% /mnt/Seagate
//192.168.0.1/G  932G  333G  599G  36% /mnt/samba
tmpfs            1,6G     0  1,6G   0% /run/user/1000

What else I can do?

Your whole rootFS is completely full. Did you tried to reboot? And how long you are waiting on the command to search large files? Because your whole HDD needs to be searched. This could take a while.

I wait few minutes now and nothing happen. I’m afraid rebooting because it could not wake. Can You tell me what folders I can delete because I noticed that in dietpi-dashboard I can delete and run commands.

Regards.

OK, I find with ncdu. That are emby transcoding folder:
/var/lib/emby/transcoding-temp/

Regards

No more disk space: How can I find what is taking up the space? - Ask Ubuntu

linux - Finding files that use the most disk space - Unix & Linux Stack Exchange