1

Topic: gparted failing to shrink btrfs partition ubuntu 22.04 and live iso

error:
Resize device id 1 (/dev/nvme0n1p10) from 50.28GiB to 30.37GiB
ERROR: unable to resize '/tmp/gparted-isTrBq': Read-only file system

Why is gparted mounting this as RO?  Presumably if it mounted it as RW, this wouldn't be a problem.  Partition doesn't show up in fstab, there's no reason that it was marked RO in the system, it isn't mounted.

2

Re: gparted failing to shrink btrfs partition ubuntu 22.04 and live iso

iconoclasthero wrote:

error:
Resize device id 1 (/dev/nvme0n1p10) from 50.28GiB to 30.37GiB
ERROR: unable to resize '/tmp/gparted-isTrBq': Read-only file system

Why is gparted mounting this as RO?  Presumably if it mounted it as RW, this wouldn't be a problem.  Partition doesn't show up in fstab, there's no reason that it was marked RO in the system, it isn't mounted.

FWIW, i just deleted a bunch of stuff from that partition which i mounted via `$ sudo mount ... ` so there's really nothing on the file system preventing it from being mounted RW.

3

Re: gparted failing to shrink btrfs partition ubuntu 22.04 and live iso

GParted doesn't specify read-only when mounting a btrfs file system in order to resize it.  From a test I just performed of a successful shrinking an unmounted btrfs file system GParted operation results reported that it did the following:

+ Shrink /dev/sdb1 from 2.00 GiB to 1.00 GiB
  + calibrate /dev/sdb1
  + check filesystem on /dev/sdb1 for errors and (if possible) fix them
  + shrink filesystem
    + mkdir -v /tmp/gparted-Pzak2l
    + mount -v -t btrfs '/dev/sdb1' '/tmp/gparted-Pzak2l'
    + btrfs filesystem resize 1:1048576K '/tmp/gparted-Pzak2l'
    + umount -v '/tmp/gparted-Pzak2l'
    + rmdir -v /tmp/gparted-Pzak2l
  + shrink partition from 2.00 GiB to 1.00 GiB

Please repeat, press [Save Details] and copy the content of the saved gparted_details.htm here so I can see what GParted did in your case.