Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#473 closed defect (fixed)

grub install on raid1 partitions fails

Reported by: chucky Owned by: Bruno Cornec
Priority: normal Milestone: 3.0.2
Component: mondo Version:
Severity: normal Keywords:


If booting partition is an RAID-1 partition set, grub install fails. I think it is because mdadm creates array with 1.2 superblock by default (in create_raid_device_via_mdadm, while formatting that partition on restore), and grub 0.97 can't access files on partition with superblock >= 1.0. An additional parameter specifying version of sb for mdadm: "-e 0.90" can fix this.

Change History (8)

comment:1 by Bruno Cornec, 13 years ago

Status: newassigned

The question for me is how to pass that parameter. Should we force the -e 0.90 all the time ?

Or is there a way to query it at backup time ?

Looks strange that grub in one distro is unable to read what the distro creates by default with mdadm :-(

comment:2 by chucky, 13 years ago

It seems ( that versions of mdadm above 3.1 don't have 0.9 default metadata version anymore. Probably new distros which don't use grub 2 yet will have this issue.

comment:3 by Bruno Cornec, 13 years ago

It seems that we can query that info from the device:

sudo mdadm --detail --scan /dev/md0
        Version : 0.90
  Creation Time : Sat Apr  3 14:25:45 2010
     Raid Level : raid1
     Array Size : 12281536 (11.71 GiB 12.58 GB)
  Used Dev Size : 12281536 (11.71 GiB 12.58 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sat Jun 25 17:52:58 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 73055c86:5a2fc4d5:04894333:532a878b
         Events : 0.145222

    Number   Major   Minor   RaidDevice State
       0       8        5        0      active sync   /dev/sda5
       1       8       21        1      active sync   /dev/sdb5

So it should be indeed possible to store that value and then if 0.90 to restore it. Now it should be even asked to the user, as he may well want to update the structure at the same time :-(

Could we set up an environment variable like MDADMVER to 0.90 (user can do it before launching mondorestore) and use that at restore time. Would that cover your need ?

comment:4 by Bruno Cornec, 13 years ago


comment:5 by Fabio, 12 years ago

Same problem with Red Hat Entreprise Linux 6.2 The system is correctly restored but Grub fail to install. the metadata version 1.2 is not supported by rhel grub.

comment:6 by chucky, 12 years ago

I think mondo should set this parameter (-e 0.90) when:
1) It detects that system boots from Raid-1 and grub bootloader is used. Otherwise it won't boot which is bad.

And shouldn't set if:
1) mdadm version is less than (?). Probably older mdadms don't support this parameter and will fail.
2) system don't boot from raid-1 partition, then it should respect original version settings (if that version can be queried on all versions of mdadm). Probably, no version parameter will be ok.

comment:7 by Bruno Cornec, 12 years ago

Resolution: fixed
Status: assignedclosed

At the moment where mondorestore creates the md devices, it doesn't really know what is the bootable partition. So I took the option to force mode 0.90 if grub 0.9x was used, and if the partition is a raid partiion named / or /boot. That should cover most cases.

This is in rev [2928] and will be in version 3.0.0 which should be out end of this week or end of year at the latest.

comment:8 by Bruno Cornec, 12 years ago


metadata are now restored as they were originally with rev [2991]. Will be in 3.0.2.

Note: See TracTickets for help on using tickets.