System crash - space is constantly at 0%

Hello there!

I have a strange issue with my system. My system crashes quite regularly (I use sway).
But today after the crash my browser extensions were starting to fail and also other things.
So while looking after the cause I noticed that my space of my partition is at 0% at Thunar.

So I deleted some files from the terminal (could not delete directories via Thunar), but the systems space was still full (which never happened before).

OK, then I tried to boot from a stick and delete something from outside. But still the same issue, even when partition is not running, I can not free any space.

So I feared that the SSD is may defect, but the thing is I have second partition on the same SSD where the space is indeed increasing when I delete something there.

So I guess it is some partition fault.
But I do not how to fix it.

Thx for your help!

df - h gives me this paradox information, despite that there should be free space there is none at p1 partition.
image

df - i says that there are still enough i nodes.
image

Welcome to the forum! :vulcan_salute:

First things first…: Please don’t post any screenshots of terminal text, because they only take up space in the database and they cannot be copied from with the mouse.

Your terminal however can be copied from, and if you click the </> button in the toolbar of the post editor, then you will see two lines of three backticks each. Paste the copied terminal output in between the two lines, and then it’ll be neatly formatted in a readable way, like so… :backhand_index_pointing_down:

[nx-74205:/dev/pts/5][/home/aragorn]
[aragorn] >  ls -lh
total 4.0K
drwx------ 1 aragorn aragorn  42 Jan 27 09:56  Desktop
drwx------ 1 aragorn aragorn 124 Jan 27 09:56  Documents
drwx------ 1 aragorn aragorn   0 Feb 16 13:28  Downloads
-rw------- 1 aragorn aragorn 111 Jul 12  2024 'Google Drive'
drwx------ 1 aragorn aragorn 452 Feb 18 20:37  Important
drwx------ 1 aragorn aragorn 124 Feb 16 14:18  Pictures
drwx------ 1 aragorn aragorn  20 Feb 14 15:52  Screencasts
drwx------ 1 aragorn aragorn 612 Feb 16 19:45  Screenshots
drwx------ 1 aragorn aragorn 188 Feb  5 18:00  Templates

[nx-74205:/dev/pts/5][/home/aragorn]
[aragorn] > 

Now, as for your problem… :backhand_index_pointing_down:

As of Manjaro 25.0 Zetar, the default filesystem if no other option is chosen is btrfs. It is a very advanced filesystem with a built-in volume manager.

However, due to the way btrfs allocates space on the filesystem, it may sometimes appear as if your filesystem is full when it isn’t. This means that you must redistribute the chunks of data and metadata across the available space on the volume.

btrfs has a command for this, i.e. “btrfs balance”. In order to read the man page however, you need to put a hyphen in between those two words… :backhand_index_pointing_down:

man btrfs-balance

I recommend starting with a full balance, as such… :backhand_index_pointing_down:

sudo  btrfs balance start --full-balance /mountpoint/to/the/filesystem/here

You can always fine-tune things later on by playing with the different values.

There is also a package in the repos called btrfsmaintenance, with a well-documented configuration file under /etc/default. Via this file, you can set up an automatic periodic balancing of your btrfs filesystems — recommended is once per month.

Also, please read the following thread, as it may provide some additional information about btrfs. :backhand_index_pointing_down:

1 Like

Oh, I apologize next time I will not make a screenshoot.
The thing is I use the ext4 filesystem.

Well, there is always a reserved amount of space for allowing the root user to come in and perform maintenance, as well as for the working of the filesystem itself. You can tweak the amount of reserved space, but I would advise you not to mess with that.

So, then the bottom line is that you’re going to have to remove some packages, or maybe some other stuff you’ve saved on that volume.

But the thing is that the only thing I installed were updates. So how is it possible I wonder that there is this deficit in space, I mean if I am deleting stuff while booted in a live environment, should it not make some space immediately.

wouldn’t it mean that the update wrote in the root space, but normally it always tells me that there not enough space.

Do you regularly clear out the package cache? :backhand_index_pointing_down:

sudo paccache -rk0

