Closed keestux closed 6 months ago
@vojtechtrefny would it be possible to write up a few blivet
steps that would simulate what anaconda
is doing? So far I was not able to figure this out myself from looking at the blivet
and anaconda
code. Some simple thing I tried:
import blivet
dt = blivet.devicetree.DeviceTree()
dt.populate()
sda2 = dt.get_device_by_name("sda2")
BTRFS = blivet.formats.get_format('btrfs', exists=True)
btrfsroot = blivet.devices.btrfs.BTRFSDevice(parents=sda2, exists=True, fmt=BTRFS, uuid='17988bd4-4ad9-49c9-9cc7-73110966d8ab')
vol = blivet.devices.btrfs.BTRFSVolumeDevice(parents=btrfsroot, exists=True, fmt=BTRFS, uuid='17988bd4-4ad9-49c9-9cc7-73110966d8ab')
But this doesn't exactly do things that anaconda
is doing. Anaconda is looking at all subvolumes. How does it do that? Because I think that there is where it goes wrong. Anaconda is creating BTRFSSubVolumeDevice
instances in the wrong order. It hits a child subvol before it has seen the parent.
import blivet
blivet.flags.flags.auto_dev_updates = True
b = blivet.Blivet()
b.reset()
Setting the auto_dev_updates
to True
is the key here -- by default blivet doesn't mount btrfs volumes to get the list of subvolumes (we don't want to mount random devices when running outside the installer environment). So with the flag set you should see all the subvolumes in the devicetree (or in your case, reset
will probably crash), you can then use print(b.devicetree)
for a simple device tree visualization.
Thanks for the tip. Unfortunately (if you can call it that) the problem has gone away. I'll close this issue for now and reopen it when it happens again.
The problem I'm describing here is triggered by the Fedora 39 installer. It is also reported in Redhat Bugzilla 2210933. It is suggested (by @vojtechtrefny ) that
I haven't found it reported as an issue here, so that is why I've created this issue.
In my situation I wanted to have a look at Fedora installation on a system that already has two BTRFS file systems. The error I'm seeing is:
The thing is that parent isn't missing at all. The BTRFS file system does not have any errors. The parent ID is there.