I have just encountered a strange problem with my Ubuntu / Windows 7 / Windows XP setup.

When I switch on my laptop, the Linux bootloader appears and I select Ubuntu when I want to use Ubuntu and when I want to use Windows 7, I select the option "Windows 7 (Loader) on /dev/sda1.

Selecting this option loads the Windows bootloader, which gives me two options, "Windows 7" and "Earlier Version of Windows". I then select Windows 7 and everything works as expected.

Today I was working on something in Windows 7 and while I was away, my brother accidentally pulled down the lid of my laptop. I pulled the lid up just in time, only to see a black screen, but with the power button switched on. (My guess is that Window 7 was on its way to hibernate).

I tried to press some buttons on the keyboard, but nothing happened. Finally I long-pressed the power button for a few minutes, which turned off the laptop. Then I restarted the computer and when I selected the "Windows 7 (Loader) on /dev/sda1 entry in Linux boot loader, the computer restarted and showed me the Linux boot loader again. I repeated the same but nothing changed.

I have run Boot Repair from my Ubuntu installation (I am able to boot into Ubuntu!) but did not try the recommended repair options (because I believe the problem is related to the Windows boot loader and not to the Linux boot loader). Instead I have created the boot info summary.

I have already tried the following things:

  1. Updating GRUB by running sudo update-grub2

  2. Booting in Linux Recovery Mode and selecting "grub"

  3. Deleting the hiberfil.sys file on Windows 7 partition

Please help me to solve this issue. Thank you very much in advance.

  • I have just tried deleting the hiberfil.sys file from the windows 7 partition from Ubuntu. This did not help either! – prateekmathur1991 Jan 22 '17 at 8:07
  • Grub only boots working Windows. A few have said they were able to press f8 at almost same time as pressing the Windows entry and get into Windows repair console. But you have to use your Windows repair flash drive/or installer with repair console normally. Or perhaps install a Windows boot loader temporarily to boot directly to Windows which is slow enough to press f8. help.ubuntu.com/community/RestoreUbuntu/XP/Vista/7Bootloader – oldfred Jan 22 '17 at 14:39

Whatever has caused this situation ... reinstalling the boot loaders should solve the problem.

First reinstall the Windows boot loader - boot from the Windows 7 installation media and on Install now screen select Repair your computer, choose Command prompt and execute the following commands :

bootrec.exe /fixmbr
bootrec.exe /fixboot  
bootrec.exe /rebuildbcd  

Then reinstall the GRUB boot loader - boot from the Ubuntu installation media and select Try Ubuntu without installing. Once on the Ubuntu Live desktop execute the following commands :

sudo mount /dev/sda9 /mnt  
sudo grub-install --boot-directory=/mnt/boot /dev/sda  
sudo update-grub  

Note : sda = disk | sda9 = system partition (information taken from the provided screenshot)

Now delete the hiberfil.sys file from all Windows partitions and then reboot the computer.

Update addressing your comment that GRUB did not get updated successfully

On the Ubuntu Live desktop (installation media) chroot into the installed system :

sudo mount /dev/sda9 /mnt
sudo chroot /mnt

In case that you are still receiving an error, alternatively execute these commands :

sudo mount /dev/sda9 /mnt
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt

Update addressing your comment that you still can't boot Windows successfully

Repeat Step 1 (reinstall the Windows boot loader) and in case it boots into the Windows system correctly, search for the problem and solve it from within there. If the Windows OS doesn't start successfully, boot from the Windows installation media ... try to solve the issues using the repair options. When this attempt fails too, you'll unfortunately have to reinstall the Windows system.

  • Hi @cl-netbox, I have followed all your steps, but still my problem is not resolved. After booting from the Ubuntu live CD, the first 2 commands executed normally, but the last command gave the following error- 'Failed to get canonical path of /cow'. What can be wrong? I am still not able to get into windows – prateekmathur1991 Jan 22 '17 at 16:02
  • @plutonium1991 Which Ubuntu edition do you have installed ? Ubuntu 14.04 or 16.04 or 16.10 ? :) – cl-netbox Jan 22 '17 at 16:09
  • @cl-netbox- Ubuntu 14.04 LTS – prateekmathur1991 Jan 22 '17 at 16:12
  • @cl-netbox- Thnx for your help uptil now, but the problem is the same. The second set of commands you gave executed fine, and update-grub command worked PROPERLY!! But still, I am having the same problem. You may update the answer if you want as per your own convenience, since I will try other steps tomorrow evening. Thanx a lot.. :) – prateekmathur1991 Jan 22 '17 at 16:46
  • @plutonium1991 You're welcome ! :) Well, this means that the boot loaders were installed and updated successfully and that the Windows systems are recognized correctly. But - it also means that there most probably must be a problem within Windows, which unfortunately will have to be solved there ... maybe eventually it is possible to achieve this by using the repair options of the Windows installation media. :) – cl-netbox Jan 23 '17 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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