-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
template reinstall not ported to Qubes 4.0 #3169
Comments
In general it would be nice to be able re-install or downgrade packages in dom0. |
I'm installing R4 tonight and will look into this. |
Some hints:
|
I'll be trying a fix hopefully this week. |
Aspects of this issue that need to be addressed:
|
@tasket the second point is already tracked here: #2256 (comment) |
And should be addressed by QubesOS/qubes-core-admin#203 - import is performed on fresh temporary volume, renamed to final name only when finished. I'm also going to relax anti-shrink protection - move it to qvm-volume tool (GUI settings already prevent it) and allow to do that at API level (and with some option to qvm-volume, probably |
Thanks. This is pretty extensive. The direction I was going was only to remove and re-create the volume in lvm.py. But I was having trouble tracking the call paths from the admin code to qubesd BTW - The |
Yes. This ticket is not the only reason for it (actually, importing into temporary volume could be done without all the other changes). Other thing is commit operation required multiple steps, which, if something goes wrong, can lead to data loss, or at least need for manual recovery. Extreme result was #3164. |
AFAICT we could even make shrinking safe enough for the GUI, by doing the operations in reverse order. Growing a volume is currently
Shrinking would be 4, 3, 2, 1. |
Problem with point 4 is that for most filesystems it can't be done while the filesystem is mounted (in contrary to extending). And for some it isn't supported at all (xfs, but in practice we care about ext4 only). This is definitely doable (for example from initramfs), but not just "doing the operations in reverse order". BTW currently we recommend universal method for shrinking, by creating new smaller VM and moving data: https://www.qubes-os.org/doc/resize-disk-image/#shrinking-a-disk-image |
Damn, I never noticed that restriction in the |
Similar to LVM changes, this fixes/improves multiple things: - no old data visible in the volume - failed import do not leave broken volume - parially imported data not visible to running VM QubesOS/qubes-issues#3169
Fixed here: marmarek/qubes-core-admin@f870272 (QubesOS/qubes-core-admin#206) |
I think we still have a problem with resizing during import, if new image is smaller:
Won't an error get raised in lvm.py resize()
|
You're right, working on it. |
If needs to be extended - do it before import. If needs to be reduced - after. This way, if data import fails for any reason, previous data won't be destroyed (truncated). Also, convert error on shrinking volume to a warning, as it doesn't break the template (just leave it with bigger disk than needed). Currently all storage pool implementations refuse to shrink a volume (but it may change in the future). QubesOS/qubes-issues#3169
If root volume import fails on template reinstall, do not remove it - keep it alone, with old volume content QubesOS/qubes-issues#3169
Also, is the new image size being propagated to (lvm|reflink|file).py |
That's why qvm-template-postprocess calls volume.resize first. |
I see, the size attribute gets set without doing lvextend/truncate. Makes sense now. |
Automated announcement from builder-github The package
|
Automated announcement from builder-github The component
|
Automated announcement from builder-github The package
|
Verified to fix the missing directory after a reinstall. Thank you! |
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The component
|
Automated announcement from builder-github The package
Or update dom0 via Qubes Manager. |
Qubes OS version (e.g.,
R3.2
): R4.0Steps to reproduce the behavior:
sudo qubes-dom0-update --action=reinstall qubes-template-fedora-25
Expected behavior:
Template got reinstalled. This include preserving its properties. Technically, only root volume should be overwritten, and private volume should be cleaned.
Actual behavior:
And generally the code heavily depends on root.img being a file, and rpm replacing it.
The text was updated successfully, but these errors were encountered: