swap file unsuitable for btrfs
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:/
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:/
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
- Server Team CI bot: Approve (continuous-integration)
- Paride Legovini: Approve
-
Diff: 536 lines (+233/-44)12 files modifiedcurtin/__init__.py (+2/-0)
curtin/commands/curthooks.py (+2/-1)
curtin/commands/swap.py (+4/-1)
curtin/distro.py (+17/-5)
curtin/swap.py (+79/-5)
doc/topics/config.rst (+15/-1)
examples/tests/basic.yaml (+4/-0)
examples/tests/basic_scsi.yaml (+4/-0)
tests/unittests/test_distro.py (+26/-6)
tests/unittests/test_feature.py (+3/-0)
tests/vmtests/__init__.py (+58/-20)
tests/vmtests/test_basic.py (+19/-5)
Changed in curtin: | |
status: | New → In Progress |
Changed in curtin: | |
status: | Fix Committed → Fix Released |
Changed in subiquity: | |
status: | New → Fix Released |
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.