1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

grub problem

Discussion in 'Installing Linux' started by ThunderRd, Jul 27, 2013.

  1. ThunderRd

    ThunderRd Irreverent Query Chairman Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    1,896
    Likes Received:
    68
    Trophy Points:
    48
    Location:
    Northern Thailand, the Land of Smiles
    Home page:
    I've suddenly got a glitch with grub.

    The box runs Gentoo on the boot drive, and siduction on another drive. It boots to the grub menu on the Gentoo drive, and has a chainloader line to allow me to boot to siduction if I want to, using the grub that is installed on the siduction drive.

    This has always worked perfectly, but some recent update must have changed something. Gentoo boots fine, but if I want siduction I get error 13s and no media found after selecting it in the grub menu. I thought perhaps that the hd(x,x) designation in the chainloader line had mysteriously changed, so I played around with that for awhile. It appears that hd(3,0) is most likely the correct one, but when I attempt to boot to it grub dumps me to the GRUB command line, and beeps continuously.

    If I change the boot order in the BIOS, and boot to the siduction disk, everything is fine, so it isn't a hardware problem. Something is wrong with the chainloader lines in the menu, but I'm not sure what it could be. Maybe a drive has to be mapped to another one in grub?

    Following are the pertinent grub files for both drives [notice siduction runs grub2]:

    Gentoo, /boot/grub/grub.conf:
    Code:
    # /boot/grub.conf
     
     
    default 0
    timeout 3
    #splashimage=(hd0,0)/boot/grub/splash.xpm.gz
    #splashimage=(hd0,0)/boot/grub/grubamd64.xpm.gz
    splashimage=(hd0,0)/boot/grub/grub_gentooframe-splash.xpm.gz
     
     
    ##########################################################################
    # Framebuffer options: this line is an example for vesafb instead of uvesafb. Using vesafb requires kernel changes and rebuilding.
    # kernel /boot/linux-3.6.2-ck root=/dev/sda4 rootfstype=ext4 video=vesafb:ywrap,mtrr:2 vga=791
    ###################### Installed Linux Kernels below #######################
     
     
    title Gentoo Linux 3.9.11-ck [ck-sources - "BFS"]
    root (hd0,0)
    kernel /boot/linux-3.9.11-ck root=/dev/sda4 rootfstype=ext4 video=uvesafb:1280x1024-32@60,mtrr:3,ywrap
    #(for hwmon chip error) acpi_enforce_resources=lax
     
    title Gentoo Linux 3.9.11-ck (rescue)
    root (hd0,0)
    kernel /boot/linux-3.9.11-ck root=/dev/sda4 rootfs=ext4 init=/bin/bb video=vesafb:ywrap,mtrr:1 vga=ask
     
     
    title Gentoo Linux 3.9.2-ck [ck-sources - "BFS"]
    root (hd0,0)
    kernel /boot/linux-3.9.2-ck root=/dev/sda4 rootfstype=ext4 video=uvesafb:1280x1024-32@60,mtrr:3,ywrap
    #(for hwmon chip error) acpi_enforce_resources=lax
     
    title Gentoo Linux 3.9.2-ck (rescue)
    root (hd0,0)
    kernel /boot/linux-3.9.2-ck root=/dev/sda4 rootfs=ext4 init=/bin/bb video=vesafb:ywrap,mtrr:1 vga=ask
     
     
    ###########################################################################
     
    title OTHER LINUX OS
    title siduction linux [towo~ kernel sources, current version]
    root (hd3,0)
    chainloader +1
    
    siduction, /boot/grub/grub.cfg:
    Code:
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
     
    ### BEGIN /etc/grub.d/00_header ###
    set default=0
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=800x600
      set gfxpayload=1024x768
      insmod gfxterm
      insmod vbe
      if terminal_output gfxterm ; then true ; else
        # For backward compatibility with versions of terminal.mod that don't
        # understand terminal_output
        terminal gfxterm
      fi
    fi
    set locale_dir=/boot/grub/locale
    set lang=en
    insmod gettext
    set timeout=3
    ### END /etc/grub.d/00_header ###
     
     
     
    ### BEGIN /etc/grub.d/05_debian_theme ###
    insmod ext2
    set root=(hd0,5)
    search --no-floppy --fs-uuid --set 398f0e4f-f106-4c06-a55a-545874d3d00c
    insmod tga
    if background_image /thunderrd/images/grub/Plasma-lamp.tga ; then
    #  set color_normal=black/black
      set color_normal=white/black
    #  set color_highlight=magenta/black
      set color_highlight=cyan/black
    else
      set menu_color_normal=cyan/blue
      set menu_color_highlight=white/blue
    fi
    ### END /etc/grub.d/05_debian_theme ###
     
     
     
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "siduction Linux, with Linux 3.8-2.towo-siduction-amd64" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux    /boot/vmlinuz-3.8-2.towo-siduction-amd64 root=UUID=e0d40967-7e27-4be5-8b08-8677abfe9e17 ro
        initrd    /boot/initrd.img-3.8-2.towo-siduction-amd64
    }
    menuentry "siduction Linux, with Linux 3.8-2.towo-siduction-amd64 (recovery mode)" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux    /boot/vmlinuz-3.8-2.towo-siduction-amd64 root=UUID=e0d40967-7e27-4be5-8b08-8677abfe9e17 ro single
        initrd    /boot/initrd.img-3.8-2.towo-siduction-amd64
    }
    menuentry "siduction Linux, with Linux 3.8-0.towo.1-siduction-amd64" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux    /boot/vmlinuz-3.8-0.towo.1-siduction-amd64 root=UUID=e0d40967-7e27-4be5-8b08-8677abfe9e17 ro
        initrd    /boot/initrd.img-3.8-0.towo.1-siduction-amd64
    }
    menuentry "siduction Linux, with Linux 3.8-0.towo.1-siduction-amd64 (recovery mode)" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux    /boot/vmlinuz-3.8-0.towo.1-siduction-amd64 root=UUID=e0d40967-7e27-4be5-8b08-8677abfe9e17 ro single
        initrd    /boot/initrd.img-3.8-0.towo.1-siduction-amd64
    }
    ### END /etc/grub.d/10_linux ###
     
     
     
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod ext2
        set root=(hd0,1)
        search --no-floppy --fs-uuid --set e0d40967-7e27-4be5-8b08-8677abfe9e17
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
     
     
     
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Gentoo Linux 3.9.11-ck [ck-sources - "BFS"] (on /dev/sdb4)" {
        insmod ext2
        set root=(hd1,1)
        search --no-floppy --fs-uuid --set d532e93f-5922-45f4-967d-6d351770f0dc
        linux /boot/linux-3.9.11-ck root=/dev/sda4 rootfstype=ext4 video=uvesafb:1280x1024-32@60,mtrr:3,ywrap
    }
    menuentry "Gentoo Linux 3.9.11-ck (rescue) (on /dev/sdb4)" {
        insmod ext2
        set root=(hd1,1)
        search --no-floppy --fs-uuid --set d532e93f-5922-45f4-967d-6d351770f0dc
        linux /boot/linux-3.9.11-ck root=/dev/sda4 rootfs=ext4 init=/bin/bb video=vesafb:ywrap,mtrr:1 vga=ask
    }
    ### END /etc/grub.d/30_os-prober ###
     
     
     
    ### BEGIN /etc/grub.d/40_custom ###
     
     
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    
  2. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,081
    Likes Received:
    118
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    Did you try reinstalling your gentoo grub? Maybe there was a grub update and you are booting from an older grub boot-sector with a newer grub version? I don't use chainboot so I'm afraid I'm not any help.
  3. ThunderRd

    ThunderRd Irreverent Query Chairman Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    1,896
    Likes Received:
    68
    Trophy Points:
    48
    Location:
    Northern Thailand, the Land of Smiles
    Home page:
    Everything is properly installed.

    Chainloading is insanely simple; the root (x,x) simply tells the boot grub where the secondary disk grub is. Then it continues by booting the second system from that one. It works well when you want to add a disk with an OS already on it, and you want to easily multiboot to it. You don't need to make any adjustments to the second grub do do it.

    I am clearly missing something really simple, so I went back to the basic stuff. I booted the machine, and selected siduction from the menu. Then I used the edit function, and got the line 'root (hd3,0)'. I backspaced to the '3' and hit the tab key for autocomplete. It showed me the possible continuations: 3,0 3,4 3,5. Right. That is the correct drive: 3,0 is /, 3,4 is /home, and 3,5 is swap. No separate /boot in this install. Type in the 3,0, because that is where /boot/grub would be. Press 'b' to boot...and meh. The same thing; a grub prompt and continuous beeps, and a locked box.

    OK, go back, change the BIOS to boot from the siduction drive, and everything works as it should.

    wtf. I must be losing the plot.
  4. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,699
    Likes Received:
    113
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    By any chance did you change your drive order ie connect SDA to where SDB use to be, switching drive connections has screwed me in the past. Other that this I've never figured out why Grub craps out on me...sigh
  5. ThunderRd

    ThunderRd Irreverent Query Chairman Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    1,896
    Likes Received:
    68
    Trophy Points:
    48
    Location:
    Northern Thailand, the Land of Smiles
    Home page:
    OK, I've figured it out.

    (hd3,0) is the bootrecord of the first partition on the 4th drive, and that actually isn't where grub is. It's actually in the MBR of the 4th drive, and the designation is (hd3)

    Why it changed on me, IDK. Something in an update, I'd guess, but next time it happens, I'll know what to do.

    Problem solved. I'll have to RTFM first next time, before getting fired up. lolz
  6. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,699
    Likes Received:
    113
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    At lest you were able to run it down and provide a cure...When Grub goes wrong for me that's it, I have to reinstall...is why I just use F8 and let my Bois load the drive I want..
  7. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,628
    Likes Received:
    546
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    I've had problems like this before too.
    I added a Terabyte hard drive to my system and Grub got screwed up and wouldn't boot from the existing hard drive.
    Took me a while to figure out which drive and which partitions to put in the grub.conf
    I don't understand why it can be so confusing when simply adding another drive?
  8. ThunderRd

    ThunderRd Irreverent Query Chairman Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    1,896
    Likes Received:
    68
    Trophy Points:
    48
    Location:
    Northern Thailand, the Land of Smiles
    Home page:
    It's actually not that confusing, if you know all the syntax. I would have fixed my problem in about 60 seconds flat, if I'd known the correct way to designate disk 3.

    Problem is, with grub, no one really studies the designation syntax because grub is something that is just there; you don't have to make adjustments to it if it's working. I mean, it's pretty invisible. It's not like it's a production application that you use all the time. So every time it does get broken (which isn't often) you have to go crazy figuring it out all over again.

    That's what happens to me, at least. YMMV. :)
  9. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,628
    Likes Received:
    546
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    I don't fully understand the syntax, but I figured out where to make the changes for adding another operating system or removing one.
    Like when I installed Mint 13, it automatically populated a bunch of Mint 13 "safe mode" entries that I didn't want.
    At one point I accidentally deleted my Linux partition and had to install again, but Grub didn't see my Windows partition.
    So I had to go into the conf and add windows 7.

    I would love to be a master at Grub syntax, but like you said, once it works... it always works. It when I change something that causes problems.

    Can you link me to a good website on chain booting with Grub?
    I never knew something like that was possible...
  10. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,699
    Likes Received:
    113
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    True confessions time...One of the reasons (and a Big one at that) That I install so many distros is simply so I don't forget how during the long lulls between new releases, I do enjoy it for the most part, but mostly it just keeps me on my toes...when your as bad at theses things as I am you just can't be away from it for very long or you forget it all!
  11. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,628
    Likes Received:
    546
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Yup, its easy to forget if you don't practice.
    I still remember how to ride a bike though... how does that work?
  12. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,699
    Likes Received:
    113
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    Muscle memory...slow to arrive, last to leave...":O}
  13. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,628
    Likes Received:
    546
    Trophy Points:
    113
    Location:
    Linux, Arizona
    Home page:
    Ah, but point-n-click interface is not muscle memory... interesting.
    Not to mention every interface is different on every OS, program and device.
    But most bicycles generally ride the same.
  14. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    7,699
    Likes Received:
    113
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    I was responding to "I still remember how to ride a bike though... how does that work?"

Share This Page