CentOS8 on BTRFS

Officially CentOS8 does not support BTRFS (the RedHat ppl had it as a demo feature on CentOS7 which allowed one to install the os on a root partition with btrfs as the filesystem) so do this at your own peril.

  1. install CentOS8
  2. dnf upgrade -y
  3. get the remi repos for el8 installed
  4. dnf install kernel-ml
  5. dnf install btrfs*
  6. edit /etc/dracut.conf.d/btrfs.conf
    add btrfs relevant crap to it like filesystems and modules and whatnot
  7. dracut -f -v /boot/initramfs-$(uname -r).img $(uname -r)
  8. boot the machine using a livecd that has btrfs
  9. btrfs-convert /dev/vda2
  10. /boot/grub2/grub.cfg
    insmod btrfs
  11. edit /etc/fstab and adjust uuid for / as well as filesystem type change to btrfs
  12. selinux might be a problem so disable and boot
  13. after successfull boot on btrfs touch /.autorelabel and reenable selinux

Considering we’re in 2021 and that many other distros play nice with btrfs I’d say don’t do this using CentOS8 unless you need to run CentOS8 (or a clone like Alma) … there are far better alternatives out there that have integrate btrfs properly (ex. OpenSuse, Ubuntu, etc)

Enjoy!


Posted

in

by

Tags: