2

So, I am trying to shrink my partition by 32 G. I run the resize command;

╚> sudo btrfs filesystem resize -32G /
Resize device id 1 (/dev/nvme0n1p2) from 465.26GiB to 433.26GiB

And as you can see it outputs that it's been successfully shrinked from 465.26GiB to 433.26GiB.

However, checking the partition size in lsblk;

nvme0n1     259:0    0 465.8G  0 disk 
├─nvme0n1p1 259:1    0   511M  0 part /boot
└─nvme0n1p2 259:2    0 465.3G  0 part /var/log
                                      /var/cache/pacman/pkg
                                      /home
                                      /.snapshots
                                      /

As you can see it still outputs 465 gigs, and checking on tools like cfdisk, parted and so on, the partition still shows 465 gigs. I have tried rebooting already.

1
  • Compare this answer. The most important thing: partitions and filesystems are different concepts. (Side note: AFAIK Windows likes to pretend they are equivalent. If your experience is in Windows more than in *nix then I'm not surprised you may be confused.) Commented Aug 20, 2022 at 15:46

1 Answer 1

6

man btrfs filesystem explains what’s happening here:

The resize command does not manipulate the size of underlying partition. If you wish to enlarge/reduce a filesystem, you must make sure you can expand the partition before enlarging the filesystem and shrink the partition after reducing the size of the filesystem. This can done using fdisk(8) or parted(8) to delete the existing partition and recreate it with the new desired size. When recreating the partition make sure to use the same starting partition offset as before.

When you edit your partitions, you need to be absolutely sure that the new partition is large enough for the resized file system.

You must log in to answer this question.

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