this post was submitted on 06 Jun 2024
37 points (86.3% liked)
Linux
48185 readers
1175 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you're using btrfs then you might need to rebalance it. I had the same problem, i.e. "no free space" while tools like df reporting that there should be available disk space, and it confused the hell out of me until I found the solution.
See manual: https://btrfs.readthedocs.io/en/latest/Balance.html
This are the commands I run every now and then, especially if my drive has been close to full and I delete a bunch of files to make more space:
The
/
at the end is the path, since it's my root mount which uses btrfs. The example in the manual does 40 and 50 too, but higher numbers take longer time, even on an nvme ssd.That's what I got in the end after I was able to use the command you gave me. I don't know if it helped or not. I just hope the problem I had is gone for good.
That output means that it did something, but I suspect there's a risk the same thing could happen in the future. I run this command every now and then in an attempt to avoid fragmentation, especially if the disk has been close to full, but I'm not entirely sure what's causing it to happen in the first place.
What does balance do in that context? As I understand unless the volume spans multiple drives or the files were so numerous and small that metadata was a significant portion of their disk usage, rebalancing will only unallocate data chunks just for them to be allocated again when that space gets used.
Unless the program you're using is wrongly checking unallocated space instead of free space, it shouldn't really affect disk usage
Edit: It might help with trim and make the drive faster though. But you're also putting a bunch of unnecessary wear on it so it might not be worth it
Don't know that much about how btrfs works, just had a problem with the same symptoms as OP a while ago.. Things started failing due to "no space left on device" despite df reporting several gigabytes available. Took a while to figure out what was going on but eventually found some stackoverflow/reddit post that told me to run the balance command and it worked. Just a single drive with btrfs, no raid.
That's what I'm getting when I'm trying to run the command
If you have snapshots delete some of them. Deleting things won't get you disk space if there are snapshots of them.
I don't think I have any snapshots, or at least I've never created them voluntarly
You can check with
sudo btrfs subvolume list /
Here is the result. I doesn't look like I have any