BTRFS reinstalling without losing @home

Garuda has some known performance issues when installed in a VM, so bear that in mind while you do your testing and don’t judge to harshly. When you are ready to install on the metal, that will give you the best performance.

You can complete the installation while leaving the existing subvolumes intact, but you will have to rename them first so they don’t use names that the default installation will try to use (@, @cache, @home, @log, @root, @srv, and @tmp).

An easy way to do this is make a mountpoint outside the top-level subvolume.

sudo mkdir /mnt/top-level_subvolume
sudo mount -o subvolid=0 /dev/nvme0n1p2 /mnt/top-level_subvolume
cd /mnt/top-level_subvolume

From here, ls will show you all the top-level subvolumes and you can just rename them.

sudo mv @ @old
sudo mv @home @old_home

And so on with any other subvolumes listed there.

You will have to update /etc/fstab with the updated subvol= values if you want to keep this system bootable (I would recommend it, just as a precaution until the new system is ready for use).

Once that is all set, go ahead and install Garuda. Choose the manual partitioning option. Select the EFI partition and click on Edit. Be very careful with the selections you make–you want to keep the contents of the partitions–do not format or you will lose the first installation.

EFI partition:

  • Content: Keep
  • Mount point: /boot/efi

Next, select the Btrfs partition and click on Edit.

Btrfs partition:

  • Content: Keep
  • Mount point: /

After the installation, you will have a dual-boot setup on the one partition. Once you verify the Garuda installation is up and working as expected, you can delete any subvolumes from the old system you no longer wish to keep (i.e. you may delete @old if you wish).

You have a couple options with the home partition:

  • Mount @old_home and copy the contents over to your new @home. Be sure to preserve the filesystem attributes, etc with a robust copy option such as rsync -qaHAXS SOURCE_DIR DESTINATION_DIR as described here. After you have verified the files are intact you may remove the @old_home subvolume if you wish.
  • Remove the @home subvolume, then rename the @old_home subvolume and mount it at the new mount point /home.

I hope that helps, welcome to the community @bogdahn.

6 Likes