Можно ли преобразовать btrfs RAID5 в RAID6 с теми же дисками без потери данных?

1091
Archimedix

Как мне преобразовать существующую конфигурацию RAID5 (с одинарной четностью) в btrfs в конфигурацию RAID6 с двойной четностью при условии наличия достаточного свободного дискового пространства на тех же дисках без выгрузки данных?

По сути, это просто удаление диска и сохранение диска с резервированием, чтобы btrfs перераспределял все на оставшихся дисках и повторно добавлял этот удаленный диск?

Так каков рекомендуемый процесс?

Я думал что-то вроде

btrfs device delete /dev/sdx /mnt/fs btrfs balance start -dconvert=raid6 -mconvert=raid6 /mnt/fs btrfs device add /dev/sdx /mnt/fs 

Мне даже нужно удалить и добавить диск, или я могу просто преобразовать настройки напрямую? Т.е.

btrfs balance start -dconvert=raid6 -mconvert=raid6 /mnt/fs 
2

1 ответ на вопрос

1
Kayot

https://www.howtoforge.com/a-beginners-guide-to-btrfs-p2

This claims that you can change the raid level on a running array assuming you have enough free space. Make sure you're running the latest stable Linux kernel.

Example (from link): btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

-dconvert is for the data

-mconvert is for the meta file (you want this duplicated, trust me)

the /mnt is where the BTRFS volume is mounted. You can do this unmounted, but I haven't tried and I want to remain honest.

You have raid0, raid1, raid5, and raid6. If you have enough free space, I believe it's n-2 or number of drives [free space] minus 2 for raid6. Though with BTRFS you can get away with less and instead use the data to do the measuring. It's possible to have raid6 like features with less than the acceptable number of drives if you're storing a small amount of data. Possible, but not recommended.

Also note that this will take a while depending on how much data you have on the drives. There is also a small chance of the balance failing and either outright killing the array or putting it into an unstable read only mode. As always, keep backups.

Похожие вопросы