Install Debian wheezy and jessie directly with btrfs RAID1

Some time ago, I provided an installation report for installing Debian wheezy onto a btrfs RAID1 filesystem.

It is not supported directly from the installer partitioning menu partman, but it is not hard to trick the installer to do it, as described in the bug report.

I believe this may be a worthy release goal for Debian 8 (jessie), but it is not something I can commit to facilitate myself so I am sharing my experience with it for those who may want to volunteer.

Anybody wanting to test it can easily do so with VirtualBox if they don't want to dedicate a real machine to it or if they don't have two real disks in their test machine. My own testing simply involved creating two VirtualBox virtual disks on a single SATA disk.

Procedure

Here is an abbreviated version of the procedure from the installation report linked above.

Run the Debian installer as normal up to the partitioning menu

Use manual partition mode

Create one big btrfs partition on one HDD (either on a raw partition or on an LV)

Designate the partition on one disk as the root FS, designate the partition on the other as unused/unformatted.

Continue through the setup, installing to one disk

After rebooting into Debian, follow these steps to add the other disk into a RAID1

A variation of this procedure is to use a shell while the installer is running to make the RAID1 during the installation and observe whether /etc/fstab is created correctly.

Potential gotchas: is the default fstab sufficient or does it need to be modified after the conversion to RAID1? Does the initframfs need to be regenerated (and potentially modified by hand?) to make it work?

Issues to be discussed / resolved

Mixing BTRFS filesystems with Logical Volume Management - how many permutations should the installer support? What do people expect/need/require?

How to boot if a disk fails? Can grub boot from either?

Warning the user when the FS detects instability or failure in either disk