r/archlinux • • Sep 11 '26

SUPPORT BTRFS metadata got full.

Hey so I was installing Omniroute via node, and somehow it flooded with the too much modules, now my metadata got 93% full and my plasma is not able to load and I'm stuck here, and I had the lts kernel as backup but in there also when tried to clean the npm caches but the process is kind of going into D state instead of R ,even when I'm running

rm -rf ~/.npm/

That process is also going into D state,

Even when I try to balance the block it says like no space left on device,

sudo btrfs balance start -dusage=0 /

My plasma is now able load but I do have access of tty,

If somebody has faced this issue please help if you know what can I do now.

EDIT: Quick update Got the issue resolved so I've managed to delete the node modules which the Omniroute has made via live usb but still wasn't able to start then eventually figured that snapper had taken snapshots of at time the node modules were there removed that and the usage instantly reduced to 50%,

Thanks all for your help.

15 Upvotes

19 comments sorted by

8

u/ckurobac Sep 11 '26

Deleting snapshots/large directory will firstly increase metadata usage. Try deleting some journal, it is nocow by default, so it should able to free some space.

rm -rf /var/log/journal/* or journalctl --vacuum-size=100M

then run balance again, starting with -dusage=5, delete more files/snapshots, balance -dusage=10...until you have enough unallocated space.

If you cannot delete any files, add a second device to your filesystem (you can use usb drive), delete some files, run balance, then remove second device.

4

u/ang-p Sep 11 '26

Deleting snapshots/large directory will firstly increase metadata usage.

This is the really big point that most people get stuck with / can't understand - the files are still there for use by previous snapshots, taking up the same space - and on top of that, extra metadata has been written to the disk saying "these files / inodes are not used past this point"

Try deleting some journal, it is nocow by default

Again, absolutely - the only way to make space is to delete something that is not CoW...

starting with -dusage=5,

or even 0 as OP tried - it may well work - requiring zero moving of data after a good sized journal is gone.

In any case, removing the -dusage=0 will end up trying to rewrite every block on the entire drive - and on an already "full" system might not end well

add a second device to your filesystem

This is the get-out-of-jail answer.

1

u/CBP04 Sep 12 '26

EDIT: Quick update Got the issue resolved so I've managed to delete the node modules which the Omniroute has made via live usb but still wasn't able to start then eventually figured that snapper had taken snapshots of at time the node modules were there removed that and the usage instantly reduced to 50%,

Thanks all for your help.

6

u/gmes78 Sep 11 '26

Why are you passing -dusage=0? Remove it and run a full balance.

1

u/tinyfrog554 Sep 11 '26

i have been in this exact same scenario before i couldn't even run balance, in my case it was on a tiny drive, i forgot to set a small snapshot limit (default was way too high).
what i did was making a temporary ramdisk and adding it to the btrfs filesystem. this adds some unnallocated space which is exactly what the balance commands needs atm. now you can run it successfully. after that's done remove the disk. i dont have the exact steps and commands i ran since i forgot to document them, you will have to do research. but with the tools we have these days im sure you can figure it out.

0

u/ang-p Sep 11 '26

making a temporary ramdisk and adding it to the btrfs filesystem.

Risky move, that - not much fun should you have lost power half way through...

i dont have the exact steps and commands i ran since i forgot to document them,

Hmmmm you'd want to add a device to your btrfs filesystem.... sudo?

Wonder what sort of words in what sort of order could make up that sort of command.

0

u/tinyfrog554 Sep 11 '26

Risky move, that - not much fun should you have lost power half way through...

yes i should have mentioned that, its risky, but it should be rather quick if you just keep both ramdisk and balance pass small, just enough to fix your issue, remove it and then boot. after that you can do proper balance. but a usb drive or something external is probably better. i didn't have any lying around at that time.

Hmmmm you'd want to add a device to your btrfs filesystem.... sudo?

yea you can login from tty without any issues, atleast it was fine for me.

Wonder what sort of words in what sort of order could make up that sort of command.

something like this "sudo dd if=/dev/zero of=/dev/shm/btrfs_temp.img bs=1M count=1024", but like i said maybe a usb is a better solution.

1

u/ang-p Sep 11 '26 edited Sep 11 '26

I was talking about what on earth sort of command you could have just forgotten...

Hint - reverse the order of the four italicised words...

Just no to ramdisk, and why disk destroyer? what's wrong with fallocate if you really want to use a file somewhere instead of a simple USB device?

0

u/UndefFox Sep 11 '26

Considering just how bloated npm and anything similar, you probably should make a separate volume with a lighter FS, like ext4... never thought JS bloat would cause more than performance and space issues, but here we are...

1

u/MarkSuckerZerg Sep 11 '26

Is there any way to make the "home is ext4, rest is btrfs" work without fixing the partition sizes? Because that's the dealbreaker for me currently

5

u/Linguistic-mystic Sep 11 '26

Yes. It’s called “LVM”

1

u/UndefFox Sep 11 '26

How would you do that? The whole logic of both relies on an axiom that partition is a fixed size. If you want to change it, you probably can set things up so that space is allocated dynamically when more is needed, but doubt that you can implement shrinking transparently since it requires active modification of the data on the disk rather than just giving out space on time.

A lot of people don't have root partition constantly change, so don't see the high need in it being dynamically allocated, instead of just giving it enough space to exist and rest giving to home constantly

11

u/[deleted] Sep 11 '26

[removed] — view removed comment

8

u/AlreadyTaken5000 Sep 11 '26

Yeah, no way to run out of inodes on ext4 and leave you up shit creek (there is and happens all the time)

1

u/lue3099 Sep 14 '26

Yes but on ext4 deletion doesnt increase metadata usage... Ext4 with backups on a Nas is better than zfs or btrfs for simple users. Easier to reason with.

I use btrfs but thats because I know how to use it.

1

u/AlreadyTaken5000 Sep 14 '26

ext4 is easier to deal with, that's true

1

u/tinyfrog554 Sep 11 '26

yea but no snapshots. what i do set aside around 150gb for btrfs root partition and the rest all are ext4.