On 02/18/17 11:23, Zbigniew Łukasiak wrote:
> There are instructions how to resize a VM at
>
https://www.qubes-os.org/doc/resize-root-disk-image/ - but this cannot
> apply to dom0 - because it requires stopping the VM and then running
> commands in dom0. What would be the procedure for resizing dom0 root
> partition?
>
It's just a linux, and by default dom0 root fs is ext4, which can be
grown while mounted, so 'standard' resizing procedure should do. Please
take into account that there is ext4 on LVM on LUKS and each have to be
grown separately. All commands run as root from dom0(do backups and be
carefull!!!).
Thanks to LVM there are two alternative solutions.
First one, if you have space after LUKS partition on your HDD/SSD:
0. grow physical partition using fdisk or gparted.
1. grow LUKS container using "cryptsetup resize".
2. grow (LVM) physical volume using "pvresize".
3. grow (LVM) logical volume(default name: root) using "lvextend".
4. grow ext4 filesystem using "resize2fs".
Alternatively you can extend root by extending LVM, but this will
require providing two(or more) passwords while booting(because each part
of LVM will need to be decrypted before "merging" it into root partition).
0. Create new partition using fdisk/gparted.
1. Create new encrypted luks container using "cryptsetup luksFormat".
2. Mount newly created luks container.
3. Initialize (LVM) physical volume on newly created luks container
using pvcreate.
4. Add newly created physical volume to LVM volume group (by default
named: qubes_dom0) using "vgextend".
5. grow (LVM) logical volume using "lvextend".
6. grow ext4 filesystem using "resize2fs".
7. remember to recreate initramfs including both LUKS containers and new
lvm settings
As always with filesystem changing operations, backup everything before
proceding and be extremly carefull. I'm also not providing full
commands(it's hard to do from the top of my head), so RTFM to get better
understanding of each of above-mentioned commands.
To analyze current state of LVM useful commands are: pvdisplay,
vgdisplay and lvdisplay. Additionally all used devices shall be visible
in /dev/mapper.
Regards,
tezeb