Background: Successfully did a btrfs-convert on two Debian 12 installs around September 2024 and have had no issues since.
The ArchBang instructions were an initial attempt to develop a workflow to later test with Arch and improve ArchWiki, but that whole thing moves too quickly and I don't think anyone there cares about btrfs-convert.
Follow these instructions at your own risk. You must test them in a virtual environment first, preferably several times.
mkfs.btrfs is historically the more reliable method to use. Issues with btrfs-convert have existed in the past so perform at your own risk.
btrfs-convert /dev/vda1mount /dev/vda1 /mntcd /mntlsbtrfs subvolume snapshot . @rootfslscd /umount /mnt
mount -o subvol=@rootfs /dev/vda1 /mntcd /mntmount /dev/xxxn boot/mount --bind /dev dev/mount --bind /proc proc/mount --bind /sys sys/
chroot /mntnano /etc/fstab OR vi /etc/fstab#Comment out the line containing / after UUID b. Add/dev/xxx1 / btrfs noatime,compress=zstd:1,subvol=@rootfs 0 0
update-initramfs -ugrub-mkconfig -o /boot/grub/grub.cfg- /boot/grub/grub.cfg should now have the new UUID of the btrfs partition (see blkid for UUIDs)
grub-install /dev/xxx(WITHOUT the number)- exit /
ctrl-dfrom chroot cd /umount -R /mntand reboot into btrfs system
From a live USB of the same system, convert, create subvolumes, and move contents of /home to the new @home subvolume:
ALSO before you start, BACKUP (preferably to two different storage devices) and make sure your system is up-to-date (especially btrfs-progs). ASSUME the following process will fail on you and that you'll need to reinstall everything and restore from backups!
btrfs-convert /dev/vda1mount /dev/vda1 /mntcd /mntlsbtrfs subvolume snapshot . @rootfsbtrfs subvolume create @homemv home/* @home/lscd /umount /mnt
REMEMBER to not delete ext2_saved or run btrfs balance, or btrfs filesystem defragment until you're certain you don't need to rollback with btrfs-convert -r /dev/xxx#!!
mount -o subvol=@rootfs /dev/vda1 /mntcd /mntmount /dev/xxx# boot/([)if on a separate partition; else ignore this step)mount --bind /dev dev/mount --bind /proc proc/mount --bind /sys sys/
chroot /mntnano /etc/fstabOR vi/etc/fstab- #Comment out the existing line containing / in fstab (UUIDs will be the same - using /dev/xxx# temporarily to get this going will also work fine so long as your drive assignments won't change)
- Add
/dev/xxx# / btrfs noatime,compress=zstd:1,subvol=@rootfs 0 0 - Add
/dev/xxx# /home btrfs noatime,compress=zstd:1,subvol=@home 0 0
mkinitcpio -g /boot/initTAB COMPLETE.imggrub-mkconfig -o /boot/grub/grub.cfg/boot/grub/grub.cfgshould now have the new UUID of the btrfs partition (see blkid for UUIDs)grub-install /dev/xxx(without the number of the device)
exitorctrl-dfrom chrootcd /to get out of /mnt so we can umountumount -R /mnt(-R = recursive) and reboot into btrfs system
Even if you've gone through with all of these steps, you can still do a rollback.
You will however need to repeat the grub-install /dev/### step after performing btrfs-convert -r /dev/xxx#. Don't forget to mount dev/proc/sys again and chroot. The mkinitcpio step won't be necessary, nor grub-mkconfig. Only grub-install will be required before you unmount and reboot.
Head back into a live USB boot, mount the btrfs partition, rm -r every directory that isn't @rootfs or @home and then finally finish it off with btrfs subvolume delete ext2_saved.
While rm will still work on subvolumes, it's better practice to use btrfs subvolume delete so that you can be sure you're removing subvolumes and not regular directories.
cd / && umount /mnt, reboot and you're finally all done! However, be sure to keep reading and learning about how to maintain BTRFS subvolumes. DO NOT run defrag on volumes that contain snapshots or you'll likely soon hit the 100% usage issue! It's best to run defrag in a more targeted manner, a directory at a time.
- Don't fill your filesystem up to 100%.
- Run a filtered balance every now and then.
- Learn to make use of compression and snapshots, and backup said snapshots
- with btrfs-send and borg backup.
- Don't use RAID until you have a good backup regimen in place, because RAID is not a backup.
- BTRFS is not for beginners. Be prepared to remain patient and read before you execute.
- Never run
btrfs check --repairunless you're ready to destroy your filesystem. - Carefully read https://dontasktoask.com to get the most out of IRC support. esr's smart questions is also a useful guide to follow if you want the best help available.