Saturday, May 8, 2004

Some tips to (re)install grub on an HP ProLiant server

HP Logo Yesterday I needed to fix the MBR of a ProLiant (Red Hat Enterprise
Linux 2.1) by reinstalling grub and grub-install just won't work.
grub-install assumes that the boot device is in the form /dev/hda or
/dev/sda and since most ProLiant use a SmartArray RAID controller its
boot device is typically /dev/cciss/c0d0.

So, in order to recover this is what I did:

* In /etc/grub.conf (a link to /boot/grub/grub.conf) uncomment the
line that looks like this:


boot=/dev/cciss/c0d0


* Make sure /boot/grub/device.map is setup right and looks like this:


(fd0) /dev/fd0
(hd0) /dev/cciss/c0d0


* Run grub like this:


/sbin/grub --batch --device-map=/boot/grub/device.map
--config-file=/boot/grub/grub.conf --no-floppy
grub> root (hd0,0)
grub> setup (hd0)
grub> quit


Hope that helps!

21 comments:

  1. Thanks for the tip! It really saved my bacon with a new install of Fedora Core 3/64-bit on a dl585 with Smart Array 5i controller. Grub was not properly configured after the initial install and had to be recovered using your procedure.

    ReplyDelete
  2. Same here. Fedora misconfigured Grub during install, you just saved me from hours of debugging this over those extra-long boot times... Thanks! ;-)

    ReplyDelete
  3. Thanks for the tips. It really helps. :)

    ReplyDelete
  4. really appreciated

    ReplyDelete
  5. Thanks a tone. It saved lot of my time.

    ReplyDelete
  6. As previously stated, thanks a ton. The GRUB documentation is a little light on what do with SCSI arrays, I had to dig thru google for a good hour before finding your post... :-)

    ReplyDelete
  7. Thanks for the tip, it was a life saver!

    ReplyDelete
  8. Thanks a lot. Helped me solved a REALLY big problem with one of our servers.
    Nearly saved my life too !

    ReplyDelete
  9. Tank you... this install de grub but after boot it show this message:
    root (hd0,0)

    Filesystem type is ext2fs, partition type Ox83

    kernel (hd0,0)/kernel-genkernel-x86_64-2.6.14-gentoo-r2 root=/dev/ram0 ramdisk=8192 real_root=/dev/cciss/c0d0p3 init=linuxrc udev doscsi
    [ Linux -bzImage,setup=0x1e00,size=0x22688e]
    initrd (hd0,0)/initramfs-genkernel-x86_64-2.6.14-gentoo-r2

    [Linux-initrd@0xdfe8b000, 0x157141 bytes]

    error 28: select itemcannot fit into memory

    press any key to continue...

    I have an 2 x 3.2 Xeon x96_84 with 4 x 1Gb RAM and Smart Array (RAID 5)

    ReplyDelete
  10. Matias,

    The line: "error 28: select item cannot fit into memory" is the error message you need to follow up on.
    I'd poke around your kernel configuration to make sure it can support that large memory.

    -marc

    ReplyDelete
  11. Thanks, this tip was a lifesaver. I had EXACTLY the same problem and the fix worked perfectly.

    -- Steve

    ReplyDelete
  12. I have the exact same problem - however I have still not found a solution. I have tried several initrd files and get the dreaded error 28 each and every time.

    What exactly is it that I need to change in the kernel ?

    ReplyDelete
  13. Thanks for this - dead handy and saved me lots of messing about!

    ReplyDelete
  14. Thanks a lot, save my time too :)

    ReplyDelete
  15. Thx a lot also saved me loads of time trying to install Grub on Gentoo with an HP ProLiant DL380 G5. I can't belive that this bug has not been fixed.


    Cheers Simon

    ReplyDelete
  16. There is an easier way where you don't need to edit any files. This works great in a script, but can be done on the command line as well

    /sbin/grub --batch /dev/null 2>/dev/null
    device (hd0) /dev/cciss/c0d0
    root (hd0,0)
    setup (hd0)
    quit
    EOT

    ReplyDelete
  17. Somehow not all of the first line showed up it should be

    /sbin/grub --batch /dev/null 2>/dev/null
    device (hd0) /dev/cciss/c0d0
    root (hd0,0)
    setup (hd0)
    quit
    EOT

    ReplyDelete
  18. Thanks! This is very useful

    ReplyDelete
  19. @JimmyV: Thanks for your shorter solution!

    ReplyDelete
  20. Wow, 6 years later and Redhat still can't configure the boot loader right for HP Proliant servers.
    This helped me too!
    I guess HP Proliant servers aren't very poplular, so getting support for them is a bit of a long shot X-D

    ReplyDelete
  21. Thank for your article!
    After installation Redhat EL 5 update 7 on blade server bl460 g7 with P712m card for external SAS storage, there is appear error message "Attempting boot from hard drive (C:)"

    I booted to rescue mode (after that i changed root to /mnt/sysimage: chroot /mnt/sysimage) and device.map has two records:
    (hd0) /dev/cciss/c0d0 - this external controller
    (hd10) /dev/cciss/c1d0 - this internal controller

    When i tried to install grub to internal controller it's show error:
    grub-install /dev/cciss/c1d0
    The file /boot/grub/stage1 not read correctly.

    So i tried your method, and i have error when i run root (hd10,0) command:
    root (hd10,0)
    Error 12: Invalid device requested

    So what i did is just removed external controller from device.map and change internal controller to (hd0)
    (hd0) /dev/cciss/c1d0

    After that in /boot/grub/grub.conf file, i changed all (hd10,0) to (hd0,0).

    And install grub to internal controller /dev/cciss/c1d0
    grub-install /dev/cciss/c1d0

    That's all, i hope it will be helpful for somebody, and sorry for my English :).

    ReplyDelete