Hi, I have to upgrade my 2 TB SSD with qubes to a bigger one (4TB).
I tried to clone the disk with clonezilla but I’m not able to resize the qubes LVM.
Anyone know how to do that?
I precise that if possible I want to avoid to reinstall qubes and restore backups because I have some huge non backupped VMs (bitcoin core, electrs, …) that I want to avoid to re-configure and re-sync.
SSD clone and resize should much faster.
Clonezilla doesn’t work well when the target disk is larger. There’s no features in that that are helpful, so you have to do it manually.
You’ll need to use parted to resize the partition, then pvresive to extend the physical volume. I don’t believe any of the logical volumes should be changed with lvextend or lvresive. Volume groups shouldn’t need to be changed either.
dd (Don’t do this from Qubes OS on the SSD you clone. Instead, just boot from USB flash device, maybe Qubes Installer.
Optional: trim the free space. I haven’t found an easier way to do it than just filling the whole LVM pool (e.g., by creating a new qube with large private storage and filling it by dd if=/dev/urandom of=brick bs=32M) and then removing it. Just fstrim isn’t enough, as it operates on FS level, not on LVM. (Doing this step after partition resize is still possible, but you have to fill much more data…)
Resize the partition for encrypted LVM PV. I’ve used gdisk (quite low-level took), the (g)parted will probably be a more comfortable tool for that.
Resize the LUKS container. IIRC it was resized automatically after reboot.
Resize the LVM PV to maximum, probably using pvresize
You’ll probably want to resize the pool by lvextend.
Resize2fs isn’t needed for resizing the pool. It would be needed for resizing the dom0’s volume. It would be also needed for extending domU’s volume, but this is done automatically.
After these commands the pool seems to be resized and for now everything seems working correctly. Only after a second reboot from the resize Qubes stuck at login screen (was never happened before but maybe is related to something else (?))
I noticed some issues with space usage (not sure if it’s an issue related to the resize or just a qubes bug, probably the second one): I tried to clone a 600GB VM but the space usage displayed in Qubes Disk Space Monitor not changed (also after open/shutdown the cloned VM and a system reboot).
Do you know if there is another way to check the entire disk usage? (df -h shows only the dom0 usage)