Some of Btrfs's neat features like non-volatile rollback or automatic mounting of degraded Btrfs multi-device (RAID) volumes need a special package from the Arch User Repository called AUR. The package integrates some helpers in the boot process, to handle these features correctly.
- This article assumes that you are creating a fresh install.
- Arch's default mkinitcpio package contains a standard btrfs hook, which is enough to get multi-device (RAID) support. Beside that, the kernel is capable of booting a single-device btrfs root without any hook.
- Be aware of the differences between partitions and sub-volumes.
- Having a separate /boot partition is not supported by AUR
- kexec is used to reload the kernel from the root partition to make sure it is rolled back also.
- /boot can be on a sub-volume within your
Create a snapshot of the current root directory. Creating a snapshot automatically creates a new sub-volume. Name this snapshot
__active. Later on, this will serve as the system's new root directory.
# cd /mnt # btrfs sub-volume snapshot . __active
To use the rollback features of Btrfs, create a
__snapshot directory for snapshot storage.
# cd /mnt # mkdir __snapshot
- The sub-volume and folder names are chosen for compatibility with AUR.
- Different names can be used if later specified in
You can create separate sub-volumes for important directories. This would additionally enable the ability to monitor and adjust the size allocations for each sub-volume using
Next, mount the root sub-volume. See Btrfs#Mount options.
Configure the system
Create a place where you mount the Btrfs root subvolume to create snapshots later.
# mkdir /var/lib/btrfs
/mnt/var/lib/btrfsas we haven't chrooted yet.
/var/lib/btrfs/__activefolder to prevent apps such as 'find' from complaining of any loops.
/var/lib/btrfs/empty /var/lib/btrfs/__active none bind 0 0
Install Arch User Repository.AUR from the
/etc/default/btrfs_advanced as needed and add
btrfs_advanced to the
HOOKS section in
Re-create the initial ramdisk environment. See Mkinitcpio#Image_creation_and_activation
Install and configure a bootloader
Make sure that your Btrfs root is correctly added to the kernel commandline in
/boot/grub/grub.cfg. Using UUIDs for device identification is especially useful for multi-device (RAID) setups, because all Btrfs devices own the same UUID.
To boot from Btrfs using syslinux EFI, you need to setup up a dedicated EFI partition in
/boot/efi. This partition needs to be formated as FAT32 (or HPFS on MacBooks). You need to set up your Syslinux directories on that special partition as described in Syslinux.
/boot/efi/EFI/syslinux/syslinux.cfg make sure your Btrfs root is correctly added to the
APPEND root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff rw