[SOLVED] Grub not recognizing Win10 after Update/Repair

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
psuliin
Level 1
Level 1
Posts: 10
Joined: Mon Apr 07, 2014 11:02 pm

[SOLVED] Grub not recognizing Win10 after Update/Repair

Post by psuliin » Tue Nov 10, 2015 10:22 pm

Hi all. This is going to be a long post because I want to make sure that I don't miss any vital facts. I'm dealing with several different issues, only a few of which I've solved. I don't know how these things might be related, so I'll try to take things in order.

Note: I have searched and found several messages about grub and Windows. However none of them looks quite like mine, so I can't be sure that the problems are the same. Since this is a matter of salvaging my Windows partitions, I want to be very sure that I'm doing this right.

I have been dual-booting Windows and Linux on my laptop for some time. I was running Win 7 and Mint 16, then a few months ago I updated Windows to Win 10.

A few days ago, I noticed in Mint that I wasn't able to mount my Windows NTFS partitions. I don't need to do that very often, so I don't know if this was broken when I updated to Win 10, or if it was a more recent issue. When I tried to mount those volumes I got an error: “No object for D-Bus interface”.

I set that issue aside for a moment, because I decided that it was time to upgrade Mint. I updated to Qiana, and that's when all hell broke loose.

After upgrade, my system would not boot at all - neither Mint nor Windows. I got an error: "symbol 'grub_term_highlight_color' not found" and the system dumped me into grub rescue. This appears to be due to a documented Ubuntu bug. Grub was fubared.

I booted the computer off an Ubuntu Trusty live USB and ran boot-repair. This fixed grub, but only for my Linux partition.

So, I am currently trying to fix two problems.
  1. Grub can't see the Win 10 partitions at all on boot. I can boot into Mint without a hitch, but the Win 10 entry does not appear in the list of boot options.
  2. I still can't mount my NTFS partitions. However the error message has changed. Instead of the D-bus error I get this:

    Code: Select all

    Error mounting /dev/sda2 at /media/paul/0CAEC2D5AEC2B70C: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda2" "/media/paul/0CAEC2D5AEC2B70C"' exited with non-zero exit status 14: Windows is hibernated, refused to mount.
    Failed to mount '/dev/sda2': Operation not permitted
    The NTFS partition is in an unsafe state. Please resume and shutdown
    Windows fully (no hibernation or fast restarting), or mount the volume
    read-only with the 'ro' mount option.
The odd thing is that as far as I recall I did shut Windows down properly. Perhaps it booted partway when I restarted and then hung up? Or perhaps it's just a standard error that can show up for many different problems.

I have run a few checks based on other posts, using parted and sfdisk. Output as follows:

Code: Select all

$ sudo parted -l
Model: ATA Hitachi HTS54757 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End    Size    Type      File system  Flags
 1      1049kB  210MB  209MB   primary   ntfs         boot
 2      210MB   371GB  370GB   primary   ntfs
 3      371GB   394GB  23.1GB  primary   ntfs
 4      394GB   750GB  356GB   extended
 5      394GB   395GB  1499MB  logical   fat32
 6      395GB   406GB  10.2GB  logical   ext2
 7      406GB   736GB  330GB   logical   ext4
 8      736GB   750GB  14.6GB  logical


Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/cryptswap1: 14.6GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  14.6GB  14.6GB  linux-swap(v1)


Model: SD 00000 (sd/mmc)
Disk /dev/mmcblk0: 8069MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  8069MB  8065MB  primary  fat32        boot

Code: Select all

$ sudo sfdisk -l -uM

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *     1    199    199     203776    7  HPFS/NTFS/exFAT
/dev/sda2       200  353475  353276  361754624    7  HPFS/NTFS/exFAT
/dev/sda3     353476  375547  22072   22601728    7  HPFS/NTFS/exFAT
/dev/sda4     375548+ 715403  339856- 348011521    5  Extended
/dev/sda5     375549  376978   1430    1464320    b  W95 FAT32
/dev/sda6     376980  386744   9765    9999360   83  Linux
/dev/sda7     386746  701457  314712  322265088   83  Linux
/dev/sda8     701459  715403  13945   14279680   82  Linux swap / Solaris

Disk /dev/mapper/cryptswap1: 1777 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/mapper/cryptswap1: unrecognized partition table type
No partitions found

Disk /dev/mmcblk0: 246240 cylinders, 4 heads, 16 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/249/36 (instead of 246240/4/16).
For this listing I'll assume that geometry.
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/mmcblk0p1   *     4   7694   7691    7875584    b  W95 FAT32
		start: (c,h,s) expected (0,227,21) found (0,130,3)
		end: (c,h,s) expected (1023,248,36) found (980,248,36)
