You are not logged in.
Hi, some days ago I converted my installation file system from ext4 to btrfs, I have all my install inside a 1tb partition, after converting and balancing the system I look how to create snapshots when I noticed that I dont have any root subvolume.
I'm wondering if there's a way of creating some subvolumes for snapshots without having to reinstall the system into a new btrfs partition with the root subvolume already created.
I don't have my home folder in it's own partition nor other drive to copy all my stuff into. I don't really mind reinstalling all my system as I have a pretty reproducible setup but if there's some way of creating the correct subvolume system without having to reinstall everything I would love to know it.
Just to be sure, the output of "btrfs subvolume list /" is nothing at all.
Thanks in advance <3
Last edited by Xsofito (2024-08-04 11:54:31)
Offline
There is nothing Btrfs specific about moving (system) files.
Having Btrfs subvolumes on the same partition, makes moving files between those subvolumes very efficient. It just moves inodes and does not require (much) additional disk space doing that.
General steps to move files to other subvolumes: Create the subvolumes you want (on the same partition, for example). Unmount the mountpoints containing the files you want to move. If the mountpoint is in use (/, /home, ...), then boot in to a live Linux ISO. Move or copy the files (as root) into each subvolume. Update your mountpoint configuration (/etc/fstab, for example) to mount the new subvolumes instead. And update your bootloader configuration (grub, for example) to boot into the new root subvolume.
Last edited by willemw (2024-08-04 11:16:16)
Offline
If the OP has a single root partition it can be as easy as
mount /dev/sdXY /mnt
btrfs subvolume snapshot / /mnt/arch
ed /mnt/arch/etc/fstab # correct
Then re-configure the bootloader to start the /arch subvolume.
Once the new system is booted up the original filesystem can be deleted.
Offline
Some hours after posting I found this forum post where Head_on_a_Stick also helped and gave it a try.
I created a snapshot of the system called /@, then I created the /@home and /@.snapshots subvolumes, booted into the snapshot with the fstab reconfigured and after checking everything was working deleted the old / folder.
After that I play a while with compression trying not to brick the boot process, let all the night the system compress the disk (without forcing all the files) and set up snapper for automatic snapshots.
Everything looks fine and working as intended, I was expecting the process to be more complicated but end up pretty easy, just took some time.
Thanks for the help, and thanks Head_on_a_Stick for your nice explanation both now and in the past post. <3
Offline