Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Trouble installing grub on RAID array

  1. #1
    Join Date
    Apr 2007
    Beans
    107

    Trouble installing grub on RAID array

    I'm trying to switch to a new RAID5 array but can't get it to boot. My disks:
    1. /dev/sda: new RAID member
    2. /dev/sdb: Windows disk
    3. /dev/sdc: new RAID member
    4. /dev/sdd: old disk, currently using /dev/sdd3 as /


    The RAID array is /dev/md0, which is comprised of /dev/sda1 and /dev/sdc1. I have copied the contents of /dev/sdd3 to /dev/md0, and can mount /dev/md0 and chroot into it. I did this:

    Code:
    sudo mount /dev/md0 /mnt/raid
    sudo mount --bind /dev /mnt/raid/dev
    sudo mount --bind /proc /mnt/raid/proc
    sudo mount --bind /sys /mnt/raid/sys
    sudo chroot /mnt/raid
    update-grub
    grub-install /dev/sda
    This completes with no errors, and /boot/grub/grub.cfg looks correct [EDIT: No it doesn't. It has root='(md/0)' instead of root='(md0)']. For example, here's the first entry:

    Code:
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.35-25-generic' --class ubuntu --class gnu-linu
    x --class gnu --class os {
    	recordfail
    	insmod raid
    	insmod raid5rec
    	insmod mdraid
    	insmod part_msdos
    	insmod part_msdos
    	insmod ext2
    	set root='(md/0)'
    	search --no-floppy --fs-uuid --set a928b10f-bc3a-43ea-a4e2-49b073a8375d
    	linux	/boot/vmlinuz-2.6.35-25-generic root=UUID=a928b10f-bc3a-43ea-a4e
    2-49b073a8375d ro   quiet splash
    	initrd	/boot/initrd.img-2.6.35-25-generic
    }
    The UUID a928b10f-bc3a-43ea-a4e2-49b073a8375d is /dev/md0.

    However, when I try to boot from /dev/sda, I get:

    Code:
    error: file not found
    grub rescue>
    Last edited by parsim; February 5th, 2011 at 01:35 AM.

  2. #2
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Trouble installing grub on RAID array

    I may be wrong but I don't think Grub supports any RAID level other than 1. So I think you need to make a separate boot partition. As you are using two drives you could make a RAID 1 for Grub so you can boot off either HD.

  3. #3
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    I think that's the case for legacy grub. I should have said I'm using grub-pc, which does support RAID5 (and was working fine on a test array I built earlier).

  4. #4
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    Type set at the rescue prompt and see what root is set to. Also check what drives ls detects.

  5. #5
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Trouble installing grub on RAID array

    Yes you are right. I picked up some out of date info from somewhere. Just out of interest, would grub-install /dev/md0 also work?

  6. #6
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by psusi View Post
    Type set at the rescue prompt and see what root is set to. Also check what drives ls detects.
    Thanks! Here's the output:
    Code:
    grub rescue> set
    prefix = (md/0)/boot/grub
    root = md/0
    grub rescue> ls
    (md/0) (hd0) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos3) (hd1,msdos2) (hd1,msdos1) (hd2) (hd2,msdos1) (hd3) (hd3,msdos2) (hd3,msdos1)
    So I'm very interested to see an extra slash in "md/0". My array is /dev/md0, not /dev/md/0.

    Re: the output of "set", /dev/sda and /dev/sdc have two partitions each (main + swap) while /dev/sdd has three partitions and /dev/sdb has whatever Windows does (one?).

  7. #7
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    The naming is kind of odd. What do you get from ls (hd/0)/boot/grub?

  8. #8
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Thanks again for the help.

    Not much from that command:
    Code:
    > ls (hd/0)/boot/grub
    error: no such disk
    I thought maybe that was a typo so tried some variations.
    Code:
    > ls (hd0)/boot/grub
    error: unknown filesystem
    > ls (hd0,0)/boot/grub
    error: no such partition
    > ls (md/0)/boot/grub
    
    error: file not found
    > ls (md0)/boot/grub
    error: no such disk
    > ls (hd1,msdos3)/boot/grub
    <long list of files from /dev/sdd3>
    > ls (md/0)/
    That last command just produced a blank line.

  9. #9
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Trouble installing grub on RAID array

    Code:
    brian@bU10:/media$ sudo mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc missing
    mdadm: array /dev/md0 started.
    brian@U10:/media$ sudo grub-install /dev/md0
    Installation finished. No error reported.
    Says it works.

  10. #10
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    Oops, I meant md, not hd. Can you run the boot info script and post the results?

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •