Guide how to increase dom0 free disk space to avoid problems with big templates and backups
This guide was checked for R4.2.
It can be done in the running Qubes R4.2 system without data-loss.
But make full backups before doing anything, in case something goes wrong.
All steps are done in the dom0 Terminal:
First check that you have empty space in your Volume Group qubes_dom0.
Qubes OS installer keeps 10% free by default, so in most cases you will have this space $ sudo vgs qubes_dom0
Check the last column (VFree). It can say something like “<50.44g”, it would mean you have a bit more than 50 GiB of free space. Note: that the less sign “<” before size (like in "<50.44g") only tells you how the value was mathematically rounded. It does not mean that the free size can be much smaller than the value (e.g. it is for sure bigger than 50 GiB in this case).
Check the current size of root-pool pool logical volume just to know: $ sudo lvdisplay qubes_dom0/root-pool
The “LV Size” would have something like 25.00 GiB or something in default case.
Add additional space, e.g. 20 GiB to the root-pool pool logical volume. $ sudo lvextend --size +20G qubes_dom0/root-pool
Remember, additional space should be smaller than VFree of Volume Group qubes_dom0.
Add the same amount of space (or a bit less if you want to have reserve) to the root logical volume that is located inside root-pool pool. $ sudo lvextend --size +20G qubes_dom0/root
Finally resize ext4 filesystem or root partition in dom0 to occupy the new increased size: $ sudo resize2fs /dev/mapper/qubes_dom0-root
Now the Qubes Disk Space Monitor widget in system tray, and df -h in dom0’s terminal should show you the increased size of root partition (/) in dom0.
Any chance, that you can explain -in a second step- how to add a second drive (ssd/hdd) to the qubes_dom0 space ? Thats something I really been curious about, cause I’m having a 1TB m.2 for the entire system installed here and another 512GB m.2 is lying around in the device without any further use…
It’s not related to dom0 free space, so it’s probably not a good idea to discuss it here.
None the less, you can add this ssd as Physical Volume to LVM and extend Volume Group qubes_dom0 by 512 GB. It also can be done on-fly (on running system), as I understand.
I personally would not do that, because it decreases the reliability of the setup. If any of your ssd dies, the data on the second one could be lost, too.
If you want to use this additional space only in some particular big qubes, I would advice paritioning the second ssd and attach partitions to these qubes. You may consider encryption, too.
Did you do manual partitioning during installation?
It was a long time ago. I only remember I left some unpartitioned space for over-provisioning and I think I just selected the rest for the installation.
df -h shows me I have:
/dev/mapper/qubes_dom0-root for /
/dev/nvme0n1p2 for /boot
/dev/nvme0n1p1 for /boot/efi
Instead of pool00 the root volume that is located in its own root-pool. In R4.2 there is no pool00, and root is not in the same pool as other qubes.
You can compare installer scripts in git repo for related commands.