-
Ensure that you have a working backup of all VMs.
-
Find the UUID of the LUKS device hosting the dom0 ext4 root filesystem:
grep -Eo '^/dev/mapper/luks-[0-9a-f-]{36} / ext4 ' /proc/mounts | cut -b 18-54
Write down the output on a piece of paper.
-
For those dom0 kernels with btrfs support built as a module, include it in their initrds:
sudo dracut --regenerate-all --force --add-drivers btrfs
-
Reboot into a Qubes R4.1 installer (not R4.0, which has a severely broken
btrfs-convert
version!), and switch to a console. -
Decrypt the ext4 root filesystem:
cryptsetup open /dev/disk/by-uuid/YOUR-LUKS-UUID-FROM-STEP-ONE rootfs
-
Convert the decrypted filesystem to btrfs, and restore its old filesystem UUID:
FSUUID=$(blkid -s UUID -o value /dev/mapper/rootfs) echo $FSUUID e2fsck -f /dev/mapper/rootfs btrfs-convert /dev/mapper/rootfs btrfs check /dev/mapper/rootfs btrfstune -U $FSUUID /dev/mapper/rootfs
-
Switch the
varlibqubes
pool driver fromfile
tofile-reflink
:mkdir /mnt/rootfs mount /dev/mapper/rootfs /mnt/rootfs sed '/ name="varlibqubes"/s/ driver="file"/ driver="file-reflink"/' -i.bak /mnt/rootfs/var/lib/qubes/qubes.xml diff -u /mnt/rootfs/var/lib/qubes/qubes.xml{.bak,} umount /mnt/rootfs
-
Reboot into Qubes
-
Check that the
varlibqubes
pool has been switched tofile-reflink
:qvm-pool
-
Everything's working? Then clean up the remaining
file
/ext4 cruft:sudo rm -f /var/lib/qubes/*/*/*-cow.img* sudo btrfs subvolume delete /ext2_saved
Last active
April 20, 2021 14:42
-
-
Save rustybird/0ccb0131deace38231c02429f08762f5 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment