5

After shrinking a BTRFS file system using "btrfs filesystem resize /mnt -20g", this space doesn't show up as free for allocation in GParted. It doesn't seem like GParted can resize the btrfs partition on its own either. Rebooting doesn't help.

The various ways to check freespace on a btrfs volume https://btrfs.wiki.kernel.org/index.php/FAQ#Why_are_there_so_many_ways_to_check_the_amount_of_free_space.3F do show that the total space has shrunk by 20 GB.

How can I reclaim this space to use for another new partition on the hard disk?

1 Answer 1

3

Thanks to help from cwillu and mig at freenode, I figured out the solution. The btrfs filesystem resize command just like resize2fs resizes the filesystem, but keeps the partition limits unchanged. These can be changed using the fdisk to delete the btrfs partition and then recreating it with an endpoint which is slighty less than 20Gb smaller than the current endpoint, since the freespace is at the end. Run btrfsck to ensure everything is fine, otherwise revert back to the previous partition table. There are many tutorials on the web on this process.

2
  • 1
    "Many"? Sadly, I can't find any relevant ones. Jun 9, 2020 at 11:45
  • Me neither. A helpful link would be nice. Feb 26, 2022 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .