Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
After a lot of hassles involving a bug in the universal cd, I finally got gentoo 2005.0 x64 installed. I have not used genkernel. I however, prefer not to install ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    6

    Chainloading GRUB


    After a lot of hassles involving a bug in the universal cd, I finally got gentoo 2005.0 x64 installed. I have not used genkernel. I however, prefer not to install GRUB to the MBR. Instead, I install it to the first sector of the boot partition (/dev/hdb1 in my case) and let the Windows XP bootloader chainload it. I also don't have a separate /boot. I boot into the cd, mount the linux partition, swap and proc. I then chroot into the linux partition (/mnt/gentoo), run env-update and source /etc/profile.

    I then create a /boot/grub/grub.conf as follows:

    # Boot automatically after 30 secs.
    timeout 30

    # By default, boot the first entry.
    default 0

    title=Gentoo Linux 2005.0
    root (hd1,0)
    kernel (hd1,0)/boot/linux-2.6.11-r1 root=/dev/hdb1
    splashimage=hd(1,0)/boot/grub/splash.xpm.gz
    grub-install /dev/hdb1 fails, so I run grub and type in the following commands:


    #grub

    Probing BIOS drives blablabla....

    grub> root (hd1,0)
    grub> kernel (hd1,0)/boot/linux-2.6.11-r1 root=/dev/hdb1
    grub> setup (hd1,0)
    grub> quit
    ...
    Successfully installed
    ...
    #
    I then copy the first 512 bytes of the boot partition over to windows as follows:


    # mount /dev/hda6 /mnt/hda6
    # dd if=/dev/hdb1 of=/mnt/hda6/boot.lnx bs=512 count=1
    I then reboot and copy boot.lnx over to my C:. I then appropriately edit my boot.ini as follows:


    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /fastdetect /NoExecute=OptIn
    c:\boot.lnx="Gentoo Linux"
    I then select the new Gentoo Linux option from the boot menu.

    All I get is GRUB on the top of the screen with a blinking cursor after it.

    I have done this numerous times with LILO and Slackware, so I'm likely to be goofing up something either in the grub.conf or in installing GRUB.

    Please help!!!!

    Cheers,
    cgkanchi

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    What's wrong with using Grub as the main boot loader? It is easier to setup than using NTLDR to boot linux, and it looks better imo
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    6
    Heh, don't ask me why. Ever since GRUB fux0red Win2k on my install of RedHat 7.3 or 8 (can't remember which), I have been deeply suspicious of installing GRUB to the MBR. Hell, I don't even trust LILO on there.
    The other reason is, on my system WinXP has to boot. I'm the only person on here using Linux. My parents use WinXP, so XP being unbootable for whatever reason is unacceptable.
    Another thing is, WinXP's fixboot and fixmbr commands (run from the XP CD) don't quite seem to work as advertised, so a quick-fix to messing up a GRUB install isn't available.

    PS: I haven't yet got a satisfactory reply on the gentoo forums where I posted this, so I'd be ecstatic if someone here helped out.

    Cheers,
    cgkanchi

  4. #4
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    personally i have had NO problems WHAT SO EVER with grub.

    i have this:
    Code:
    ###Don't change this comment - YaST2 identifier: Original name: windows###
    title Windows
        root (hd0,0)
        chainloader +1
    as the code in menu.lst to boot windows. That is however on SuSE not gentoo, but it shouldn't b any different between distro's. (just change (hd0,0) to the relevant partition(the /boot partition)
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  5. #5
    Linux Newbie
    Join Date
    Jul 2004
    Location
    Calcutta, India
    Posts
    220
    I really DONT understand if you dont have a separate /boot, where in the world is your boot partition getting mounted ???
    Can you list what are the various Linux partitions on your system with the device name please ???

    For mine, I have 3 linux partitions :
    /dev/hda8 ( boot partition )
    /dev/hda9 ( root or / )
    /dev/hda10 ( swap )

    So I have grub installed on /dev/hda8, and here is my grub.conf :
    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,7)
    #          kernel /vmlinuz-version ro root=/dev/hda9
    #          initrd /initrd-version.img
    #boot=/dev/hda8
    default=0
    timeout=10
    splashimage=(hd0,7)/grub/splash.xpm.gz
    title Red Hat Linux (2.4.20-8)
    	root (hd0,7)
    	kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
    	initrd /initrd-2.4.20-8.img
    title Back to NT Boot Menu
    	rootnoverify (hd0,0)
    	chainloader +1
    title Boot Floppy
            rootnoverify (fd0)
            chainloader +1
    Maybe this will help you, are you sure your boot partition is /dev/hdb1 ?? or is it the root or / partition ??? Bcos if you have a separate boot partition, the grub-install command shud work fine ... At least it does fine on mine.

    Oh .. btw .. I am using RH9 currently.

  6. #6
    Just Joined!
    Join Date
    Apr 2005
    Posts
    6
    That's exactly it. /dev/hdb1 is my root partition as well as my boot partition. Instead of mounting a separate partition as /boot, I just have a /boot directory. This shouldn't ordinarily be a problem, since LILO does just fine in the same situation, as does GRUB when I use it with Yoper.

    Cheers,
    cgkanchi

  7. #7
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by cgkanchi
    That's exactly it. /dev/hdb1 is my root partition as well as my boot partition. Instead of mounting a separate partition as /boot, I just have a /boot directory. This shouldn't ordinarily be a problem, since LILO does just fine in the same situation, as does GRUB when I use it with Yoper.

    Cheers,
    cgkanchi
    With that in mind, your menu.lst would look like:
    Code:
    title Red Hat Linux (2.4.20-8)
       root (hd1,0)
       kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
       initrd /initrd-2.4.20-8.img
    just add the /boot on the front of the kernel image filename.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  8. #8
    Just Joined!
    Join Date
    Apr 2005
    Posts
    6
    Is the root=LABEL=/ necessary, after rtfm'ing some more (and before I saw this post, I modified the /boot/grub/grub.conf to look like this:

    # Boot automatically after 30 secs.
    timeout 30

    # By default, boot the first entry.
    default 0

    # For booting GNU/Linux
    title Gentoo Linux 2005.0
    root (hd1,0)
    kernel /boot/linux-2.6.11-gentoo-r1 root=/dev/hdb1
    Note that I added the /boot part rather than (hd1,0).

    Anyway, I'll try this and let you know.
    Cheers,
    cgkanchi


    UPDATE: Setting root=LABEL=/ didn't work either

  9. #9
    Linux Newbie
    Join Date
    Jul 2004
    Location
    Calcutta, India
    Posts
    220
    I thought about the / and /boot being same too !!! anyway .. I am not sure,
    but I am missing the initrd line in your grub.conf. I am not sure about
    gentoo, does it not use any initrd image ???
    If it uses initrd, then I guess you may have to specify the initrd image file.
    It should be relative to /boot as well, ie., just append /boot in front of the
    initrd image file name.
    [/code]

  10. #10
    Just Joined!
    Join Date
    Apr 2005
    Posts
    6
    As of now, I have not compiled initrd support into the kernel since I wanted a quick and dirty kernel. I would have recompiled after the install. Anyway, the GRUB menu should have come up anyway. Since I don't get a GRUB menu, there's something wrong over there...

    Cheers,
    cgkanchi

Page 1 of 2 1 2 LastLast

Posting Permissions

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