0

I've Lenovo B-4030 laptop which came pre-installed with Windows 8.1. I installed Ubuntu 14.04.1 along side this in UEFI mode (kept security mode off). Everything worked fine even when I updated windows 8.1 to windows 10 becaused I was able to get the grub back by using boot-repair tool. Then I upgraded to Ubuntu 16.04. After that I wasn't able to boot into windows 10. I don't know what caused this but I was not bothered by it because I was using Ubuntu as primary OS. But when I used a windows 10 bootable usb to recover windows 10, I was again able to boot into windows (I don't remember the steps).

But then I updated to Ubuntu 16.04.1 and I lost control of Windows again. The entry of windows in grub menu was empty (as I call it) because when I select it, it always bring me back to the grub menu. I used boot-repair to repair it. First it gave me an error which mentioned something like GPT detected. Create BIOS-boot, >1MB unformatted partition with bios_grub flag and something else. I used gparted to create a new unformatted partition after seeing this post but step 3 gave me some output saying "target can not be found". Then I installed rEFInd boot manager (even when I have no idea what it does). But nothing solved my problem.

Then I again executed boot-repair and this time it gave me the following result...

result of boot-repair

After all this adventure, I've decided to post this as a question because I don't want to explore more on my own.

Some more info:

Today I have been looking here and there when I found the RESULT.txt files of boot-repair. The content which I'm putting here is from two files; first part is from the file when I was running Ubuntu 14.04 alongside Windows 10 and second part from the file when I had upgraded to Ubuntu 16.04.

PART I

I have uploaded the text file. You can see it here:
http://pastebin.com/YpcJjkR5

PART II

The text can be found here:
http://pastebin.com/i9C6Xbyc

Main things that I want to highlight are:

  • Ignore sda6. It was just an experiment and I'm fully confident that this was not the culprit.

  • Note the starting of the report. Why there's a difference even in the beginning?

  • Entry 25_custom(corresponding to EFI/ubuntu/fwupx64.efi and EFI/ubuntu/MokManager.efi) in /etc/grub.d/ is missing in the later result. How/Why?

