Is is possible to take a disk image of an ostree-based atomic OS such as Silverblue or Fedora-IoS and mount it in such a way that, while chrooted in, it can be updated? If so, what's the sequence of commands to do it?

Question basis: I was working on preparing a Fedora-IoT arm aarch64 image inside libvirt/qemu. At some point any rpm-ostree command 'timed out.' Even a 'simple' one like rpm-ostree status. I was hoping the chroot environment and qemu-aarch64-static would work a little faster, avoiding the timeout.

I investigated the various partitions on the image, uEFI boot, /boot and what ends up being /sysroot, but couldn't quite get how to mount the real root image. Nor did the various ways of looking at a running system give clues. /etc/fstab is not helpful.

It then occurred to be that general ostree system maintenance or investigations within a chroot might be useful as it is in more standard OS installations. Hence the question here.

[Edit] I see some generic information is available [1]:

Parse the ostree= kernel command line argument in the initramfs
Set up a read-only bind mount on /usr
Bind mount the deployment's /sysroot to the physical /
Use mount(MS_MOVE) to make the deployment root appear to be the root filesystem

This may not be entirely useful. I've managed a partial execution of the above, bind mounting a few things here and there before a chroot. then running rpm-ostree status and other commands give: error: This system was not booted via libostree; cannot operate.

[1] https://ostree.readthedocs.io/en/latest/manual/adapting-existing/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.