Bug 2123827

Summary: Btrfs /sysroot Incorrectly Mounted Causing initrd-switch-root.service To Fail
Product: [Fedora] Fedora Reporter: Garry T. Williams <gtwilliams>
Component: grub2Assignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: fedoraproject, filbranden, flepied, fmartine, lkundrak, lnykryn, msekleta, pgnet.dev, pjones, rharwood, ryncsn, ssahani, s, systemd-maint, yuwatana, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-07 17:40:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Log Of Boot Up To Failing Switch Root none

Description Garry T. Williams 2022-09-02 17:50:02 UTC
Created attachment 1909255 [details]
Log Of Boot Up To Failing Switch Root

Description of problem:
All kernels after 5.19.2-300.f37 fail to boot because /sysroot is
mounted with btrfs / instead of subvolume root.

[    5.107016] gtw systemd[1]: Reached target initrd-switch-root.target - Switch Root.
[    5.108528] gtw systemd[1]: Starting initrd-switch-root.service - Switch Root...
[    5.120164] gtw systemctl[601]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.
[    5.121629] gtw systemd[1]: initrd-switch-root.service: Main process exited, code=exited, status=1/FAILURE
[    5.121902] gtw systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'.
[    5.131371] gtw systemd[1]: Failed to start initrd-switch-root.service - Switch Root.

An `ls /sysroot` command from emergency target prompt shows only
home and root (the root of my btrfs file system).

Version-Release number of selected component (if applicable):
251.4-53.fc37

How reproducible: always


Steps to Reproduce:
1. upgrade to 251.4-53.fc37 (which I did on 8/23)
2. boot newly installed kernel AFTER systemd upgrade
3.

Actual results:
Boot stops with emergency target.  (All kernels after 5.19.2 fail.)

Expected results:
Boot succeeds without errors.

Additional info:
From emergency target, if I remount /sysroot with -o subvol=root
then restart initrd-switch-root, boot finishes correctly without
errors.

Comment 1 Zbigniew Jędrzejewski-Szmek 2022-09-02 18:31:00 UTC
Are you using grub2? This is most likely the issue with grub installation scriptlets mangling
the commandline and removing rootflags=. I think #2118287 is the bug too look at.
Please reassign to grub2 if so.

Comment 2 Garry T. Williams 2022-09-03 02:32:14 UTC
Thanks.  That was it.  I am reassigning to grub2.

Bug #2118287 needs a fix for f37.  (I can work around the problem until then.)

Comment 3 Robbie Harwood 2022-09-07 17:40:05 UTC
It already has one.

*** This bug has been marked as a duplicate of bug 2118287 ***