systemd tools fail to mount disk images with btrfs filesystems

Bug #2067907 reported by Daan De Meyer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Committed
Undecided
Unassigned
Noble
Fix Released
Medium
Nick Rosbrook

Bug Description

SRU Justification

[Impact]

In Ubuntu Noble, systemd-repart fail to mount images with btrfs filesystems in them. This is because the kernel removed the "norecovery" mount option which systemd-repart adds in when mounting filesystems from disk images.

Commit which removed "norecovery" in the kernel: https://github.com/torvalds/linux/commit/a1912f712188291f9d7d434fba155461f1ebef66.

[Fix]

The issue was worked around upstream in systemd in https://github.com/systemd/systemd/pull/32892 and https://github.com/systemd/systemd/pull/32948.

[Test]

To reproduce:

git clone https://github.com/systemd/mkosi
cd mkosi
bin/mkosi -d fedora -t disk --tools-tree=default -f
sudo systemd-repart --image mkosi.output/image.raw
The last command will fail with "Failed to mount image: Invalid argument". After backporting the two systemd commits, the last command will succeed.

[Regression Potential]

Low, the systemd commits only change behavior for btrfs filesystems, which are currently not working at all. The commits have been backported to the systemd stable releases and we've had no reports of any issues caused by backporting these commits.

description: updated
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thanks for filling out the SRU template. I tested this locally and was able to reproduce the bug using your instructions.

I will include this in the next Noble SRU.

Changed in systemd (Ubuntu Noble):
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Nick Rosbrook (enr0n)
tags: added: systemd-sru-next
Revision history for this message
Nick Rosbrook (enr0n) wrote :

These patches are included in v256, which is currently in oracular-proposed, so we just need to upload to noble.

Changed in systemd (Ubuntu):
status: New → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Daan, or anyone else affected,

Accepted systemd into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/255.4-1ubuntu8.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Noble):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Nick Rosbrook (enr0n) wrote :

I have verified the fix using systemd 255.4-1ubuntu8.2 from noble-proposed:

nr@six:/t/t/mkosi$ apt policy systemd
systemd:
  Installed: 255.4-1ubuntu8.2
  Candidate: 255.4-1ubuntu8.2
  Version table:
 *** 255.4-1ubuntu8.2 100
        100 http://us.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     255.4-1ubuntu8.2~ppa4 500
        500 https://ppa.launchpadcontent.net/enr0n/systemd/ubuntu noble/main amd64 Packages
     255.4-1ubuntu8.1 500
        500 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
     255.4-1ubuntu8 500
        500 http://us.archive.ubuntu.com/ubuntu noble/main amd64 Packages

nr@six:/t/tmp.fAC46XxQnY$ git clone https://github.com/systemd/mkosi
Cloning into 'mkosi'...
remote: Enumerating objects: 21509, done.
remote: Counting objects: 100% (21509/21509), done.
remote: Compressing objects: 100% (6472/6472), done.
remote: Total 21509 (delta 14871), reused 20817 (delta 14654), pack-reused 0
Receiving objects: 100% (21509/21509), 5.91 MiB | 1.78 MiB/s, done.
Resolving deltas: 100% (14871/14871), done.
nr@six:/t/tmp.fAC46XxQnY$ cd mkosi/
nr@six:/t/t/mkosi$ ./bin/mkosi -d fedora -t disk --tools-tree=default -f

[ ...snip... ]

nr@six:/t/t/mkosi$ sudo systemd-repart --image mkosi.output/image.raw
[sudo] password for nr:
No machine ID set, using randomized partition UUIDs.
TYPE LABEL UUID PARTNO FILE RAW SIZE SIZE >
esp esp a2afefbe-5065-4679-9a40-2768cb2e608b 0 1073741824 1.0G >
21686148-6449-6e6f-744e-656564454649 linux 4410a7c2-8d1d-4a3e-a737-52a6aa7a18f5 1 1048576 1.0M >
root-x86-64 root-x86-64 67d027f2-ab0f-4102-a6bb-6a5690412d60 2 3016753152 2.8G >
                                                                                                             Σ = 3.8G >

 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
 │ ├─ root-x86-64
 │ └─ linux
 └─ esp

No changes.

tags: added: verification-done-noble
removed: verification-needed-noble
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 255.4-1ubuntu8.2

---------------
systemd (255.4-1ubuntu8.2) noble; urgency=medium

  * mountpoint-util: Deal with kernel API breakage in "norecovery" mount option.
    Also include fixup commit
    055b465a3f ("shared/mountpoint-util: for old kernels, assume "norecovery" is supported by btrfs").
    (LP: #2067907)
  * cgroup-util: allow cg_read_pid() to skip unmapped (zero) pids (LP: #2067922)
  * debian/extra: ship nice.conf for journald, not logind (LP: #2067927)

 -- Nick Rosbrook <email address hidden> Fri, 14 Jun 2024 17:03:19 -0400

Changed in systemd (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.