Well, if you want to have subvolumes, then you should create those before restoring your backups, because I do not believe that you can convert a regular directory into a subvolume. Conversely, a subvolume does act as a directory.
Something to keep into account, through ─ even though it may not apply to you ─ is that if you have /usr on a separate subvolume, then you should modify /etc/mkinitcpio.conf and rebuild your initramfs.
If you’re going with the default Manjaro setup for the initramfs and /usr is either on a separate filesystem or on a distinct subvolume, then you’ll need to add the usr and shutdown hooks. Don’t add the fsck hook because btrfs doesn’t use that ─ it has its own integrity check built-in.
I have however found that replacing the udev hook ─ and other required hooks that depend on the udev hook ─ and letting systemd take care of the configuration of the initramfs is easier, and it shaves a second off of the boot time.
This is the pertinent line from my own /etc/mkinitcpio.conf…
The sd-vconsole hook will automatically configure your initramfs with the correct keyboard layout, and the systemd hook will detect the correct modules to add, including if /usr is on a separate filesystem or subvolume.
This can work if you just copy the data from the snapshot instead of restoring. However, there is another alternative:
Live convert ext4 to btrfs
Create the desired subvolumes
Move data to the subvolumes
Update fstab, mkinitcpio.conf and grub configuration
This way you don’t need the extra partition or drive to shift the data. However, clean install with btrfs and migrating the data will result in a cleaner setup.
I already have the backup in other drive ( / and /home). I don’t use /home for personal information, I have it all in other drive, just change path of the /home forders.
So I think a cleaner install would be better
Was about to open a topic until I came across this thread. I am also considering converting my existing system partition from ext4 to btrfs. But after reading the Arch wiki I’m a little confused. It mentions an /ext2_saved subvolume, which I’m guessing is a backup of existing data. Where exactly is this created?
I’d appreciate it if you laid out a step by step conversion guide.
HI!
The ext2_saved subvolum is an *image file created with your system when it was a extX filesystem.
Right now I’m creating a How-To, I’ll post it when It’s done
Hi!
This is the guide, as it now is a beta version but I would like to post it so anyone can propose anything to add, remove,etc. Besides formatting, typos, etc.
How-To BTRFS and Snapshots
How-To BTRFS and SNAPSHOTS for N@@bs
Install system in BTRFS format on a sdd disk using manjaro-architect.iso
1.1 Partitions
2.1 Create config files for each Partition
- We need root acces
- # snapper -c root create-config /
- # snapper -c home create-config /home
2.2 Config the snapper config files
- We need root acces
- The method is the same por any config file (/ /home)
- # nano /etc/snapper/configs/root
- Edit the variable ALLOW_USERS="@USER"
- Edit “limits for timeline cleanup” section #this is my own
Hourly=“0”
Daily=“2”
Weekly=“4”
Monthy=“12”
Yearly=“1”
2.3 Adding @USER permissions to the snapshots dirs
- # chmod a+rw /.snapshots/
- # chmod a+rw /home/.snapshots/
2.8 Changing permissions of snapshots
- By default all snapshots are set as Read-Only
- Check snapshops permissions as @USER
- $ btrfs property list -ts /.snapshots//snapshot/ # for @
- $ btrfs property list -ts /home/.snapshops//snapshot # for @Ugin
- Changing snaphots permissions to Write
- We need root acces
- # sudo btrfs property set -ts /.snapshots//snapshot/ ro false #for @
- # sudo btrfs property set -ts /home/.snaphots//snapshot/ ro false #for@Ugin
Now we`ll see all root snapshots created on grub and we’ll be able to boot up with any of them
Snapper-gui
It’s a front-end of snapper.
You can create, edit,load, delete any snapshot created
It let you load or create a snapshot including other subvolums like @Ugin
If you don’t like/want to use snapper and snapper-gui,there’s another alternative, Timeshift.
How-To convert to btrfs
How-To Convert an ext2/3/4 filesystem in a btrfs system
- I come to the conclusion that this type of conversion isn't recommended. It could couse a lot of problems, non booteable systems, corrupt/loss data, etc. So I made my own workaround
Do a full backup of your system, / and /home with Timeshift or other application who use RSYNC
Boot up with a live system
Do the partitioning using btrfs,in my case, I made /boot/efi / /home,it’ll create only the subvolume @ for / (that happens in all my tryouts).
3.1 Cheching subvolumes
- We need root acces
- # btrfs subvolume list
In this case, using the live we need to mount the / partition first.
- # mount /dev/sdXN /mnt
- # btrfs subvolume list /mnt
Creating other subvolumes
In this case we’re going to create a subvolume for /home, it will be @Ugin.
With our / partition mounted in /mnt, we’re going to delete the /home folder