Although I have now come to realise that Windows Hibernation might be the cause of this problem but how do I solve this issue without using a Windows Recovery Disk (as I don't have one)?

3 Answers3

1

What happens if you mount all your hard drives and run sudo update-grub?

As your paste2.org file http://paste2.org/AXVH8wM8 tells:

update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Found linux image: /boot/vmlinuz-4.4.0-43-generic
Found initrd image: /boot/initrd.img-4.4.0-43-generic
Found linux image: /boot/vmlinuz-4.4.0-38-generic
Found initrd image: /boot/initrd.img-4.4.0-38-generic
Found linux image: /boot/vmlinuz-4.4.0-36-generic
Found initrd image: /boot/initrd.img-4.4.0-36-generic
Found linux image: /boot/vmlinuz-4.4.0-34-generic
Found initrd image: /boot/initrd.img-4.4.0-34-generic
Found linux image: /boot/vmlinuz-4.4.0-31-generic
Found initrd image: /boot/initrd.img-4.4.0-31-generic
Found linux image: /boot/vmlinuz-4.4.0-24-generic
Found initrd image: /boot/initrd.img-4.4.0-24-generic
Found linux image: /boot/vmlinuz-4.4.0-22-generic
Found initrd image: /boot/initrd.img-4.4.0-22-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
Found linux image: /boot/vmlinuz-3.13.0-85-generic
Found initrd image: /boot/initrd.img-3.13.0-85-generic
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
NTFS signature is missing.
Failed to mount '/dev/sda6': Invalid argument
The device '/dev/sda6' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mount /dev/sda6 : Error code 12
mount -r /dev/sda6 /mnt/boot-sav/sda6
NTFS signature is missing.
Failed to mount '/dev/sda6': Invalid argument
The device '/dev/sda6' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mount -r /dev/sda6 : Error code 12
Unhide GRUB boot menu in sda2/boot/grub/grub.cfg
Boot successfully repaired. You can now reboot your computer.

It seems that there is something wrong with your Windows mountpoint. You could try to remove the BIOS Boot partition on sda6 and repair Windows with its built in tools. Then, using a live DVD, you could repair your Grub again.

1

Some observations/questions/suggestions:

  • You've got a mishmash of BIOS/CSM/legacy-mode and EFI/UEFI-mode boot loaders on your disk. It looks like you're using EFI-mode primarily, which is good, because Windows will not boot in BIOS mode from a GPT disk, which you also have. Nonetheless, the BIOS-mode stuff is clearly sending you on wild goose chases. (The bios_grub partition, /dev/sda6, is used only by the BIOS version of GRUB, for instance, so time spent on it is wasted.) I recommend you read this page of mine for more on this subject.
  • Your Boot Repair output (at http://paste2.org/AXVH8wM8) lacks the grub.cfg file, which this output normally includes. This makes it impossible to comment on your GRUB configuration. You may want to post that file (it's at /boot/grub/grub.cfg once you boot into Ubuntu) to a pastebin site and post the URL to your document here for comment.
  • You've installed rEFInd (which I maintain, BTW), and Boot Repair shows the rEFInd files on your hard disk; but there's no evidence of a rEFInd entry in your boot manager. You may be able to create one by typing sudo efibootmgr -c -l \\EFI\\refind\\refind_x64.efi -L "rEFInd boot manager" in a Terminal window in Ubuntu. Once you do this, rEFInd should come up the next time you boot; however, the fact that the rEFInd boot entry is missing suggests that your firmware may be a bit flaky and not "taking" NVRAM changes. If so, or if you prefer not to change your default boot manager just now, you can try putting rEFInd on a USB flash drive or CD-R -- images for both are available at the rEFInd download link you put in your question. rEFInd can sometimes be more reliable about booting Windows than GRUB, which is why it's worth trying to get rEFInd working.
  • In theory, updates to Ubuntu should not affect your ability to boot to Windows through GRUB. This makes the fact that you ran into this problem twice rather troubling. My best guess is that you've neglected to disable the Windows Fast Startup and/or Hibernation features. These features can create filesystem damage on shared filesystems, including the ESP where boot loaders reside. Read how to disable Fast Startup here, and how to disable Hibernation here. Disable these features as soon as you get Windows booting again.
  • If my guess that Fast Startup/Hibernation is at the root of your problems is correct, you may be able to temporarily fix the problem by running dosfsck on /dev/sda1 (that is, sudo dosfsck /dev/sda1). In extreme cases, backing up the partition (at /boot/efi in Ubuntu), unmounting it, creating a fresh FAT32 filesystem on it, re-mounting it, editing /etc/fstab to use its new serial number, and restoring data to it may be necessary. In the long term, though, disabling Fast Startup and Hibernation is the only solution, should they be causing filesystem damage on the ESP.
Rod Smith
  • 45,120
  • 7
  • 66
  • 108
1

In my case, as I found, my Boot Configuration Data (BCD) was somehow damaged so my system was not able to locate the Windows 10.
I followed the steps given below to resolve the issue;

  1. First of all, download ISO of WinPE from this website (Windows 10 Recovery Tool - Bootable Rescue Disk). You can surely download from other sites too.

  2. Make a bootable USB flash drive from the ISO of WinPE by following the instructions given on the page (how to create a bootable USB drive from command prompt).

  3. Boot into WinPE using the USB.

  4. Open a command prompt with administrative privilege.

  5. Input diskpart then press Enter.

  6. Input list vol then press Enter.

  7. Now you need to find the position of Boot Configuration Data(BCD) with the features given below.

    • Its format is FAT32.

    • Size could be 100MB/200MB/300MB/512MB
      for example: In my case, it was Volume 1. Note down the Volume No. carefully.

  8. Input select Volume No. then press Enter.

  9. Input assign Letter Z: then press Enter.
    You will see a message that DiskPart successfully assigned the drive letter or mount point.

  10. Input exit then press Enter.

  11. Input Bcdboot C:\Windows /s Z: /f UEFI then press Enter.
    If everything worked fine then you will get a message that Boot files successfully created.

  12. Input exit then press Enter.

  13. Restart the system.
    You will be able to boot into Windows 10.

The original steps I used to solve this problem can be found here.