Normally, if you update via pamac (or the pamac GUI) instead of pacman, then only the last two or three generations of packages are kept, but if you update via pacman, then those downloaded packages are never cleaned out — or at least, not automatically.

Another option — less elegant, but nevertheless just as efficient — is to delete them manually… :backhand_index_pointing_down:

sudo rm -rf /var/cache/pacman/pkg/*

It depends. If the filesystem is mounted read-only due to filesystem damage as a result from the crash, then you cannot delete things from it. But that should then normally give you an error message along the lines of “Filesystem is mounted read-only”.

1 Like

Actually I cant remember ever clearing the cache and yes I always use pacman…

But still it is quite strange that it is not giving me free space at the live environment.

What is the output of… :backhand_index_pointing_down:

mount | grep nvme0n1

…?

Either way, try removing the cached packages first, as explained above.

1 Like
/dev/nvme0n1p4 on /run/media/manjaro/endeavouros type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)
/dev/nvme0n1p1 on /run/media/manjaro/7bea7880... type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)

Endeavour OS, eh? :face_with_raised_eyebrow:

Anyway, the command to clean out the packages would then be… :backhand_index_pointing_down:

sudo rm -rf /run/media/manjaro/endeavouros/var/cache/pacman/pkg/*
1 Like

Well, I wanted to try out endeavour OS some years ago but it broke quite fast, now it is just a second partition. :upside_down_face:

But shouldn’t sudo paccache -rk2 be enough. I mean I can still boot the system.

Well you obviously need more space on your drive, so best clean out that cache. Besides, there’s another Stable Update on the way already. :backhand_index_pointing_down:

I mean I am not using endeavouros, but thank you very much I have now more then 20gb free!
Actually there were still cache from 2024 there and I don’t even have pacchace…

2 Likes

It’s in the pacman-contrib package, which is not installed by default. :wink: :backhand_index_pointing_down:

[nx-74205:/dev/pts/5][/home/aragorn]
[aragorn] >  pacman -Qo /usr/bin/paccache
/usr/bin/paccache is owned by pacman-contrib 1.13.1-1

[nx-74205:/dev/pts/5][/home/aragorn]
[aragorn] >  
2 Likes

I would think this is pretty overkill. One of the massive strengths of btrfs is that you usually don’t need to rebalance everything. Targeted balances (using -dusage or -musage) let you quickly balance any major allocation issues, without rewriting the entire filesystem. A full balance makes can make sense for device reshuffling, RAID changes, and other things. But for most routine maintenance, it’s just unnecessary I/O.

I usually start with lower numbers, like 50:

sudo btrfs balance start / -dusage=50 -musage=50

Here’s running it with higher and higher numbers..

Note that running it with lower numbers prior, does make substantial balances shorter too. But the higher you raise it, it will take much longer, relatively, as you approach 100.

time sudo btrfs balance start / -dusage=50 -musage=50                                                                                                                                              Done, had to relocate 2 out of 119 chunks
sudo btrfs balance start / -dusage=50 -musage=50  0.00s user 0.01s system 0% cpu 1.805 total
time sudo btrfs balance start / -dusage=75 -musage=75
Done, had to relocate 4 out of 119 chunks
sudo btrfs balance start / -dusage=75 -musage=75  0.00s user 0.01s system 0% cpu 3.807 total
time sudo btrfs balance start / -dusage=80 -musage=80                                                                                           
Done, had to relocate 5 out of 119 chunks
sudo btrfs balance start / -dusage=85 -musage=85  0.00s user 0.01s system 0% cpu 6.344 total
time sudo btrfs balance start / -dusage=90 -musage=90
Done, had to relocate 6 out of 120 chunks
sudo btrfs balance start / -dusage=90 -musage=90  0.01s user 0.01s system 0% cpu 23.103 total
time sudo btrfs balance start / --full-balance
Done, had to relocate 120 out of 120 chunks
sudo btrfs balance start / --full-balance  0.00s user 0.03s system 0% cpu 46:51.01 total

TLDR: Usually a few seconds vs –full-balance taking many minutes (hours on bigger or slower drives)..

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.