server - Ubuntu 12.04 installation on GPT + RAID going into grub rescue

  • Proy

    I have two 2TB disks. I am installing Ubuntu 12.04 using the alternate version of the server cd. On the partitioning page I have done my partitioning as follows

    /dev/sda1 - 32 MB - bios_grub
    /dev/sda2 - 50 GB -raid device
    /dev/sda3 - 8 GB -raid device
    /dev/sda4 - Balance full GB - raid device

    /dev/sdb1 - 32 MB - bios_grub
    /dev/sdb2 - 50 GB -raid device
    /dev/sdb3 - 8 GB -raid device
    /dev/sdb4 - Balance full GB - raid device

    After this I have setup raid devices
    /dev/md0 for /(/dev/sda2 + /dev/sdb2) for / ext4
    /dev/md1 for swap( /dev/sda3 + /dev/sdb3)for swap
    /dev/md2 for /home(/dev/sda4 + /dev/sdb4)for /home ext4

    The installation finishes it shows that it is installing grub to /dev/sda and /dev/sdb. But once the system reboots it falls into grub rescue> mode. on doing ls I can not see the md devices only hd once.

    I also tried booting into rescue mode with the install cd and doing grub-install /dev/sda and /dev/sdb. What am I doing wrong ? Why is grub2 not detecting the raid revices ?

    UPDATE: I just did the same steps with Ubuntu 10.04 and it worked perfectly fine. I wiped out the RAID and partitions and everything and did it from scratch. I think the issue is with Ubuntu 12.04 and the way it partitions 2 TB disks

  • Answers
  • Huygens

    I'm not sure if this is the correct answer but I tend to put /boot outside LVM or software RAID system. The latest grub2 boot loader might support this (in certain configuration) but this is not completely guarantee.

    Perhaps you could investigate this idea.

    From Wikipedia, about mdadm:

    Since support for MD is found in the kernel, there is an issue with using it before the kernel is running. Specifically it will not be present if the boot loader is either (e)LiLo or GRUB legacy. It may not be present for GRUB 2. In order to circumvent this problem a /boot filesystem must be used either without md support, or else with RAID1. In the latter case the system will boot by treating the RAID1 device as a normal filesystem, and once the system is running it can be remounted as md and the second disk added to it. This will result in a catch-up, but /boot filesystems ought to be small.

  • Fabian Zeindl

    Does your RAID volumes have metadata version 0.9? They don't contain enough information for grub to, p.e., recognize if the entire disk is used for raid or just the last partition on it.

    It's a check they newly built into grub. I had a similar problem and we're working through a bug-report:

  • Related Question

    grub2 - Grub can't find RAID partition in fresh install of 11.04
  • laslowh

    I attempted to install 11.04 on a Dell PowerEdge-R610 that has a LSI SAS1068E-based hardware RAID setup (I think). Installer finishes without a hitch, but upon reboot, it appears that Grub can't find the boot partition and drops to the busybox shell.

    Here is the partition table on the RAID device.

    Disk /dev/sda: 72.7 GB, 72746008576 bytes
    255 heads, 63 sectors/track, 8844 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000d08d6
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        6757    54272000   83  Linux
    /dev/sda2            6757        8845    16765953    5  Extended
    /dev/sda5            6757        8845    16765952   82  Linux swap / Solaris

    And here is the Grub script as produced by the installer. The msdos stuff looks fishy to me. (Please note, this was typed by hand and may contain typos.)

    setparams 'Ubuntu, with Linux 2.6.38-8-generic'
    set gfxpayload=$linux_gfx_mode
    insmod part_msdos
    insmod ext2
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 22f9995f-8060-4893-9b9a-bed1d2635384
    linux /boot/vmlinux-2.6.38-8-generic root=UUID=22f9995f-8060-4893-9b9a-bed1d2635384 ro   quiet splash vt.handoff=7
    initrd /boot/initrd.img-2.6.38-8-generic

    Any thoughts on how to get this working?

  • Related Answers
  • laslowh

    After baning my head against this server for a few days, it turns out the magical incantation was simply to add "rootdelay=90" to the kernel command in the Grub menu. It simply wasn't waiting long enough for the RAID controller to initialize.