/dev/mmcblk0p2         0      -      0          0    0  Empty
/dev/mmcblk0p3         0      -      0          0    0  Empty
/dev/mmcblk0p4         0      -      0          0    0  Empty
The final device listed in those outputs appears to be the SD card that I have inserted in my computer. I don't believe it has anything to do with this, but I wanted to post the outputs exactly as I got them.

So, that's all I have. Can anyone help me restore Win 10 to my boot options and mount my NTSF partitions?

And as a bonus, can you tell how this happened so I can avoid it in future?

Many thanks in advance.
Last edited by psuliin on Thu Nov 12, 2015 6:21 am, edited 1 time in total.

User avatar
caf4926
Level 7
Level 7
Posts: 1868
Joined: Mon Mar 22, 2010 3:21 pm
Location: UK Lake District

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by caf4926 » Wed Nov 11, 2015 12:23 am

Probably windows isn't configured to SHUTDOWN properly. Actually since Windows 8 this has been the default in windows, that when you shutdown, it actually doesn't, not properly.

If you google this, you will find plenty of help.

This leaves the Partition for windows in a state that is basically still in use. I think, Linux will not touch it.

Supergrubdisk may boot windows for you I don't know.
Linux Mint 19.1 Cinnamon

psuliin
Level 1
Level 1
Posts: 10
Joined: Mon Apr 07, 2014 11:02 pm

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by psuliin » Wed Nov 11, 2015 1:34 am

I think the first priority has to be getting Windows to boot. Once I can boot into Windows I can fix the shutdown problem.

Laurent85
Level 16
Level 16
Posts: 6100
Joined: Tue May 26, 2015 10:11 am

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by Laurent85 » Wed Nov 11, 2015 10:07 am

Try to setup a custom grub menu entry to boot Windows, open a terminal:

Code: Select all

gksu gedit /etc/grub.d/40_custom
Complete file with following content:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 10 custom entry" {
    insmod part_msdos
    insmod chain
    set root=(hd0,1)
    chainloader +1
}
Update grub:

Code: Select all

sudo update-grub
Reboot.
Image

Mark Phelps
Level 7
Level 7
Posts: 1852
Joined: Mon Jun 10, 2013 4:39 pm

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by Mark Phelps » Wed Nov 11, 2015 1:18 pm

Your problem is that Win10, like its predecessor Win8, enables a new form of Hibernation by default -- known as Fast Startup.

FastStartup forces Windows to go into hibernation even if you choose Shut Down and when this happens, all open partitions remain mounted, preventing access to those partitions from outside the Windows OS that was running.

There are two ways to disable FastStartup in Win8/10; (1) through the Control Panel, and (2) through an elevated command prompt.

Control Panel - Open Control Panel --> Power Options.
Select "Choose what the power buttons do"
Select "Change settings that are currently unavailable"
At the bottom of the Window, under Shutdown settings, uncheck the box regarding fast startup

Elevated command prompt - run the following command:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_dWORD /D 0 /F

In both cases, reboot Windows.

psuliin
Level 1
Level 1
Posts: 10
Joined: Mon Apr 07, 2014 11:02 pm

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by psuliin » Thu Nov 12, 2015 4:45 am

SUCCESS!

My thanks to Laurent85 and Mark Phelps. Your solutions solved both of my remaining problems. My boot options are restored, and I can now mount my NTFS partitions in Mint. :D

There is one peculiarity, which at the moment appears to be cosmetic: My boot menu now contains both the "Windows 10 custom entry" that I created with Laurent85's grub edit, and the old "Windows 7 loader" entry that I've had since I first started dual booting Win 7 and Mint. After my upgrade to Win 10 that option launched Win 10, and it still does.

Unless this is an indication of some sneaky problem that I need to fix, I'm calling this one SOLVED.
Last edited by psuliin on Thu Nov 12, 2015 5:19 am, edited 1 time in total.

psuliin
Level 1
Level 1
Posts: 10
Joined: Mon Apr 07, 2014 11:02 pm

Re: Grub not recognizing Win 10 Partition after Update & Rep

Post by psuliin » Thu Nov 12, 2015 4:50 am

One question in closing: I gather that this disaster started because a problem with the new version of grub bollixed my system when I updated to Qiana. Is there a way to verify that this bug has been fixed before I update to the next big thing, whatever that happens to be?

I'd really rather not go through this again..

Zalbor
Level 4
Level 4
Posts: 321
Joined: Tue Apr 19, 2011 11:53 am

Post by Zalbor » Thu Nov 12, 2015 4:52 am

You have two entries because you created one following Laurent's instructions above, but grub added its own automatically now that it can read the partition.

If you edit the file Laurent mentioned and remove the extra entry (careful not to remove any more than you should, though) the extra one will disappear.

Post Reply

Return to “Installation & Boot”