Disk usage in Silverblue

I’ve been using Silverblue for some years and I’m happy with it.
One of the main issues I have is disk space. I have a 10 year old laptop with one 237GB SSD disk. I use many flatpak apps and SDK to build them.

I’m trying to understand what is taking more space. As Baobab flatpak cannot read the root directory, I must use df and du.

First, some basic information:

# fdisk -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG SSD PM83
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: gpt
Disk identifier: 4EBCA452-6855-45D3-A98B-40BCAC9BAD46

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1230847   1228800   600M EFI System
/dev/sda2  1230848   3327999   2097152     1G Linux filesystem
/dev/sda3  3328000 500117503 496789504 236.9G Linux filesystem


Disk /dev/zram0: 7.62 GiB, 8180989952 bytes, 1997312 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       237G  222G   15G  94% /

Let’s check which directories use more space:

# du -h --max-depth=1 /
166M	/boot
0	/dev
0	/proc
9.9M	/run
0	/sys
34G	/sysroot
16K	/tmp
0	/usr
235G	/var
47M	/etc
269G	/

/sysroot is 34G. Interesting. Actually it’s all in /sysroot/ostree:

# du -h --max-depth=1 /sysroot/ostree/
4.4G	/sysroot/ostree/repo
30G	/sysroot/ostree/deploy
8.0K	/sysroot/ostree/boot.1.1
34G	/sysroot/ostree/

Which data are in /sysroot/ostree/deploy? 30G is a lot!

And now the real question. If I check the data used by my home in Nautilus it says 45.8GB. However, look at this command:

# du -h --max-depth=1 /var
1.1G	/var/tmp
27G	/var/lib
753M	/var/log
225G	/var/home
17M	/var/roothome
142M	/var/opt
0	/var/srv
13M	/var/usrlocal
0	/var/mnt
16M	/var/spool
608M	/var/cache
0	/var/adm
0	/var/db
0	/var/empty
0	/var/ftp
0	/var/games
0	/var/local
0	/var/nis
0	/var/preserve
0	/var/yp
7.9M	/var/www
0	/var/kerberos
254G	/var

/var/home is 225G?!? This must be wrong.

I cannot understand how 222GB out of 237G have been used.

That’s where your root deployments are stored - the read-only portions of the OS. One for each deployment you have (the options you’re given in GRUB). 30GB sounds reasonable.

It’s hard to tell you what’s taking up space since we don’t have access to it. But it seems that you have a lot in your home so I’d start looking there.

Indeed, I’ve started clearing my home.
These are the biggest directories (sudo is needed to read all subdirs of ~/.local/share/containers):

$ sudo du -h --max-depth=1 ~ | sort -h
[...]
286M	/var/home/fede/.mozilla
379M	/var/home/fede/.ccache
1.4G	/var/home/fede/.wine
1.7G	/var/home/fede/.cache
2.8G	/var/home/fede/Videos
2.9G	/var/home/fede/Downloads
7.4G	/var/home/fede/Documents
12G	/var/home/fede/android-backup
15G	/var/home/fede/src
19G	/var/home/fede/.local
154G	/var/home/fede/.var
215G	/var/home/fede

I’m curious to know why Nautilus is seeing something different (36G vs 215G):

I found the “big” file. I’t s a windows qemu image used by Boxes:

$ qemu-img info win10 
image: win10
file format: qcow2
virtual size: 65.1 GiB (69897651712 bytes)
disk size: 135 GiB

I’ve deleted that image.
Now du shows 81G used for my home, while Nautilus keeps showing 35.9 GB despite the big file I’ve just deleted. It looks like a Nautilus bug.

You possibly created that VM disk image as a sparse file. Some tools show the used space and others show the maximum size with sparse files

I’m not very familiar with Nautlius, but it seems it only counts visible files. If you only count the directories not starting with a dot, you come to approximately the value Nautilus shows.

I would guess this is a setting in Nautilus, but I don’t know that.

What were you expecting nautilus to tell you.
There is a setting button that allows nautilus to display all files, including the “hidden” ones whose name begins with a “.” (dot), but by default that is off.

Nautilus cannot look into the system directories that are not user readable where from the command line you can use ‘sudo’ and see everything everywhere.