Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed Ubuntu 12.04 (daily-live iso from 21.04.12) alongside Windows 7 on an HP EliteBook laptop.

The installation went fine, except that it installed grub onto my usb disk (/dev/sdb) instead of the hard disk (/dev/sda). I was able to boot into the Ubuntu installation by using the usb disk which had grub installed on it. I then installed grub manually onto the hard disk (/dev/sda) by running "grub-install /dev/sda".

After I do that, I can book into either Ubuntu or Windows 7 from the Grub menu. However, after booting into Windows 7, grub doesn't load on the next boot. The computer simply reboots again and again, without giving any error. The screen simply goes black and reboots. There are two entries for Windows 7 in grub: for /dev/sda1 and /dev/sda3. These are in reality a single Windows installation which uses both partitions. Booting into either of them produces the same effect.

If I boot into the Ubuntu partition using the usb disk, I have found that I can restore grub to working order by using the boot-repair application. Then if I boot into Windows again, grub breaks again.

Full details of the log file which boot-repair produces, showing the partition details, are here: http://paste.ubuntu.com/940155/

Any ideas?

share|improve this question
    
From log : Found Windows 7 (loader) on /dev/sda1 Found Windows 7 (loader) on /dev/sda3 [Found two windows partition] better solution is re-install windows7 and then recover ubuntu grub. –  shantanu Apr 21 '12 at 20:49
    
I don't have any way to re-install windows 7. –  Matthew East Apr 21 '12 at 21:04
    
can you please explain why? –  shantanu Apr 22 '12 at 10:21
    
Because I don't have any Windows 7 installation disks. In any event, I don't think the fact that there are two Windows partitions is the problem. –  Matthew East Apr 22 '12 at 13:56
    
After load windows7 it changes boot loader(MBR). What does this means? Windows is changing your MBR, fix windows anyway. Not a ubuntu issue. –  shantanu Apr 22 '12 at 16:52

5 Answers 5

up vote 2 down vote accepted

This not really an "answer". The content would be a better match to a comment, but is too long-winded to fit in one. Apologies :-(

Some questions just to make sure I am reading your question correctly. (Please update/edit your question if you any further info to add.)

  • You say "I installed grub manually onto the hard disk (/dev/sda)."
    So you have already booted into the 12.04 installed on partition sda5 and successfully run
    sudo grub-install /dev/sda?
  • You say that "... after booting into Windows 7, grub doesn't load on the next boot. The computer simply reboots again and again."
    Does it make any difference which of the two entries for Windows in your GRUB menu you use to boot into Windows?
    There is one for /dev/sda1 (label "OSDisk") and another for /dev/sda3 (label "BDEDrive").
  • Is there any error or status information at all displayed prior to or during this infinite boot loop? Can you tell if it is Linux/GRUB or Windows that is looping?

I am wondering if there is some conflict between your two Windows boot configurations. Only one of them would seem to be needed. (Probably the one on the first partition, OSBoot?)

Perhaps you might learn something by installing a Windows boot utility such as EasyBCD and making sure your Windows boot settings are correct?


Another alternative might be to bring up the Windows 7 Advanced startup options boot menu by pressing F8 immediately after starting a Windows boot from the GRUB menu. If the option to Repair your computer is available in the advanced options boot menu, you could run Startup repair to check for and (maybe) correct problems in your Windows boot setup.

Note: You have to be quick pressing F8 or Windows will just boot as usual.


I'm not sure exactly what is going wrong, but could there be some corruption in either your Windows or Linux file systems?

The excerpt below is from your boot-repair log from lines 616 to 641. The repeated failures of getcwd() (get current working directory) and the GRUB warning about ZISD (ZENworks Image Safe Data ?) might mean something. Do you use ZENworks?

REPAIROK:
Copied Win boot files from sda3 to sda1
Reinstall the GRUB of sda5 into all MBRs of disks with OS or not-USB
Reinstall the GRUB of sda5 into the MBR of sda
dpkg --configure -a sda5
sh: 0: getcwd() failed: No such file or directory
grub-install (GRUB) 1.99-21ubuntu3
grub-setup: warn: Sector 5 is already in use by ZISD; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
SETUPOUTPUT: SETUPEXIT:0
sh: 0: getcwd() failed: No such file or directory
/usr/sbin/grub-setup: warn: Sector 5 is already in use by ZISD; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
INSTALLOUTPUT: Installation finished. No error reported.
INSTALLEXIT:0
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Generating grub.cfg ...
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Found linux image: /boot/vmlinuz-3.2.0-23-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-23-generic-pae
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Found memtest86+ image: /boot/memtest86+.bin
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
share|improve this answer
    
Thank you very much for your help. Yes, Zenworks is installed on the machine. I believe that my office uses it to update software and install new programs used for my office. I have used the application which you suggested - EasyBCD - to install a new boot record with a Windows boot manager, and to add entries on it for Windows 7 and for Ubuntu. I can now happily boot into both operating systems, so that's fantastic. –  Matthew East Apr 22 '12 at 13:58
    
Glad EasyBCD worked for you! (I'm the author) –  Mahmoud Al-Qudsi Apr 24 '12 at 0:52

Reinstall GRUB again

# grub-install /dev/sda

You should have a grub.conf in /boot/grub, if not try

# grub-mkconfig -o /boot/grub/grub.cfg

share|improve this answer
    
If I am reading the information in paste.ubuntu.com/940155 correctly, line 55 implies there is a /boot/grub/grub.cfg in sda5. –  irrational John Apr 22 '12 at 1:16

Some Windows programs use and overwrite parts of the boot sector. These parts are unused by the Windows boot loader but GRUB needs them. Whenever you boot into Windows parts of GRUB will then be overwritten.

From my "Ubuntu view" here I can't really tell which program might be the culprit but you may find it in one of the following groups:

  • Boot sector viruses (rare nowadays - but who knows)
  • Antivirus software (look e.g. for Boot-Sector "protection")
  • Other "safety"- or "protection"-suites
  • Automated backup solutions
  • Custom drivers/software from your PC manufacturer
  • Copyright-"protection" from software

Of course this list is incomplete but it may help you to get an idea where to look.

To test if something overwrites your MBR you may want to compare your boot loader from when GRUB is loading and after you booted Windows. Just copy and safe the Master Boot Record to a file by this command (assuming you boot from /sda):

sudo dd if=/dev/sda of=/<path>/boot_loader bs=446 count=1
share|improve this answer

When booted into windows you could use easy bcd to recover the windows MBR but being also able to get a menu to choose between windows and ubuntu.

share|improve this answer

I ran into the same problem after installing xampp on the windows partition of a dual boot Windows 7/Debian system. Grub then stopped functioning and looped back on itself. Difficult to say what the cause is, since there was an automatic windows update during the same period. Super Grub Disk from supergrubdisk.org was able to recover the windows os, but Debian has disappeared. Still trying to recover Debian.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.