Disclaimer: Do it on your own risk. I only tried this in a virtual machine.
Hi there.
I'm trying to figure out how to move an existing installation to btrfs to use apt-btrfs-snapshot.
apt-btrfs-snapshot creates a snapshot every time you run apt to install something. This also works if you install software through GUI.
After moving to btrfs you can also create snapshots manually before you try out something.
All commands in the guid have to be called from a linux live system.
In my case I used kubuntu 17.04. sda is the existing OMV3 installation on ext4.
I used the command btrfs-convert despite warnings you get all over the place.
In production you might copy files around to a second drive and create a fresh brtfs partition.
So far I succeeded inside a virtual machine. My question is.. did I miss something?
Here comes the guide:
# convert fs to btrfs
btrfs-convert /dev/sda2
# mount new filesysteme
mount /dev/sda2 /mnt/
# snap / into @
btrfs sub snap /mnt/ /mnt/@
# create subvolume @home. move files from home to @home
btrfs sub create /mnt/@home
mv -av /mnt/home/* /mnt/@home/
# show your uuid
btrfs fi sh
# add changes in /etc/fstab
nano /mnt/\@/etc/fstab
## change uuid of boot drive to the new UUID
## change fstype of boot drive from ext4 to btrfs
## remove all option of boot drive
## add option subvol=@ of boot drive
## change dump and pass to 0 and 0
## copy the line of boot drive to a new line
## change subvol=@ to subvol=@home in new line
## change mountpoint / to /home in new line
# repair grub
umount /mnt
mount -o subvol=@ /dev/sda2 /mnt/
mount /dev/sda1 /boot/efi/ # skip this if efi is not used
mount --bind /dev/ /mnt/dev/
mount --bind /proc/ /mnt/proc/
mount --bind /sys/ /mnt/sys/
chroot /mnt/
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
# setup complete. restart without linux live system
Alles anzeigen