It's difficult to reformat a btrfs partition/subvolume in the installer

Problem

In the Fedora installer (Anaconda), it’s sometimes difficult and sometimes impossible to reformat a Btrfs partition or its subvolumes. This affects both the older “Custom” and “Advanced Custom (Blivet-GUI)” storage configuration dialogs. There are noticeable improvements, but still some issue even in the modern “webUI” interface.

Note: This only affects people who want to have precise control over into where exactly the installer installs the system. If you’re OK with creating new partitions as the installer sees fit (and optionally deleting some old partitions to make space), you’re not affected by this problem.

Cause

The support for Btrfs in the installer hasn’t been brought to the same level as support for other partition types, yet. Improvements are planned in future versions of the installer.

Related Issues

Bugzilla report: 2189899 – Blivet-GUI: A btrfs partition can't be reformatted
Bugzilla report: 2186158 – Custom partitioning: A btrfs partition can't be reformatted and a subvolume removal fails
Bugzilla report: 2406198 – WebUI: org.fedoraproject.Anaconda.Error: 'NoneType' object has no attribute 'path' - when btrfs subvolume gets recreated while having nested subvolumes

Workarounds

Goal A: Reformat a subvolume

The most common use case for reformatting a subvolume is to re-use a previous root subvolume (mounted at /) of a previous OS installation, again as the / mount point of the new Fedora installation.

This is currently not possible neither in Custom nor in Blivet-GUI storage configuration - the installer demands that it must be reformatted, but it doesn’t allow it to be reformatted. The workaround is to remove the subvolume first and then create a fresh new one, which can be marked for reformatting. (You don’t need to remove the old one, but then the new one must be named differently).

In the webUI interface, it is possible to “reformat” it (which means removing and creating a new subvolume) in the “Mount point assignment” section, but at least in Fedora 43, it is affected by a bug. Or Storage Editor can be used to manually remove and create the subvolumes.

Option A1) Using Custom configuration

Make sure the default partitioning scheme drop-down list under New Fedora Installation is set to Btrfs. Now locate the intended subvolume. Make sure there are still other subvolumes under this btrfs volume (if your intended subvolume is the only one, Custom partitioning can’t be used - the whole partition will disappear if you remove this subvolume). Remove this subvolume. Click the + button to add a new mount point, it should be automatically created as a new subvolume of your btrfs volume.

Option A2) Using Blivet-GUI configuration

Go to Btrfs Volumes, find the intended subvolume. Delete it (if it has any subvolumes underneath itself, those need to be deleted first), and then create a new subvolume of the same name and the intended mount point. (Alternatively, you don’t need to delete the old subvolume, but the new one needs to have a different name).

Option A3) Using the webUI interface

Go to Mount point assignment section and select your desired subvolume and its mountpoint, and mark it to be reformatted. However, in Fedora 43, due to a bug, you need to follow this guide if your selected subvolume contains any nested subvolumes. You can also see the workaround steps in this problem description for a general approach of reusing the /home partition (the problem in question is not relevant here, just the steps taken).

You can also go to the Storage Editor (accessible from three dots menu in top right corner in the installer), and manually delete a subvolume, re-create it, and assign a mount point.

Goal B: Reformat the whole btrfs partition

You might want to reformat the whole btrfs partition, e.g. to create a fresh new btrfs filesystem, or to change it to a different filesystem (like ext4), but keep the actual partition location and size intact (i.e. not delete the partition and create a new one). This is currently not possible neither in Custom nor in Blivet-GUI storage configuration. It is working as expected in the webUI interface.

Option B1) Remove and re-create the partition

If acceptable, you can remove and then re-create the partition in the roughly same location and size as before. This is best done in Blivet-GUI, in order to have precise control over the location.

Option B2) Use a different tool beforehand

You can use a different tool beforehand to customize the disk to your liking, and then use the installer just to assign mount points to existing partitions. You’ll probably want to boot a Live image (Fedora or some other) and then run one of popular disk partitioning editors. Those include GParted (available in Fedora repositories), GNOME Disks (available on Fedora Workstation Live image) and KDE Partitioning Manager (available on Fedora KDE Live image, but it can’t reformat a partition, only remove and create a new one).

Option B3) Use the webUI interface

In the webUI interface, simply go to the Storage Editor (accessible from three dots menu in top right corner in the installer), pop up the partition menu and reformat it to anything needed.


You can discuss this issue here.

1 Like