Can you change the metadata version on an existing array?

Solution 1:

This information is probably too late to help the OP, but maybe it will help someone else.

The first command wipes the super blocks and the second command creates a new array but assumes the devices are clean. I have just performed this and everything appears to be OK. I would definitely recommend a backup before doing this. I had no data to lose and therefore no integrity to check. I just wanted to avoid another 4 hour resync.

$ mdadm --zero-superblock /dev/sd[a-z]1
$ mdadm --create /dev/md0 --assume-clean \
    --level=10 --raid-devices=10 /dev/sd[a-z]1 --metadata=0.90

Solution 2:

Creating an array with assume-clean and inconsistent metadata as suggested above certainly has potential to damage existing data, as 0.90 and 1.2 metadata blocks not only differ in size but also location.

it may work for 0.90 <-> 1.0, which is an exception.

https://raid.wiki.kernel.org/index.php/RAID_superblock_formats


Solution 3:

The GRUB wiki confirms:

Also, (as of 1.96+20080724) GRUB can only boot from RAID which uses a Version 0.90 metadata superblock (i.e. one created with the --metadata=0.90 option to mdadm).

Curiously, the man page for mdadm says

-e , --metadata=

Declare the style of superblock (raid metadata) to be used. The default is 0.90 for --create, and to guess for other operations.

I'd double check with mdadm -Q -D <device> to be certain.

After that, What RAID level are you running? The best scenario I can think of for a mirror (RAID 1) would be

  1. Take backups
  2. Unmount array 0
  3. Remove device A from array 0 of n devices
  4. Zero superblock on device A
  5. Create array 1 using device A and n-1 spares, explicitly using old superblock format
  6. Repeat for remaining B through n-1 devices
  7. (Optional) re-number the array

... but very definitely check that you absolutely need to go through with this!