I have a laptop i just occasionally use. It has opensuse tumbleweed installed and i recently updated everything. The problem I have is that my root (“/”) partition is nearly full.
The device has a 500GB nvme, 90GB are for the root btrfs partition (excluding /home).
The root partition is currently on 81GB, so i checked with
du -h -d 1 /
whats causing this and noticed non of the top level directories use more than a few hundred mb, but the one big space eater is: /.snapshots which has 185GB !!
I am sure that this amount is probably not correct because of btrfs but I am pretty sure that the snapshots are using most of the used disc space. But
snapper ls
does not show anything special, just about 5 snapshots (pre and post) most but one with a used space below 4mb, the one with a higher value uses 8gb though…
But for me that does not explain the high disc usage.
For a BTRFS system, you should use (not du or df):
btrfs filesystem usage -T /
And yes, you probably need to do a “clean-up” of past snapshots no longer required. I’ve had the same thing happen many many months ago, but cleaned out the snapshots and recovered quite a bit of space.
And if you want to provide us with the output of “…usage”, please use the Preformatted Text icon </> on the toolbar, and show the command you executed, plus the output, and the ending prompt.
@sabo007 If used infrequently the btrfs clean up services have not had a chance to run, you can’t use traditional tools with btrfs, as indicated by @aggie need to use the specific btrfs tools to get a true picture.
Over time btrfs will allocate space, but not necessarily use it. You can either as the system admin create a new time to run some minutes after booting, else just manually run the appropriate btrfs service… also check the like of journalctl --disk-usage and coredumpctl to clean up space before running btrfs maintenance.
Thank you, i will give you the output of the given commands:
goku:~ # btrfs filesystem usage -T /
Overall:
Device size: 90.45GiB
Device allocated: 90.45GiB
Device unallocated: 1.00MiB
Device missing: 0.00B
Device slack: 0.00B
Used: 85.85GiB
Free (estimated): 2.79GiB (min: 2.79GiB)
Free (statfs, df): 2.79GiB
Data ratio: 1.00
Metadata ratio: 1.00
Global reserve: 124.75MiB (used: 0.00B)
Multiple profiles: no
Data Metadata System
Id Path single single single Unallocated Total Slack
-- -------------- -------- -------- -------- ----------- -------- -----
1 /dev/nvme0n1p2 87.42GiB 3.00GiB 32.00MiB 1.00MiB 90.45GiB -
-- -------------- -------- -------- -------- ----------- -------- -----
Total 87.42GiB 3.00GiB 32.00MiB 1.00MiB 90.45GiB 0.00B
Used 84.63GiB 1.22GiB 16.00KiB
goku:~ # snapper ls
# | Type | Pre # | Date | User | Used Space |
Cleanup | Description | Userdata
------+--------+-------+--------------------------+------+------------+---------+------------------------+--------------
0 | single | | | root | |
| current |
1101* | single | | Wed Feb 16 16:21:48 2022 | root | 59.74 MiB |
| writable copy of #1099 |
1249 | pre | | Wed Mar 20 22:57:13 2024 | root | 8.37 GiB |
number | zypp(zypper) | important=yes
1250 | post | 1249 | Wed Mar 20 23:17:50 2024 | root | 3.25 MiB |
number | | important=yes
1251 | pre | | Wed Mar 20 23:18:24 2024 | root | 1.19 MiB |
number | zypp(zypper) | important=yes
1252 | post | 1251 | Wed Mar 20 23:19:09 2024 | root | 2.22 MiB |
number | | important=yes
goku:~ # btrfs subvolume list /
ID 257 gen 386220 top level 5 path var
ID 258 gen 384503 top level 5 path usr/local
ID 259 gen 386220 top level 5 path tmp
ID 260 gen 384503 top level 5 path srv
ID 261 gen 384503 top level 5 path opt
ID 262 gen 386166 top level 5 path boot/grub2/x86_64-efi
ID 263 gen 384503 top level 5 path boot/grub2/i386-pc
ID 264 gen 386193 top level 5 path .snapshots
ID 1799 gen 386215 top level 264 path .snapshots/1101/snapshot
ID 2061 gen 384539 top level 264 path .snapshots/1249/snapshot
ID 2062 gen 386152 top level 264 path .snapshots/1250/snapshot
ID 2063 gen 386157 top level 264 path .snapshots/1251/snapshot
ID 2064 gen 386163 top level 264 path .snapshots/1252/snapshot
In the past I had an issue with flatpak taking more and more disk space, at some point I’ve run flatpak repair and ~20GB were freed and since then no issue, it is worth a try in your case.
Using graphical tools like Filelight can also help investigating what is taking a lot of disk space.
Thanks for the suggestion but I’m not sure why you’re recommending installing everything user wide, from my understanding the only thing that change is the install directory ~ instead of /var so I think there’s good reasons I miss here…
In my case I had plenty of free space so it was not a big issue for me, still a bug that needed to be fixed…
I mostly keep all of my flatpak apps installed system wide because that’s how I’ve started using flatpak two years ago, not thinking much about it since I have only one user …
@Aboutduck then as in @sabo007 case, the system will be running fine with the disk space it has, then it would only be an issue for space being consumed at a user level. Plus there is no requirement to be root user to install…
I see, so if /home and /var are separate partition it is worth installing everything user wide then … not really my case plus I have plenty of free disk space but it is a good point.
I was aware of that point, not really an issue for me but still a good point, thanks for the explanation.