Git Product home page Git Product logo

Comments (3)

keestux avatar keestux commented on July 3, 2024

@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.

from blivet.

vojtechtrefny avatar vojtechtrefny commented on July 3, 2024
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.

from blivet.

keestux avatar keestux commented on July 3, 2024

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.

from blivet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.