I converted my 3-disk RAID5 to RAID6 with :
mdadm --grow /dev/md1 --level=6 --layout=preserve --force
The change was immediate, (no rebuilding - there was no extra device, it was still 3 drives), but now naturally the array will not assemble without --run because it wants 4 drives.
So now I want to turn it back to RAID5.
I tried
mdadm --grow /dev/md1 --level=5
and mdadm replies:
mdadm: failed to set raid disks
Is there a way to undo my mistake? Thanks.
Additional info: I think that I remember my previous configuration was with 64K chunk size, I am not absolutely sure. I have tried to add an old (unreliable) disk to the array but after hours of syncing and booting various versions of ubuntu I have removed it again and I may have rearranged the layout of the disks on the controller, again I am not sure in what way.
then it became like this:
/dev/md1:
Version : 01.02
Creation Time : Mon Jul 23 16:24:43 2012
Raid Level : raid6
Array Size : 5782407168 (5514.53 GiB 5921.18 GB)
Used Dev Size : 5782407168 (5514.53 GiB 5921.18 GB)
Raid Devices : 4
Total Devices : 3
Preferred Minor : 1
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Fri Apr 10 15:00:05 2015
State : active, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : :New RAID Array
UUID : 89e8e508:dc49a4d7:8ccdb79f:7d5b4d5d
Events : 102194
Number Major Minor RaidDevice State
4 8 18 0 active sync /dev/sdb2
5 8 34 1 active sync /dev/sdc2
2 0 0 2 removed
6 8 2 3 active sync /dev/sda2
how is it that the chunk size is now 512K when the original was 64K? is it because of the sync? can I turn the array back to raid5 with
mdadm --create -l 5 -n 3 --assume-clean /dev/sdb2 /dev/sdc2 /dev/sda2
or perhaps without --assume-clean and replacing /dev/sda2 with missing, and add it back later if that works? And if I do should I use 64K or 512K chunk size?