Debian Wheezy on btrfs root

I was able to install Wheezy using kernel version 3.0 on a multi-device (RAID-1) btrfs filesystem, booting with GRUB 2 version 1.99 without an ext3/4 boot partition.

The Debian installer refuses to install to a btrfs root without a boot partition, and doesn't know how to create a multi-device btrfs FS. So I installed onto a third HD with a boot partition and single-device FS. Then I booted from a LiveCD, partitioned my other HDs (with gdisk), created my new FS (mkfs.btrfs -m raid1 -d raid1 -L btrfs_root /dev/sda3 /dev/sdb3), mounted the btrfs_root FS and the root and boot FSs created by D-I, and copied the entire system (with cp -a) onto the new FS. I bind mounted dev, proc and sys on the new FS and chrooted into it. I edited /etc/fstab to specify the correct UUID for the new FS as root, and to disable fsck on this FS (there's no fsck.btrfs yet). I edited /etc/default/grub to set GRUB_CMDLINE_LINUX=“rootflags=device=/dev/sda3,device=/dev/sdb3” (without this, the system can't boot). Then ran update-grub and ran grub-install against /dev/sda and /dev/sdb.

That was enough. The system boots properly and everything works. I also spent a lot of time trying to put the root FS in a subvolume for easy snapshotting, but without success. That was before I discovered the rootflags kernel option so maybe it would have worked had I tried that.

Btrfs and the btrfs-tools seem solid and reliable, but Debian's support for them lags behind a little.

blog/debian_wheezy_on_btrfs_root.txt · Last modified: 2011/09/01 17:31 by phil
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki