LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Software RAID, Ubuntu, and Grub problem (https://www.linuxquestions.org/questions/linux-server-73/software-raid-ubuntu-and-grub-problem-472206/)

rookiepaul 08-09-2006 02:04 AM

Software RAID, Ubuntu, and Grub problem
 
Hi Guys,

Yesterday I attempted to install Ubuntu 6.06 server on my Dell Poweredge 2400. My hardware RAID controller is broken, so on the Ubuntu partitioning manager I created a software RAID-0 array. Everything installs fine until I get to the boot loaders. Neither GRUB nor LILO would install, so I carried on without a bootloader install. The machine rebooted after it had finished installed and eventually I got to the GRUB> prompt, from where I have no idea what to do. I had a look on the net and I've found out that it is a problem with software RAID and grub, they don't like each other apparently.

Can anyone suggest a way I can get GRUB onto this system, or an alternative?

Much appreciated.

Rookie.:Pengy:

jschiwal 08-09-2006 02:26 AM

If you got to the grub prompt that is a good sign. You could try loading in the kernel and initrd file and try to boot. If that works, then there isn't a raid/grub problem.
Enter in the shell:
kernel (
Then hit the tab key for the possible options if you don't know which partition and directory the kernel is located.
It might look like:
kernel (sd0,0)/boot/vmlinuz
Do the same for initrd and then enter the "b" key to boot.

hamish 08-09-2006 02:56 AM

Is your boot partition on RAID 0?

I'm sure I remember something about not being about to boot from a RAID 0 array.

Hamish

rookiepaul 08-09-2006 05:04 AM

Cool, I will try that jschiwal. Do you know of anyway of getting GRUB onto a software RAID-0 or is it impossible?

jschiwal 08-09-2006 06:16 AM

According to this wiki, grub accesses the drives directly so you need to use raid1 for the boot partition.
http://www.gentoo-wiki.com/HOWTO_Gen..._Software_RAID

On this wiki, they installed grub onto both drives of a raid-1 partition. You could instead not have the first partition on both drives be used by raid at all. Make two small (hd0,0) partitions on both drives. Install grub onto one. Use the second as a backup of /boot. Then the rest of the drives could be used for raid.

nedharkey 11-02-2007 02:31 PM

Fix the GRUB boot loader on your RAID drive(s).
 
To fix a non-bootable system and ensure GRUB is installed on both drives, manually install GRUB as follows:

* Reboot the machine from the original Linux CDROM
* From the Linux boot menu, select “Rescue a broken system”
* Continue through the prompts until the screen “Device to use as a root file system” appears
* Press Alt-F2 to switch to a second console screen then press Enter to activate it.
* Mount the md0 RAID device and use chroot and grub to install the bootloader onto both sda and sdb using the following commands

mount /dev/md0 /mnt
chroot /mnt
grub
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
device (hd1) /dev/sdb
root (hd1,0)
setup (hd1)
quit

* Reboot the system with command “shutdown -r now”, remove the CDROM and allow the system to boot from the hard drive.

heson 11-04-2007 02:58 AM

I have never succeded in doing a proper software raid for /boot (raid1 works fine, but I think it boots without activating the second drive until the kernel is running)
To have a soft raided / (root) the only thing you need is to make sure the initrd has the raid-modules in it (use mkinitrd if the instaler fails to fix it for you) My systems always have a 100MB /boot partition (with raid1 or dd-mirrored if its an important system)

On realy tricky hardware Ive borrowed a drive from another system to boot on, fix partitions and raids, then rsync the os intoplace from the borrowed drive (doing a few edits of grub.conf/menu.lst and fstab after the cloning) This method is effective if I need to compile a custom kernel to even boot on hardware (sometimes with very new mobo)

weiyuanw 08-21-2008 10:09 PM

Failed to fix the GRUB boot loader on RAID drive.
 
I followed the instructions on "Setting up software RAID in Ubuntu Server" (posted on April 24th, 2007 by Derrick Webber at the advosys.ca site) and created RAID1 with 2 hard disks. The Ubuntu 8 Server system are installed on RAID1 and rebooted successfully. But when I tried to load the GRUB boot loader onto the second disk with these steps,

--
* Reboot the server from the original Ubuntu Server CDROM
* From the Ubuntu boot menu, select “Rescue a broken system”
* at the screen “Device to use as a root file system” appears
* Press Alt-F2 to switch to a second console screen then press Enter to activate it.
* then the following commands.

I received an error:

mount /dev/md0 /mnt
chroot /mnt
grub
device (hd0) /dev/sd
Error: Device not found.

device (hd1) /dev/sdb
Error: Device not found.
--

Can anyone help?

Robert_SK 08-22-2008 03:32 PM

I managed to do all the steps in the grub installation without any errors, byt it did not work for me. When I rebooted, I just got the grub> prompt and the system did not boot.

Robert_SK 08-22-2008 03:35 PM

Quote:

Originally Posted by weiyuanw (Post 3255542)
I received an error:

mount /dev/md0 /mnt
chroot /mnt
grub
device (hd0) /dev/sd
Error: Device not found.

device (hd1) /dev/sdb
Error: Device not found.
--

Can anyone help?

I also came accross this very problem. The reason is that you are missing /dev/sda and /dev/sdb entries. Just make them with mknod and you are all set. The syntax is:

mknod /dev/sda b <major> <minor>
mknod /dev/sdb b <major> <minor>

Copy the <major> and <minor> from your rescue's system /dev directory.


All times are GMT -5. The time now is 06:09 PM.