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

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
avr
Posts: 11
Joined: Thu Apr 05, 2018 7:35 pm

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

Post by avr »

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
Attachments
df
df
ncdu
ncdu
User avatar
WarHawk
Posts: 606
Joined: Thu Jul 20, 2017 8:55 am

Re: Running out of disk space and don't know why

Post by WarHawk »

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/li ... hard-disk/

Code: Select all

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
wdt
Posts: 17
Joined: Wed Aug 22, 2018 8:20 am

Re: Running out of disk space and don't know why

Post by wdt »

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!
avr
Posts: 11
Joined: Thu Apr 05, 2018 7:35 pm

Re: Running out of disk space and don't know why

Post by avr »

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
https://serverfault.com/questions/27520 ... nvestigate
Post Reply