Disk Usage Analyser

I have limited / disk space, and due to excessively big log files from certain apps, I sometimes run out of diskspace. To solve this, I’ve redirected the log folders to a network NAS device, which works great. However when any upgrades occur to the OS or apps, they default back to the /* drive and cause out of space issues (even with ln, etc.)

Using du isn’t exactly easy, when one has extremely large network drvices at /mnt and various ln’s in the OS (even when using --exclude=).

I was looking around for a GUI Disk analyser solution and found baobab, install it and it works great as a GUI.

I was wondering if there are any other dietpi solutions around, other than du, to quickly and easily analyse disk space/usage per folder?

Thanks

Do you have a GUI or just CLI?

I did a quick duckduckgo and found this for CLI
https://www.tecmint.com/dutree-analyze-disk-usage-in-linux/

Came from this
https://www.how2shout.com/tools/best-disk-usage-analyzer-tools-for-linux-system.html

DietPi is not offering such graphical tool. But you could use a simple CLI command to get the 20 largest files.

du -a / --exclude /mnt/<whatever> | sort -n -r | head -n 20

I recommend to exclude external disk or network shares to get local files only

Use ncdu
https://dev.yorhel.nl/ncdu

To install login to DietPi
run this command
sudo apt install ncdu

3 Likes

nice…thanks

1 Like

even with “sudo ncdu” I cannot get dietpi to show my largest folders:

ncdu

but apparently my drive runs full:

ncdu 2

Just check above Disk Usage Analyser - #3 by Joulinar

1 Like

sorry for being silly:

error dietpi 2

du -a / --exclude /mnt/<whatever> | sort -n -r | head -n 20

The --exclude /mnt/<whatever> is an example of you want to exclude some folders, the < throws the error. Remove the exclude part of you don’t want to exclude anything

1 Like

You need to adjust the command on your needs as described above. There are wildcard and thinks you might remove

1 Like

that did the trick. but what do I do with the output?

error 3

I would like to know which folder is the culprit. there must be some big temp files or something messing up my install. I do not need dietpi_backup since I have the whole VM cloned (as a backup). how can I delete those 1.x GB?

Reading it from top to bottom.

It’s 3GB Docker, 3GB dietpi-backup and 1GB SWAP.

1 Like

ok, docker is needed, swap also (I guess). but backup can be deleted. can I simply uninstall it from dietpi-software?

There is nothing to uninstall. Simply delete the folder if you don’t need any backup from your system.

1 Like

I dont want to mess things up here. simply “rm /mnt/dietpi-backup” will do the trick?

rm -R /mnt/dietpi-backup
1 Like

thanks, you saved the day! as always! :wink: