Discrepancy between free space reported by disks tool and other programs

I have a weird issue where tools like Disks or Gparted say i have 46GB free space available on my ext4 partition but any other program that can write to disk reports i have just 8GB of free space. All that is after i just removed a folder containing 20GB of data. Yes, i emptied trash. Here is a screenshot as a proof of what i’m experiencing at the moment:

Ubuntu budgie 20.04.3.

So far i did basically all things described in this guide:
https://ubuntuforums.org/showthread.php?t=1122670
Problem still occurs.

Could it be that your /home/$USER targets another partition than sda5 ?
Or just that Videos folder ?

lsblk -fe7 -o +size

cat /etc/fstab

First command will give a view of all disks, partitions and their mountpoints ( amongst other useful infos ). Make your terminal window wider before issuing that command, as its output is a quite large table.

Second will show partitions that are automatically mounted at your system boot.


Here is an output of both commands.

Gnome-Disks is showing actual disk space used, whereas nemo etc is showing space excluding reserved space.

Ext4 reserves around 5% for its own and root usage… so if my maths is correct is about 35 gigabytes … and then you have about 11 gigabytes avail for your own usage. Nemo is showing I think in a slightly different metric gibibyte.

Anyway … both are basically saying you are about to run out … so time to clear out the things you don’t ever use!

But i use them all… :slight_smile: Ok, thanks for clarification, kinda. Then i’m still wondering how is it possible that after removing that 20GB folder i have just 8GB of free space available.

Obviously no separate partition for /home so my assumption fails.

There is a very precious and convenient tool to help finding ( and removing ) heavy folders or files :

ncdu

It’s a semi-graphical application that runs inside terminal and which you control using ←↑→↓ and some other keys. See https://computingforgeeks.com/ncdu-analyze-disk-usage-in-linux-with-ncdu/ or 10 Cool Command Line Apps for Ubuntu - OMG! Ubuntu! ( 8th § )

Did you try the « common » cleaning operations ?

# being up to date and without un-necessary cache or achive regarding apt

sudo apt update ; sudo apt full-upgrade ; sudo apt autoremove --purge

sudo apt autoclean ; sudo apt clean

# if you make use of snap applications
snap list --all

snap list --all | awk '/désactivé|disabled/{print $1, $3}' | while read snapname revision; do sudo snap remove "$snapname" --revision="$revision"; done
# here « désactivé » is the french word for « disabled », you should adjust to your language from what you find in the first list.

# residual installation of packages
dpkg -l | grep ^rc

sudo dpkg -P $(dpkg -l | awk '/^rc/{print $2}')
# or
dpkg -l | grep ^rc | cut -d' ' -f3 | xargs sudo dpkg -P

# cache for pictures thumbnails
find ~/.cache/thumbnails -type f -atime +7 -delete
# here the +7 means files older than 7 days will get deleted.

There may be some other tricks regarding logs and journal.

1 Like

Disk Usage Analyzer (aka baobab) is fully graphical. :slightly_smiling_face:

Also, in the continuation of your answer, cleaning rotating journals of systemd is an unknown gem to recover some space. And maybe Bleachbit.

I think ncdu is much more easier to use than baobab.
It shows at a glance which folders are heavily occupied, and immediately gives ability to delete things if needed.
Baobab is nice but much more « slower » to use ; ncdu is « almost » graphical but inside terminal.

Bleachbit is interesting but might be dangerous if you’re not sure of the meaning of items it lists.
( + some years ago had some very annoying bugs - nowadays seem fixed ).
As any other « cleaning » tool, must be used with caution and wisdom :wink:

Well, I don’t see what is not “at a glance” in Disk Usage Analyzer, it’s very visual. And I’ll prefer a GUI to obscure terminal commands whenever it is powerful enough to get the same result. Plus, you can also move folders to the trash from within the app.
Anyway, that’s not the topic.
Regarding Bleachbit, you have to know what you’re doing, I second you on that.
Fortunately, if you run the user part (and not the admin part), you can at least free some space on your /home with very little impact on your system, as it is not very risky (at worst you’ll lose some app config, or need to log in back to your favorite websites after removing cookies). If you run it as admin, it’s a different story. Obviously.

Well, ncdu is not an obscure terminal command, it’s a GUI inside the terminal ( or console, which can be very helpful when unable to launch a graphical session ). Fast. Light on resource ( which matters when dealing with busy storage ). And straightforward, it does few things but does it easy.

It’s obviously not pretty but efficient for that matter : find « heavy » folders and eventually delete obsolete items.