How to Change RAID Array Metadata Version from 1.2 to 0.90 for GRUB Compatibility


2 views

Many Linux administrators encounter this specific requirement when working with GRUB legacy (version 0.97-2.02): the bootloader only supports RAID devices with metadata version 0.90. Modern Linux distributions default to metadata version 1.2 when creating arrays via mdadm, creating compatibility issues.

Yes, but with important caveats. The metadata version can be changed without data loss, but requires:

  • Backup of all critical data
  • Array in inactive state
  • No mounted filesystems
  • Sufficient free space for temporary operations

Here's how to safely convert from 1.2 to 0.90 metadata:

# 1. Stop the array
sudo mdadm --stop /dev/mdX

# 2. Backup superblock information
sudo mdadm --examine --scan > /etc/mdadm/mdadm.conf.backup

# 3. Create temporary array with 0.90 metadata
sudo mdadm --create /dev/mdX --level=5 --metadata=0.90 --raid-devices=3 /dev/sd[abc]1

# 4. Verify metadata version
sudo mdadm --detail /dev/mdX | grep "Version"

Before proceeding:

  • Converting back to 1.2 isn't straightforward
  • Some filesystem features may be incompatible
  • Performance characteristics may change
  • Verify your GRUB version supports this approach

If metadata conversion seems risky, consider:

# Using GRUB2 (if possible)
sudo apt-get install grub-efi

# Creating separate /boot partition
# (non-RAID or with compatible metadata)

After conversion:

# Check boot capability
sudo grub-install /dev/sda
sudo update-grub

# Verify array integrity
sudo mdadm --detail /dev/mdX
sudo fsck /dev/mdX

When dealing with Linux software RAID (mdadm), the metadata version becomes crucial for bootloader compatibility. GRUB legacy (versions before 2.0) specifically requires metadata version 0.90 to properly recognize RAID arrays during system boot. Modern Linux distributions default to metadata version 1.2, creating compatibility issues.

First, check your existing array's metadata version:


mdadm --detail /dev/mdX | grep "Version"
# or alternatively:
cat /proc/mdstat

Typical output for version 1.2 arrays shows "1.2" in the metadata field, while GRUB-compatible arrays should show "0.90".

While metadata version is typically set during array creation, you can change it by reconstructing the array with preserved data. Here's the step-by-step process:


# 1. Stop the array (if active)
sudo mdadm --stop /dev/mdX

# 2. Reassemble with new metadata version
sudo mdadm --assemble /dev/mdX --update=metadata --metadata=0.90 /dev/sd[abc...]

# 3. Verify the change
sudo mdadm --detail /dev/mdX

Some systems may require additional steps:

  • Update mdadm.conf to reflect the new metadata version
  • Regenerate initramfs if the array contains root filesystem
  • Check GRUB installation for proper RAID detection

For root filesystems, consider this additional command sequence:


sudo update-initramfs -u
sudo grub-install /dev/sdX
sudo update-grub

If metadata conversion proves problematic, consider creating a separate small RAID1 array with 0.90 metadata just for /boot:


sudo mdadm --create /dev/mdY --metadata=0.90 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
sudo mkfs.ext4 /dev/mdY
sudo mount /dev/mdY /boot

After making changes, always verify:


# Check metadata version
sudo mdadm --examine /dev/sdX1 | grep "Version"

# Test boot process
sudo reboot