Announcement

Collapse
No announcement yet.

Windows keeps erasing grub

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

    Windows keeps erasing grub

    Hi Folks,

    Having a bit of a problem with an install I have done on my laptop.

    I have successfully installed Kubuntu and all worked great. I rebooted the laptop and it refused to boot from the hard drive. I booted from the CD and reinstalled grub and it booted straight in to windows (Windows is the saved default). I rebooted and it refused to boot again. I reinstalled grub using the cd and it boots ok then when reboots wont boot.

    Anyone got any suggestions?

    I have to reinstall grub every night so I can boot into windows at work the next morning.

    Cheers

    Jon

    #2
    Re: Windows keeps erasing grub

    Have you checked your BIOS for the boot up order? Did you change the BIOS to install Kubuntu and forget to change it back again? On one of my machines I can disable the Hard Drive.
    "A problem well stated is a problem half solved." --Charles F. Kettering
    "Sometimes the questions are complicated and the answers are simple."--Dr. Seuss

    Comment


      #3
      Re: Windows keeps erasing grub

      Looks like you know the How-To’s OK.

      It almost sounds like a hardware thing. After you re-install GRUB, and the menu.lst is correct, that should do it forever.

      Given what you got right now, I would try the following:

      Check /boot/grub/menu.lst and make sure the boot entries for Windows and Kubuntu look OK –

      * I would delete that savedefault command.*

      No need for it, and maybe somehow (?) it’s tricking this.
      Make sure your timeout command is what you want it to be (number of seconds).
      Remember, as you know, to edit menu.lst using sudo and save your edits when you are done (File – Save, File –Edit).

      You said: “I booted from the CD and reinstalled grub and it booted straight in to windows (Windows is the saved default). I rebooted and it refused to boot again.”

      It refused to boot again – do you mean the PC booted, and the GRUB menu appeared, but it didn’t automatically boot into Windows?


      How To GRUB Methods - Toolkit
      http://kubuntuforums.net/forums/inde...opic=3081671.0
      (one I wrote)

      Bigpond, GRUB: http://users.bigpond.net.au/hermanzo...system_Entries
      (the classic by Herman)
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: Windows keeps erasing grub

        Hi Guys,

        Thanks for the replies.

        Have you checked your BIOS for the boot up order? Did you change the BIOS to install Kubuntu and forget to change it back again? On one of my machines I can disable the Hard Drive.
        I dont have the bios password so cant change anything. I will have a look at the settings though.

        Looks like you know the How-To’s OK.
        Used a few debian only systems over the years but never a dual boot.

        Remember, as you know, to edit menu.lst using sudo and save your edits when you are done (File – Save, File –Edit).
        Learnt that one the hard way!

        You said: “I booted from the CD and reinstalled grub and it booted straight in to windows (Windows is the saved default). I rebooted and it refused to boot again.”

        It refused to boot again – do you mean the PC booted, and the GRUB menu appeared, but it didn’t automatically boot into Windows?
        What happens is that after booting into windows and then being rebooted the machine goes through the boot list - PXE, CDROM, HDD - cant find anything to boot and the machine reboots completely. It goes through this cycle constantly until I put a bootable CD in.

        I am going to go back and look at the grub settigns and make sure I havent missed something daft.

        Cheers

        Jon

        Comment


          #5
          Re: Windows keeps erasing grub

          Originally posted by jonnyboy

          I dont have the bios password so cant change anything.
          Besides the fact that it might be part of your boot problem, that strikes me as a "very bad thing", for you as the owner/operator of the PC. If you google the make and model of the PC, you should be able to track down the manufacturer and part number of the motherboard. Then if you can get on the manufacturer's web site and find the board diagram, there's almost always a "reset factory defaults" jumper that you can change for a single power-on cycle, in order to clear that password (as well as all other non-default BIOS settings).

          Make sure you're grounded and working in a reasonably static-free environment when you are touching your motherboard.

          Comment


            #6
            Re: Windows keeps erasing grub

            So delete the savedefault stuff from Windows boot entry in menu.lst. At least for now to remove that variable.

            Make sure your timeout is NOT zero!!!
            Make timeout = s, where s is some comfortable number of seconds, like 10, so you have the chance to see what’s happening (if it gives you that chance!).

            Sure sounds hardware related. GRUB doesn’t do this behavior -- unless you were a geek who programmed some sort of re-boot loop into GRUB.

            And, of course, when you reset GRUB make sure you did that correctly (see the How-To), but I would bet that you know how OK. That’s the stuff about:

            root (hdx, y)
            setup (hd0)
            quit

            where (hdx, y) is the hard drive and partition of your Kubuntu, and the counting starts from zero.
            So (hd0, 1), for example, is the first hard drive (hd0), the second partition (that’s the “1”).


            BIOS: Shutdown down the PC and disconnect the power cord from the wall outlet, then remove the battery, wait awhile (? -- give it 15 minutes), re-install the battery, connect the PC power cord to the outlet, turn on the PC, that should reset BIOS to default settings.
            *** As dibl says, ground yourself very well before touching the motherboard, the HDs, the CPU, the memory, the video card, or anything inside the case (to be safe). To ground yourself, just touch the power supply box or the metal case, keep touching it if in doubt. Your static electricity can damage those sensitive components -- it won't hurt you, but it can wreck your PC.
            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: Windows keeps erasing grub

              Read through this thread from the beginning. What I didn't see stated, or asked, is where grub was installed to. The behavior being described sounds a lot like grub was installed into the mbr. That would account for Windows not being able to load on a reboot.
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                Re: Windows keeps erasing grub

                snowhog: “Read through this thread from the beginning. What I didn't see stated, or asked, is where grub was installed to. The behavior being described sounds a lot like grub was installed into the mbr.”


                Read through this thread from the beginning. What I didn't see stated, or asked, is where grub was installed to. I was thinking that grub was NOT installed into the mbr (which I think he should do). He also keeps having to boot using the Live CD.

                There you go. Reality is perception.
                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: Windows keeps erasing grub

                  Originally posted by Snowhog
                  Read through this thread from the beginning. What I didn't see stated, or asked, is where grub was installed to. The behavior being described sounds a lot like grub was installed into the mbr. That would account for Windows not being able to load on a reboot.
                  You would be right!

                  Where should it be installed?

                  I have 1 HDD with a windows primary partition, 1 kubuntu partition and a swap partition.

                  Cheers

                  Jon

                  Comment


                    #10
                    Re: Windows keeps erasing grub

                    I'm going to let Qqmike address your response. He has more experience with grub setups than I do. What version of Windows do you have on the laptop?
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: Windows keeps erasing grub

                      Its XP. Its a works laptop that I have been given permission to install linux on but not given the bios or administrator passwords!

                      Comment


                        #12
                        Re: Windows keeps erasing grub

                        One hard drive, Windows was there first, then you installed Kubuntu, right?

                        You want to be certain where the operating systems are, what exact partitions they are on (sounds like Windows is on the first partition, so that would be (hd0, 0)); and Kubuntu?

                        To be sure you can use the Live CD, open a terminal (Konsole), type
                        sudo fdisk –lu command at the Ubuntu Terminal prompt
                        It gives you a list of your hard drives and filesystems. (-lu is “l” as in “list,” “u” as in “units.”).

                        If Kubuntu is on the second partition, that would be (hd0, 1).
                        If it's on the third partition, that would be (hd0, 2). Etc.

                        Then to re-install GRUB – The usual way is the following:

                        First, you need to get a grub prompt (grub>) somehow.
                        Your two choices are: (1) Use a rescue disk, like Super Grub Disk, from which you can boot into your OS, or press the “c” key to get a GRUB prompt. Or, (2) Use your Live Kubuntu CD.
                        Let's assume (2) here.
                        Put your Live CD in the CD tray, re-boot your PC, startup your Live Kubuntu.
                        Now get a terminal and proceed as follows:

                        Get a GRUB prompt as root by typing sudo grub (then press Enter), and type the following (press Enter after each command):
                        grub> root (hdx,y) # (hdx,y) is the partition of your Kubuntu See NOTE
                        grub> setup (hd0) # This assumes (hd0) is your “main” booting hard drive MBR
                        grub> quit
                        $ exit

                        Close out all windows.
                        Re-boot to test it.

                        NOTE: The bootloader GRUB starts numbering drives and partitions from zero.
                        This (hdx, y) will be found from the work with sudo fdisk -lu above.

                        - - - - -

                        Edit the boot menu (/boot/grub/menu.lst)?

                        After doing all this, you may still have to edit the boot menu for GRUB, which is contained in Kubuntu at /boot/grub/menu.lst. (.lst is an “l” as in “list.”)
                        You must edit it as root, and don’t forget to save your changes when you are done (File-Save, File-Quit).

                        The part you need to check/edit is the boot menu for Windows, which should look like:

                        title Windows XP or whatever you wish to call it
                        rootnoverify (hdx, y) # which should be (hd0, 0), we think
                        makeactive
                        chainloader +1

                        where:
                        (hdx, y) is your Windows partition.
                        x is the hard drive number.
                        y is the partition.
                        (GRUB, the bootloader starts counting from zero. So hd0 is the first hard drive, hd1 is the second hard drive, etc.; the first partition is partition 0, the second partition is partition 1, etc.)


                        For all the details:
                        How To GRUB Methods - Toolkit
                        http://kubuntuforums.net/forums/inde...opic=3081671.0


                        Edit:
                        To find out the x and the y for the root (hdx, y) command (in the root - set - quit re-install GRUB method), another (and maybe better) way is:
                        Get a grub prompt (which you must do anyway to reinstall GRUB).
                        type
                        grub> find /boot/grub/stage1
                        That will tell you where the GRUB files are and returns the (hdx, y) you need for your root command. In general, these GRUB files may have been placed in a separate GRUB-boot partition (see the How-To again--scroll down to the post that addresses this option).

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

                        Comment


                          #13
                          Re: Windows keeps erasing grub

                          One thing, jonnyboy, that Snowhog brought to my attention, and you probably should be aware of since it is the company computer.

                          When you install Kubuntu and it installs the bootloader GRUB (or you do it manually as we are discussing here), GRUB will overwrite the Windows bootloader in the Master Boot Record (MBR) of the hard drive. Just so you know. Even if you delete Kubuntu, GRUB will still be in the MBR and the Windows XP bootloader (NTLoader) will not be in the MBR. Of course, you can use the XP CD to fix the MBR, people do it all the time.

                          Now you may ask, can you use Kubuntu but not write GRUB to the MBR? That is, can you have Windows XP bootloader, NTLoader, handle the dual booting? Yes you can. I've never done that, I've seen posts where people did it, it seems a bit involved to me. The story with Vista may be different, and Snowhog has some experience there, as we have some handy GUI tools (Easy BCD) available to help with Vista's bootloading other OSs.


                          You can google to find ways to dual boot Linux from Windows XP; here are two decent ones:

                          Booting, Multi-boot OSs, Moral Volcano (good stuff on booting, boot sectors, including Windows, like booting Linux from Windows): http://www.vsubhash.com/writeups/multiboot_os.asp

                          Boot (dual boot) Linux from NTLDR: http://www.geocities.com/epark/linux...w2k-HOWTO.html


                          Frankly, I'd just use GRUB. Either way, you are going to mess with MBR and/or NTLDR.
                          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: Windows keeps erasing grub

                            Originally posted by Qqmike
                            Even if you delete Kubuntu, GRUB will still be in the MBR and the Windows XP bootloader (NTLoader) will not be in the MBR. Of course, you can use the XP CD to fix the MBR, people do it all the time
                            Given jonnyboy's described situation, I would be prone to getting the XP mbr repaired as a first priority, given that it is a work computer. That way, he is back to a working XP system that happens to also have Kubuntu installed, but with out grub. Then he can work through your howto's on getting Linux to dual boot with XP.
                            Windows no longer obstructs my view.
                            Using Kubuntu Linux since March 23, 2007.
                            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                            Comment


                              #15
                              Re: Windows keeps erasing grub

                              Snowhog: "Given jonnyboy's described situation, I would be prone to getting the XP mbr repaired as a first priority, given that it is a work computer. That way, he is back to a working XP system that happens to also have Kubuntu installed, but with out grub. Then he can work through your howto's on getting Linux to dual boot with XP."

                              Yes. Agree. That's a good, clean option, especially if he needs to use Windows but can't get to it. If that's not an issue, the re-install method works and is otherwise safe (except for changing the MBR), and it's pretty standard for setting up GRUB.

                              Another option, just for the sake of brainstorming here, and it beats modifying NTLDR, he could get Super Grub Disk (on CD or on flash drive), and boot into Kubuntu using SGD each time. Takes a couple minutes to do it that way, but that would not modify the MBR.
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment

                              Working...
                              X