0

I have Ubuntu 14.04 and Windows 10 both successfully installed and operational. However, I can not get the grub menu to appear correctly and I've tried using boot repair multiple times. I've done boot repair through Windows 10 in addition to the grub.

Ubuntu does not detect Windows 10 on my system whatsoever yet it still lists Windows Recovery Environment (twice) in the boot menu, and if I select either one, the both boot to Windows 10 just fine.

Why are there two of the same entries that perform and standard boot to Windows 10 but say that it is recovery? How can I get rid of these entries and simply have an entry that says "Windows 10"?

heemayl
  • 91,753
Nathan
  • 57
  • Post link to Summary Report from Boot-Repair. – oldfred Aug 09 '15 at 21:56
  • http://paste.ubuntu.com/12051178/ – Nathan Aug 10 '15 at 20:39
  • It just maybe that grub cannot tell difference between Recovery & Windows particularly Windows 10 since it is new. You can manually change entries by adding your own entry with whatever title you want to 40_custom and turning off os-prober. – oldfred Aug 10 '15 at 21:12

3 Answers3

1

Copy the entries from this:

sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
gedit /boot/grub/grub.cfg

Copy Windows boot stanza(s) to and edit to have only entries/descriptions you want:

gksudo gedit /etc/grub.d/40_custom

Then do:

sudo update-grub

Once your manual entries work, turn off os-prober by adding this line to /etc/default/grub configuration file to get grub from adding entries automatically. You can turn on with false again if you add another system and want it to find it.

gksudo gedit /etc/default/grub

GRUB_DISABLE_OS_PROBER=true

sudo update-grub

https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen

oldfred
  • 12,100
0

I modified the grub "os-prober" script to allow user-defined name replacements for menu entries. First, find the following code in /etc/grub.d/30_os-prober:

if [ -z "${LONGNAME}" ] ; then
  LONGNAME="${LABEL}"
fi

After that code, add this:

# Begin patch
if [ "x${GRUB_OS_PROBER_RENAME_LIST}" != "x" ]; then
  for RENAME in ${GRUB_OS_PROBER_RENAME_LIST} ; do
    SRCNAME="`echo ${RENAME} | cut -d ':' -f 1 | tr '^' ' '`"
    DSTNAME="`echo ${RENAME} | cut -d ':' -f 2 | tr '^' ' '`"
    if [ "${LONGNAME}" = "${SRCNAME}" ]; then
      LONGNAME="${DSTNAME}"
      echo "Renamed '${SRCNAME}' to '${DSTNAME}' by user request." >&2
    fi
  done
fi
# End patch

Then, in /etc/default/grub, add the rename rules you want to use. This can go anywhere in the file:

# Rename list for OS's detected by os-prober. This is a space-separated
# list of rename mappings. A rename mapping is a colon-separated pair
# of strings, where each string has its spaces converted to ^ characters.
# The first string is the name of the OS reported by os-prober, and the
# second string is the replacement used by update-grub. This variable
# requires a change to /etc/grub.d/30_os-prober.
export GRUB_OS_PROBER_RENAME_LIST="Windows^Recovery^Environment^(loader):Windows^10"

Finally, update your grub:

sudo update-grub

If it worked correctly, the update-grub output will tell you what was renamed and your boot menu should also be updated.

To get rid of the extra Windows menu entry, I used the GRUB_OS_PROBER_SKIP_LIST feature in /etc/default/grub.

Beevik
  • 101
-2

It depends on what kind of partitioning you have done. First run sudo update-grub. If this does not work, you can edit the grub.cfg file to have only one entry of windows named "Windows 10" or whatever you want but do not delete any of the Ubuntu entries.

sudo gedit /boot/grub/grub.cfg

Be careful! Read online tutorials before doing anything.

heemayl
  • 91,753
Ubuntu
  • 16
  • 8
  • 1
    Be careful! Read online tutorials before doing anything. what is this ? why would OP read online tutorials ? whats the point of asking questions here then ? – heemayl Aug 09 '15 at 21:50
  • You never should edit grub.cfg directly. Any sudo update-grub overwrites it anyway. – oldfred Aug 09 '15 at 21:56