Bug 1993718 - RFE: anaconda inst.rescue might need a better design for btrfs
Summary: RFE: anaconda inst.rescue might need a better design for btrfs
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: Btrfs
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-16 00:17 UTC by Chris Murphy
Modified: 2022-12-13 15:33 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 15:33:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Chris Murphy 2021-08-16 00:17:22 UTC
Description of problem:


Version-Release number of selected component (if applicable):
anaconda 35.21-1.fc35

How reproducible:


Steps to Reproduce:
1. Install Fedora-Workstation-Live-x86_64-35-20210814.n.0.iso using default/auto partitioning
2. Reboot Fedora-Everything-netinst-x86_64-35-20210814.n.0.iso
3. Choose Troubleshooting -> Rescue a Fedora system
4. Choose option 1) Continue
this works so far, installed system is mounted as expected
5. run these commands to create a snapshot of root
umount --recursive /mnt/sysroot
mount /dev/vda3 /mnt/
cd /mnt
btrfs sub snap root root.20210815
reboot
6. Again choose to rescue a Fedora system and choose option 1) continue


Actual results:

The following installations were discovered on your system
1) [x] Fedora Linux 35 for x86_64 on root
2) [ ] Fedora Linux 35 for x86_64 on root

Please make a selection from the above

Out of the box this works. But as soon as there are snapshots, confusion ensues because the snapshots contain the same /etc/fstab which points to a single subvolume root to mount at '/' so even though we get choices for multiple roots due to multiple snapshots, the choices all end up mounting the same root subvolume.

So this is not strictly a bug, until we remove the 'subvol=' mount option from fstab and then anaconda inst.rescue crashes (will file a separate bug).


Explanation:

The subvolume 'root' and 'root.20210814' both contain an fstab with the line:

UUID=$btrfsuuid / btrfs subvol=root,compress=zstd:1 0 0

Since both subvolumes have an fstab with the 'subvol=root' hint is why we have two rescue choices that end up pointing to the same subvolume. No matter what we can only rescue one subvolume with this design.

Note that the '/' fstab entry is effectively a remount operation at switchroot time. Switching subvolumes at remount time makes no sense (and the option is ignored by the kernel without error). The subvolume selection is made at initial ro mount time by the rootflags boot parameter (or in the alternative scenario, by 'btrfs subvolume set-default'), and renders the 'subvol=root' in fstab kinda pointless, except it's used as a hint by anaconda's inst.rescue code since it doesn't have a way of using the rootflags hint.

Expected results:

We need to figure this out before fixing the bug.


Additional info:

Comment 1 Chris Murphy 2021-08-16 00:30:04 UTC
See also bug 1993720 for what happens when /etc/fstab '/' mount point is missing subvol= mount option

Comment 2 Chris Murphy 2021-08-16 00:55:53 UTC
See also https://pagure.io/fedora-btrfs/project/issue/51

Comment 3 Ben Cotton 2022-11-29 17:03:15 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Ben Cotton 2022-12-13 15:33:58 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.