Announcement

Collapse
No announcement yet.

[SOLVED] GRUB trouble after install

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] GRUB trouble after install

    Hi,

    I tried installing kubuntu on my windows machine the other day as my dedicated Linux rig has finally decided to call it a day. Install seemingly went OK and I could boot into Linux quite happily, however trying to get into windows gave me error 17. After a lot of messing around with menu.lst and drive order in bios I eventually gave up and tried use fixmbr/fixboot to get me back into windows. This didn't work. I proceeded to physically remove the hard-disk kubuntu was installed to and went through the fixmbr procedure again with success.

    I have never had any problems with drive order and GRUB not working "out of the box" so I was slightly at a loss.

    My system consits of two SATA drives and one IDE drive which Linux was meant to live on, in bios they are all set to auto and are in the order:

    1. Windows boot/OS (Windows boot is on sda0)
    2. NTFS Data (sdb)
    3. Linux Boot/OS/DATA (Linux boot is on sdc0)

    After install GRUB pointed to hd(0,0) for windows boot, which didn't work so I tried various other combinations to no avail. Yesterday I used Super Grub Disk which got me into kubuntu again but wouldn't repair GRUB (which has now disappeared as the windows bootloader took over).

    Today I'm going to reinstall kubuntu via the CD, I just need to know in what order the drives need to be in BIOS and where I should be installing the MBR to and whatnot to avoid encountering any further problems when it comes to booting into windows from GRUB :[

    Sorry about the long winded and slightly wishy-washy post, any help would be much appreciated!

    #2
    Re: GRUB trouble after install

    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0
    GRUB ERRORS: See Reply #23

    Specifically,
    SECTION 6: Windows
    should help.

    Error 17 is not too serious and usually has a simply explanation (i.e., with a keystroke or two).

    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: GRUB trouble after install

      I wish you asked before, there was no need to reinstall. Oh well, if you have troubles, you can always install the graphical editor

      http://packages.ubuntu.com/jaunty/admin/kgrubeditor

      It will show in System Settings. Also, you should install GRUB in the MBR of the third drive, that is the safest bet.

      We also have an awesome HOWTO here if things get tricky
      http://kubuntuforums.net/forums/inde...opic=3081671.0

      Comment


        #4
        Re: GRUB trouble after install

        Hi,

        Thanks for the speedy replies!

        I have not yet reinstalled kubuntu, the only reason I considered it is because of the problem I am currently facing.
        I'm in kubuntu at the moment (got in with the aid of SGD). I found the HOWTO yesterday but got slightly lost, too many problems resembled my own. If i type "sudo grub" in konsole and then find /boot/grub/stage1 I get "Error 15", which I believe is file not found. This would make sense as menu.lst is not present in /boot/grub - I'm guessing it got killed by fixmbr somehow, though I don't understand why if windows' MBR is on a completely separate HDD.

        So, new question (I checked section 10 in the HOWTO and found no answer), how do I get grub back and in working order on sdc?

        EDIT: I just checked and the whole of /boot seems to be empty... oops? :/

        Thanks!

        Comment


          #5
          Re: GRUB trouble after install

          yes, this is weird. It may be easier to reinstall Linux if /boot is empty. But, for the sake of it, before you reinstall, you may try to open the package manager (synaptic would be great) and reinstall grub, and also reinstall the latest kernel packages, that might re-populate /boot!

          Comment


            #6
            Re: GRUB trouble after install

            "I just checked and the whole of /boot seems to be empty... oops? :/"

            Yes, not surprised because Error 15 on "find /boot/grub/stage1" means your GRUB files are messed up, maybe even ALL gone! It has nothing to do with menu.lst. So you need to reinstall GRUB files under /boot/grub. You probably do still have the master set of files, the GRUB image files in /usr/lib/grub/i386-pc, so you can simply copy all those into your /boot/grub directory, then go about re-installing grub (in GRUB Legacy with root-setup; in GRUB 2 with sudo grub-install /dev/sdX, for some X, or /dev/sdXN for some drive X and partition N).


            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Re: GRUB trouble after install

              Ahhh. Nice trick, but then you'd need to reinstal the kernel, since the image is not in /boot anymore ...

              Comment


                #8
                Re: GRUB trouble after install

                Oh, right, yes. I ignored the kernel stuff in /boot Agree!
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: GRUB trouble after install

                  1 more thing to consider

                  IF at some point during your adventur the windows NTFS file system has ben corupted (say wile resizing or the sutch...even a hard shut down) linux or grub will not boot it untill chkdsk /f is run on it.

                  http://www.microsoft.com/resources/d....mspx?mfr=true

                  so I would sugjest runing it befor you reinstall grub or watever way you go with this

                  just a FYI befor ever resizing a NTFS partition you should run chkdsk then defrag and chkdsk agin.....(not saying this is what has hapend just a FYI)

                  or the eqivalent from ntfsprogs

                  ntfsprogs-tools for doing neat things in NTFS partitions from Linux
                  The Linux-NTFS project (http://www.linux-ntfs.org/) aims to bring full
                  support for the NTFS filesystem to the Linux operating system.
                  VINNY
                  i7 4core HT 8MB L3 2.9GHz
                  16GB RAM
                  Nvidia GTX 860M 4GB RAM 1152 cuda cores

                  Comment


                    #10
                    Re: GRUB trouble after install

                    Hello again,

                    I reinstalled linux and got a strange "could not install 'grub' package" error at the end of it, so I made a new burn of the ISO and tried again. As I didn't want to risk my partitioning skills being the problem (sdc1 = /boot = 100meg is what I normally do) I decided to do the whole "use entire disk with sdc. Install finished correctly yet upon reboot I got the dreaded error 17.

                    grub: find /boot/grub/stage1 gave hd(2,0) as expected,
                    I then did root (hd2,0) and setup (hd2) as instructed to by the HOWTO.

                    Once again, reboot failed and resulted in error 17. I then used SGD which allowed me to boot into linux happily, yet trying to boot into windows gave error 13. After a bit of head scratching I used "live swap" followed by: WIN => MBR & !WIN! (((((((((((((((( "This option adds a syslinux bootloader to your MBR that chainloads the first active partition which usually contains Windows. "

                    This got me into windows, rebooting doesnt give me GRUB anymore and it throws me straight into windows. I guess I could access linux using SGD when I need to.

                    So, considering SGD's "live swap" fixed access to windows, could the order of my drives in BIOS be the key? I currently have all drives set to AUTO (though I tried shoving the third drive on LBA to no avail) and they are in the order: 1. Windows OS, 2. Windows Data, 3. Linux

                    1 and 2 are SATA, 3 is connected with an IDE cable.

                    Comment


                      #11
                      Re: GRUB trouble after install

                      " ... could the order of my drives in BIOS be the key?"

                      Yes, quite possibly.
                      Looks like you installed GRUB to the MBR of the 3rd drive (where Linux is), sdc = hd2 (root (hd2,0), setup (hd2)). So, then, do you not want the PC to boot from sdc (first in BIOS drive order)? So set BIOS to boot from sdc first.

                      But then Windows will be on a non-first hard drive. If you boot into Kubuntu (somehow-->SGD), what drive is Windows seen on?
                      To find out:
                      Kubuntu.
                      Konsole
                      sudo grub
                      grub>geometry (hd0)
                      grub>geometry (hd1)
                      grub>geometry (hd2)
                      or grub>geometry (hd1,0), etc.
                      Find the Windows drive (it's either hd1 or hd2 as seen from Kubuntu when you boot from Kubuntu: Kubuntu will be on hd0 when the PC boots from the Kubuntu drive).

                      If all this is true, you need to modify the menu.lst in Kubuntu to include a proper boot entry for Windows and you must use the map command (because Windows is on a non-first hard drive).

                      So,
                      set BIOS to boot from the Kubuntu drive.
                      Edit /boot/grub/menu.lst (in Kubuntu) to include a valid entry for Windows (which involves the map command to perform a virtual switch of drives).

                      SECTION 6, XP, When XP is on a non-first hard drive.

                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Re: GRUB trouble after install

                        Excellent guidance. Actually, once you are in Kubuntu (after the suggested change in the BIOS), you can issue "df -h" in Konsole to see the names/ordering of the drives.

                        Comment


                          #13
                          Re: GRUB trouble after install

                          re df:
                          Yes, usually right

                          But there are times where GRUB (and BIOS--since GRUB and BIOS see the drives the same) have one idea and Linux has another idea. Often, Linux's best idea is device.map, but device.map (1) may be wrong, and (2) may have little relevance for actual booting. Nice thing about geometry command (in GRUB Legacy) is that it sees the drives as BIOS & GRUB sees them (for booting). In GRUB 2, geometry is gone and is replaced by the ls command: grub>ls (at the GRUB prompt). When you're trying to get the (hdx,y)'s down right (not so much the sdx's), I have never seen a case where geometry led to the wrong drive. That's why, as an example, if you have the classic "bad" (or confusing) case of a mixture of SATA and IDE drives, the best way to get them sorted is by using geometry (if necessary from live CD).
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #14
                            Re: GRUB trouble after install

                            ... in particular, I'm saying that sda, sdb, and sdc may not always be hd0, hd1, and h2 (in that order). sdb may be hd0, for example.
                            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                            Comment


                              #15
                              Re: GRUB trouble after install

                              Hello!

                              All is sorted now and I really couldn't have done it without you guys, especially Qqmike for the amazing HOWTO. Now I can move on to sorting out gfx on my 4850 and getting Matlab to work happily - Thanks alot!

                              Comment

                              Working...
                              X