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:
- /dev/sda: new RAID member
- /dev/sdb: Windows disk
- /dev/sdc: new RAID member
- /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>
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.
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).
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.
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?
Re: Trouble installing grub on RAID array
Quote:
Originally Posted by
psusi
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?).
Re: Trouble installing grub on RAID array
The naming is kind of odd. What do you get from ls (hd/0)/boot/grub?
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.
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.
Re: Trouble installing grub on RAID array
Oops, I meant md, not hd. Can you run the boot info script and post the results?