Long story how I ended up here (the "Why" later in the post), but I recently used an installer that put the BTRFS install onto the root btrfs file system rather than into a subvolume as is the *buntu custom. This is less than optimal as much of the benefit of using BTRFS comes from the existence of subvolumes. The following is totally new functionality to me - either it's new or I just didn't know it.
On to how I did it:
Booted to the install
Created a target to mount the root fs
Mounted the root fs
CD'd into the mount
Made a snapshot of the root fs
And voilà I have a snapshot of my root fs!
The nesting is very odd. From the root fs the path to the snapshot is
/mnt/install/mnt/install/@rootfs
Once I unmounted the root fs
the snapshot is visible in /mnt/install/, and checking the mnt/install folder inside the snapshot - it's empty.
Part of the "Why" is this btrfs installation is in a VM. For whatever reason, the installer (this is Ubuntu Server 22.04 beta) does not use subvolumes at install like all other *buntu installers are. I don't know if it's a change or a different installer - it certainly felt different! So I installed it into a VM so I could do the above and then move the subvolume to my server for testing.
To do this, I did a "btrfs send" and sent the subvolume from the VM to a file on a shared folder on my host system. Then once it was there, did "btrfs receive" and again voilà I have a subvolume. Next - on to whether or not I can actually boot this subvolume on my server!
On to how I did it:
Booted to the install
Created a target to mount the root fs
Code:
sudo mkdir /mnt/install
Code:
sudo mount /dev/sda2 /mnt/install
Code:
cd /mnt/install
Code:
sudo btrfs su sn . @rootfs
The nesting is very odd. From the root fs the path to the snapshot is
/mnt/install/mnt/install/@rootfs
Once I unmounted the root fs
Code:
sudo umount /dev/sda2
Part of the "Why" is this btrfs installation is in a VM. For whatever reason, the installer (this is Ubuntu Server 22.04 beta) does not use subvolumes at install like all other *buntu installers are. I don't know if it's a change or a different installer - it certainly felt different! So I installed it into a VM so I could do the above and then move the subvolume to my server for testing.
To do this, I did a "btrfs send" and sent the subvolume from the VM to a file on a shared folder on my host system. Then once it was there, did "btrfs receive" and again voilà I have a subvolume. Next - on to whether or not I can actually boot this subvolume on my server!
Comment