I know that there are tons of questions referring to GRUB issues, but I have a specific problem that I'm not able to solve for quite long time.
My hard drive is laid out using GPT format (not MBR - refer listing below). I have two 64-bit OSes:
The problem is that after one of the system upgrades (I'm not sure if it was Debian's of Windows' upgrade fault) GRUB stopped showing up at start up making Windows start default. To boot my Debian I use GRUB command prompt using Debian's LiveCD:
grub> root=(hd0,6)
grub> linux /vmlinuz-4.3.0-1-amd64 root=/dev/sda8
grub> initrd /initrd.img-4.3.0-1-amd64
grub> boot
What I've tried so far
I tried to solve the problem in many different ways:
- I removed all of the packages with
grub
string in its names and installedgrub-efi-amd64
package which is dependent on (among others):grub-common
,grub2-common
,grub-efi-amd64-bin
. As a result all of these packages were installed. - I've made the following changes in
/etc/default/grub
(as suggested in the @gilles' answer to this question) and ranupdate-grub
command (orupdate-grub2
which is symlink toupdate-grub
one-liner bash script):GRUB_HIDDEN_TIMEOUT_QUIET=false
,GRUB_HIDDEN_TIMEOUT=
,GRUB_TIMEOUT=10
.
- I turned off Windows Fast Startup and hibernation.
grub-install --target=x86_64-efi && update-grub
Diagnostic info
My motherboard is GIGABYTE GA-Z77-D3H with UEFI DualBIOS™, which means that (quote) 'it has a BIOS compatibility mode - the built-in boot menu shows two entries for each device, one prefixed with UEFI and one without'. Booting neither in UEFI mode nor in BIOS legacy mode doesn't work.
efibootmgr
command result:root@mycomp:/home/me# efibootmgr BootCurrent: 0007 Timeout: 1 seconds BootOrder: 0002,0003,0004,0005,0000,0007 Boot0000* Windows Boot Manager Boot0002* UEFI: ST1000DM003-9YN162 Boot0003* Hard Drive Boot0004* CD/DVD Drive Boot0005* Removable Drive Boot0007* UEFI: USB USB Hard Drive
parted
command result:root@mycomp:/home/me# parted /dev/sda print Model: ATA ST1000DM003-9YN1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 316MB 315MB ntfs Basic data partition hidden, diag 2 316MB 420MB 105MB fat32 EFI system partition boot, esp 3 420MB 555MB 134MB Microsoft reserved partition msftres 4 555MB 268GB 268GB ntfs Basic data partition msftdata 5 268GB 805GB 537GB ntfs Basic data partition msftdata 6 805GB 806GB 500MB ext4 msftdata 7 806GB 830GB 24,4GB ext4 msftdata 8 830GB 838GB 8000MB ext4 msftdata 9 838GB 853GB 15,0GB ext4 msftdata 10 853GB 863GB 10,0GB linux-swap(v1) 11 863GB 1000GB 137GB ext4 msftdata
/etc/fstab
content (I zeroed UUIDs below for privacy's sake):root@mycomp:/home/me# cat /etc/fstab # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda8 during installation UUID=00000000-0000-0000-0000-000000000000 / ext4 errors=remount-ro 0 1 # /boot was on /dev/sda6 during installation UUID=00000000-0000-0000-0000-000000000000 /boot ext4 defaults 0 1 # /boot/efi was on /dev/sda2 during installation UUID=0000-0000 /boot/efi vfat defaults 0 1 # /home was on /dev/sda11 during installation UUID=00000000-0000-0000-0000-000000000000 /home ext4 defaults 0 2 # /tmp was on /dev/sda9 during installation UUID=00000000-0000-0000-0000-000000000000 /tmp ext4 defaults 0 2 # /usr was on /dev/sda7 during installation UUID=00000000-0000-0000-0000-000000000000 /usr ext4 defaults 0 2 # swap was on /dev/sda10 during installation UUID=00000000-0000-0000-0000-000000000000 none swap sw 0 0 # CD-ROM /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 # Added for Google Chrome (see: https://unix.stackexchange.com/questions/116400/google-chrome-no-space-on-rootfs-partition) /usr/opt /opt none bind 0 0 # C: Windows partition UUID=0000000000000000 /media/Windows/C ntfs ro 0 0 # D: Windows partition UUID=0000000000000000 /media/Windows/D ntfs ro 0 0
fdisk -l
result:root@mycomp:/home/me# fdisk -l Device Start End Sectors Size Type /dev/sda1 2048 616447 614400 300M Windows recovery environment /dev/sda2 616448 821247 204800 100M EFI System /dev/sda3 821248 1083391 262144 128M Microsoft reserved /dev/sda4 1083392 524290047 523206656 249,5G Microsoft basic data /dev/sda5 524290048 1572866047 1048576000 500G Microsoft basic data /dev/sda6 1572866048 1573842943 976896 477M Microsoft basic data /dev/sda7 1573842944 1621499903 47656960 22,7G Microsoft basic data /dev/sda8 1621499904 1637124095 15624192 7,5G Microsoft basic data /dev/sda9 1637124096 1666420735 29296640 14G Microsoft basic data /dev/sda10 1666420736 1685952511 19531776 9,3G Linux swap /dev/sda11 1685952512 1953523711 267571200 127,6G Microsoft basic data
Referring to the
msinfo32
Windows System Information, my systemBIOS mode
isUEFI
.
If you need more information to diagnose my problem, put your request in comment.
Update
I removed grub-efi-amd64
package with all dependencies, installed grub-pc
and now GRUB is loading successfully only if I boot in BIOS mode. The following command:
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
displays BIOS
, but I still want to boot in UEFI mode!
Helpful links
Links that may be helpful: