My Notepad

  • My Linux Notes
  • My Grid Notes
  • To do List
  • Thursday, May 28, 2009

     

    Install grub with nvidia RAID

    On a system with onboard Nvidia RAID, I was trying to update from fedora 6 - to fedora 10. To be cautious, I decided to update following the path of fc6->fc7 ->fc8 ->fc9 -> fc10.

    Grub didnt' complain when updating from fc6 to 7, probably because I made a mistake by not having fedora-update repository updated from 6 to 7 on the first reboot. The result was probably grub was updated before kernel.

    But when updating from 7 to 8. The kernel was updated by Yum. In fact, yum found kernel version of fc7 is even newer than fc8, therefore refuse to update kernel for me. That makes me to do it manually, by first remove kernel using "rpm -e ---nodes kernel-xxxxx " ( the reason why I didn't use yum to remove kernel was because I didn't want to remove the large number of dependencies on kernel). When I was doing that, there was some error message about grubby, but despite that, it succeeded. So I carried on with installation of new kernel for fc8 and everything appeared to be fine.

    The problem shown up when I did the reboot. I couldn't get to grub loading page anymore. The system stuck at a dark screen with "GRUB" loading forever. I suddently realized that I don't even have a rescue disk for fedora 8 - the only CD around was installation CD for fc6. Forutnately it turned out FC6 installtation CD was able to boot my system into rescue mode ( I think the resuce bit are all the same for all Fedoras): simply type "linux rescue" on boot prompt then "chroot /mnt/sysimage" once you get hold of a shell.

    Now is the tricky part. On official fedora updating document:
    http://fedoraproject.org/wiki/YumUpgradeFaq#5._Preparing_for_reboot
    It was suggested to reinstall grub after an yum upgrade is done and before a reboot. It was right. If I had done that, I shouldn't have the issue. But how to install grub? The document suggests to run" grub-install /dev/sda".

    I ran that and got message of "dev/sda does not have any corresponding BIOS drive", then I add "--recheck" argument as adviced, but I got message of:
    "grub-install does not support reprobing of device.map when using a device-mapper based boot device...". Basically we are told that grub-install is a crap tool that doesn't support RAID.

    The nice thing is, although grub-install doesn't support RAID, grub does. Since I was using nvidia RAID, i went go /dev/mapper and find following files:

    nvidia_icaeecfg
    nvidia_icaeecfgp1
    nvidia_icaeecfgp2
    nvidia_icaeecfgp3
    ...........

    To check out the partition table, use fdisk /dev/mapper/nvidia_icaeecfg. The table will show which partition is used as "boot", in my case, it appeared to be nvidia_icaeecfgp1.

    At this stage, you might want to try "grub-install /dev/mapper/nvidia_icaeecfg". I did, but as i said, since grub-install doesn't support RAID at all, you basically receive exactly same error message.

    The issue was solved by using grub, type "grub --device-map=/dev/null" and get into grub shell mode:
    grub> device (hd0,2) /dev/mapper/nvidia_icaeecfgp1
    grub> device(hd0) /dev/mapper/nvidia_icaeecfg
    grub> root (hd0,2)
    grub> setup (hd0)

    Then exit grub. The above instructions tell grub to install itself onto the third partition of first harddrive (hd0, 2). If you don't know whether it should be (hd0,0) or something else, you can probably get some useful information from the automatically generated grub.conf, pay attention to the comments. There should be better way of doing this but I am not sure about this one.

    Before rebooting the system, you might also need to manually edit grub.conf. In my case where dual boot was installed, i only see my windows partitino in grub.conf. We need to tell grub where to load the linux partition. A working grub.conf looks like this:


    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You do not have a /boot partition. This means that
    # all kernel and initrd paths are relative to /, eg.
    # root (hd0,2)
    # kernel /boot/vmlinuz-version ro root=/dev/mapper/nvidia_icaeecfgp3
    # initrd /boot/initrd-version.img
    #boot=/dev/mapper/nvidia_icaeecfg
    timeout=5
    splashimage=(hd0,2)/boot/grub/splash.xpm.gz
    hiddenmenu
    title Fedora (2.6.26.8-57.fc8)
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.26.8-57.fc8 ro root=LABEL=/1 rhgb quiet
    initrd /boot/initrd-2.6.26.8-57.fc8.img
    title Windows
    rootnoverify (hd0,0)
    chainloader +1
    ################################

    If you are not sure about the file names of kernel and initrd, you can find them under /boot directory. Now restart the system and enjoy!

    Comments: Post a Comment



    << Home

    Archives

    December 2005   January 2006   February 2006   April 2006   May 2006   June 2006   July 2006   November 2006   February 2007   May 2007   June 2007   November 2007   February 2008   March 2008   April 2008   August 2008   December 2008   March 2009   April 2009   May 2009   June 2009   October 2009   November 2009   December 2009   May 2013  

    This page is powered by Blogger. Isn't yours?