
On Sun, 17 Jun 2012, Avi Miller <avi.miller@gmail.com> wrote:
On 17/06/2012, at 8:21 PM, Russell Coker wrote:
My plan is to break the RAID, convert one of the constituent devices with the btrfs-convert program, and then add the other one via "btrfs device add".
How do I get the new BTRFS device to use RAID-1 for data and metadata? Avi, from your talk I got the impression that this was already possible but the man page doesn't reveal how.
# mkfs.btrfs -m raid1 -d raid1 /dev/sdX
That works if you have empty disk space. But if you are converting from ext3/4 then mkfs isn't the option.
The only way I can do this without some variant of backup/format/restore which involves backing up 260G of data at a time is to convert one half of the RAID to BTRFS and then add the other back in.
With Linux Software RAID-1 it's a standard installation process to install on a degraded RAID array and then insert a second disk to complete the array afterwards. I'd like to do something similar with BTRFS but starting with btrfs-convert.
In the absence of some nifty btrfs-foo, if you're only talking about 260GB and you have a couple of external USB disks and there isn't a particularly high io load you should be able to: 1. break your raid 2. mirror existing RAID onto one of the USB's 3. create BTRFS onto the other original RAID disk and the other USB 4. copy data across 5. remove both USB's (maybe a good test of BTRFS to see how it likes one of its disks disappearing!) 6. tear down the old RAID and add the disk into the BTRFS in place of the now-removed USB If you can handle a temporary lack of redundancy you could use one USB disk and skip step #2. The advantage of doing the above though is that you have a ready-to-go copy of your data in case BTRFS suffers a sudden and unexplained total existence failure while you are putting it through its paces. James