a) What happend
b) What to do to repair
c) What to do, to not get out of space again
a) What happend
btrfs is able to list all snapshots/subvolumes
Either use timeshift or use snapper. Don´t use them at the same time together
Defrag with btrfs is no solution for “no space left”. It will only get worse !
There is a simple solution (in the wiki)
care to share in this thread without linking to a page
It’s actually a very informative page on btrfs - better than most I have seen.
Oh for sure! i have imidiatly bookmarked it
If the snapshot take space, you can check them like that:
export UUID=$(findmnt -n -o UUID /) export MNTPNT=$(mktemp -d -t "btrfs.XXX") sudo mount -m -U "$UUID" "$MNTPNT" for x in $(sudo btrfs subvolume list "$MNTPNT" | cut -d' ' -f9); do echo ">>> Subvolume: $x" sudo btrfs filesystem du -s "$MNTPNT/$x" done sudo umount "$MNTPNT"
And a one-liner:
export UUID=$(findmnt -n -o UUID /); export MNTPNT=$(mktemp -d -t "btrfs.XXX"); sudo mount -m -U "$UUID" "$MNTPNT"; sleep 3 && for x in $(sudo btrfs subvolume list "$MNTPNT" | cut -d' ' -f9); do echo ">>> Subvolume: $x"; sudo btrfs filesystem du -s "$MNTPNT/$x"; sleep 3; done && sudo umount "$MNTPNT"
after terminal crashed while performing “sudo du --human-readable /tmp/bare_btrfs_root/timeshift-btrfs | xclip -selection clipboard” I decided to delete all my snapshots (just 4 total) and now free space is increasing somehow!
I am not sure if will be what I expect but at least something is happening here…
Please for the sake of our mental states, drop the
umount and change them to
I am sorry, but what?
do you mean to mount my external drive somewhere else?
Ok my brains just crashed now…
No. This is to komplex for an easy …
You have to know why btrfs acts this way to pervent it in the future. This is only doable after reading some stuff. Without reading the wiki or the btrfs-homepage someone may make things worse to a point where he seems to have no way out.
If you understand what happened, you will find your way out by yourself !
I am now at 395 GB free space.
Please do not ask me, how this is possible by just 4 snapshots not including the /home folder…
No, it mounts the toplevel of your btrfs partition and checks the subvolume sizes.
In reply to your question mark emote, see:
It doesn’t matter how many snapshots you have. A large number does not necessarily need a lot of space.
Rather, it is the age of the snapshots that plays a role (because then there are many files in them that have changed in the meantime)
It is often very helpful to delete first only the oldest snapshot.
Btrfs needs some time to clean up after deleting snapshots. Meanwhile, more and more space is slowly being displayed as free. You can watch this as root with “watch btrfs usage …” in a terminal.
And it is possible to have 500GB Data on a btrfs-partition with 400GB, and even have 150GB unallocated (when compression is on)
the oldest one was dated nov 17th 22 and I did not make many changes on my system since that
I’d really love to understand this mess but for now I am glad it is solved
thanks to everybody for helping me today!
Look the similar issue:
You can exclude some data from home snapshot:
- Downloads and ISO
- VM images
- public data, it exists everywhere in internet.
- (Home cache)
For those intrigued about the reason:
I think it’s because of the normal operating mode of
rsync which does a “create temp file and rename over the old original” which uses new space on the disk, while the btrfs way uses hard-links IIRC…
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.