swap file unsuitable for btrfs

Bug #1884161 reported by ov2k
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
Fix Released
Undecided
Unassigned
subiquity
Fix Released
Undecided
Unassigned

Bug Description

There is a corresponding ubiquity bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1818811

To summarize, installing Ubuntu 20.04 LTS to a btrfs filesystem causes systemd to report a degraded system. Installation proceeds without error, but the swap file fails to activate.

In general, swap files need to be carefully configured on btrfs. The requirements, as far as I know:

1. linux kernel >5
2. single device btrfs volume
3. copy-on-write disabled on the swap file
4. compression disabled on the swap file
5. no snapshots of the subvolume containing the swap file

On a clean install of Ubuntu 20.04 LTS, I believe 1, 4, and 5 are guaranteed. I think 2 is currently guaranteed because subiquity can't configure a multi-device btrfs volume, and Ubuntu doesn't by default boot from such a volume without some extra tweaking. The main issue is 3.

There is a fix of sorts described in the ubiquity bug, although permissions should also be fixed and the swap file also needs to be initialized:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1818811/comments/7

That fix is probably suitable for the way subiquity currently operates. It might not be appropriate if subiquity allows more complicated btrfs configurations. There's probably a conversation to be had at some point about btrfs support in general.

Related branches

Revision history for this message
ov2k (ov2k) wrote :

To be clear, recreating the swap file with copy-on-write disabled allows the swap file to function as expected and causes systemd to report a properly running system.

Ryan Harper (raharper)
Changed in curtin:
status: New → In Progress
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit f1bf44f9 to curtin on branch master.
To view that commit see the following URL:
https://git.launchpad.net/curtin/commit/?id=f1bf44f9

Changed in curtin:
status: In Progress → Fix Committed
ov2k (ov2k)
Changed in curtin:
status: Fix Committed → Fix Released
Changed in subiquity:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.