I have a BTRFS RAID-1 filesystem with 2 legs. One disk needs to be replaced because of re-occuring read errors.
Thus, the plan is:
- add a 3rd leg -> result should be: 3 way mirror
- remove the faulty disk -> result should be: 2 way mirror
Thus, I did following steps:
btrfs dev add /dev/new_device /mnt/foo
btrfs balance /mnt/foo
I assume that btrfs does the right thing, i.e. create a 3 way mirror.
The alternative would be to use a balance filter, I guess. But since the filesystem already is a RAID-1 one, that shouldn't be necessary?
I am a bit concerned because a btrfs fi show
prints this:
Before balance start:
Total devices 3 FS bytes used 2.15TiB
devid 1 size 2.73TiB used 2.16TiB path /dev/left
devid 2 size 2.73TiB used 2.16TiB path /dev/right
devid 3 size 2.73TiB used 0.00B path /dev/new_device
During balancing:
Total devices 3 FS bytes used 2.15TiB
devid 1 size 2.73TiB used 1.93TiB path /dev/left
devid 2 size 2.73TiB used 1.93TiB path /dev/right
devid 3 size 2.73TiB used 458.03GiB path /dev/new_device
I mean, this looks like btrfs balances one half of the existing RAID-1 group to a single disk ... right?
Thus, my question, do I need to specify a balance filter to get a 3-way mirror?
PS: Does btrfs even support n-way mirrors? A note in the btrfs wiki says that it does not - but perhaps it is outdated? Oh boy, cks has a pretty recent article on the 2-way limit.