sudo update-grub not working
I recently installed Ubuntu on a Windows 10 computer to implement a dual boot, but since I initially had some problems during the installation process I made some mess with the partitions.
Anyway, now Ubuntu starts up properly but I don't get a grub screen to choose which OS to use (in other words, I'm locked out from Windows).
Searching in some tutorials, I tried to write sudo update-grub
and I get these errors:
error: invalid volume.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Nothing which references to Windows.
Furthermore, sdb1 is my hdd (with no operating systems), while windows is installed on sda2 (see below)
On the other hand, I can still see Windows partition on sudo fdisk -l
or under Other Locations > SSD
.
Any suggestions?
UPDATE:
This is my partition:
Number Start End Size Type File system Flags
1 1049kB 577MB 576MB primary ntfs
2 577MB 167GB 166GB primary ntfs
3 167GB 168GB 1024MB primary fat32 boot, esp
4 168GB 254GB 86,0GB extended
5 168GB 174GB 5999MB logical linux-swap(v1)
6 174GB 254GB 80,0GB logical ext4
List configuration General Settings Appearence Settings
I also tried to add
menuentry "Windows 10 (loader)"{
insmod part_gpt
search --set=root --file /EFI/Microsoft/Boot/bootmgfw.efi --fs-uuid DA02-12A2
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
see here, but I get Error: invalid EFI file path
on boot (/EFI/Microsoft/Boot/bootmgfw.efi
does not actually exist).
UPDATE 2:
sudo fdisk -l:
Disk /dev/loop0: 93,94 MiB, 98484224 bytes, 192352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 9,7 MiB, 9510912 bytes, 18576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 54,97 MiB, 57614336 bytes, 112528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 242,43 MiB, 254193664 bytes, 496472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 54,97 MiB, 57618432 bytes, 112536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop5: 240,82 MiB, 252493824 bytes, 493152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop6: 160,16 MiB, 167931904 bytes, 327992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop7: 49,8 MiB, 52203520 bytes, 101960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 238,49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: ADATA SU800
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a7e098f
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1126399 1124352 549M 7 HPFS/NTFS/exFAT
/dev/sda2 1126400 326035455 324909056 155G 7 HPFS/NTFS/exFAT
/dev/sda3 * 326035456 328036351 2000896 977M ef EFI (FAT-12/16/32)
/dev/sda4 328038398 496005119 167966722 80,1G 5 Extended
/dev/sda5 328038400 339755007 11716608 5,6G 82 Linux swap / Solaris
/dev/sda6 339757056 496005119 156248064 74,5G 83 Linux
Disk /dev/sdb: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-60W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9dba35c9
Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 1953523119 1953523057 931,5G 42 SFS
Partition 1 does not start on physical sector boundary.
Disk /dev/loop8: 62,9 MiB, 65105920 bytes, 127160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop9: 27,9 MiB, 28405760 bytes, 55480 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Fixing can't see grub menu problem
Recent versions of GRUB have the timeout hidden. You can hold down left-shift
during boot to bring the message up or edit your /boot/grub/grub.conf
and remove hiddenmeu
and set the default to something like 10 seconds timeout=10
For grub2 edit the /etc/default/grub
file and make the following changes:
#GRUB_HIDDEN_TIMEOUT=0
GRUB_TIMEOUT=10
NOTE: The #
symbol will comment out the GRUB_HIDDEN_TIMEOUT
and will enable the menu
After making the changes run sudo update-grub
to apply the changes.
This is what /etc/default/grub
look like to me:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_SAVEDEFAULT="false"
export GRUB_COLOR_NORMAL="light-gray/black"
export GRUB_COLOR_HIGHLIGHT="magenta/black"
You can also try to edit these values with GUI using "grub customizer" software that can be downloaded from the Ubuntu Software centre.
Fixing can't see Windows Boot Manager in grub menu problem.
Also, It seems that you have installed Ubuntu in UEFI mode and Windows in Legacy BIOS. You have 2 options. Change Windows to UEFI or change Ubuntu to Legacy BIOS. It is recommended to change Windows to UEFI because UEFI is better and more advanced than Legacy BIOS.
1) Change Windows to UEFI: You can do this by reinstalling Windows or you can try to do what is mentioned in here. Whatever you do, make user that you have a backup, just in case.
2) Change Ubuntu to Legacy BIOS: You can do this by reinstalling Ubuntu but making sure that you don't pick the UEFI option in boot options. (The UEFI option will have "UEFI:" before the name of your installation media. Note that the names of UEFI option and Legacy BIOS option may differ. For more info read the chat in comments.