Boot is bypassing grub and going to windows

PsychoHermit

Member
Joined
Aug 29, 2021
Messages
83
Reaction score
59
Credits
602
Greetings folks.
I just had an SSD installed and reinstalled ubuntu 20.04.3.
The install went fine but now I can't get my grub menu to come up. I have disabled fast boot in windows. What else can I try?
It's an HP Envy Touchsmart notebook
It's booting in efi mode as far as I know. One troubling observation, the /boot/efi directory is empty.
Thanks,
--glenn
 


G'day Glenn.

1. Does it boot into the 'buntu at all, or does it get stuck before the Grub Menu that does not appear?

2. Is the Windozer on the same SSD or a different drive?

Others will likely think of more questions but that's me for starters.

Chris
 
It boots ubuntu if I go to the F9 boot options. Everything is on the same SSD.

I tried changing the boot order with efibootmgr, but when I reboot it reverts to windows first again.

I even updated the BIOS hoping to get a submenu under OS Boot manager, no joy.

Thanks,
--glenn
 
Last edited:
I'm doing a bit of brainstorming here, and I'll tell you that I have a road trip on tomorrow (Friday here) and Saturday, so in my absence there are likely others whom can help.

So you are able to get into a working Ubuntu, albeit with the PITA of going through F9 first?

1. Have you tried running

Code:
sudo update-grub

and rebooting? If so/not, what was/is the outcome?

2.
One troubling observation, the /boot/efi directory is empty.

What process did you use to determine that? Is there actually a sign of /boot/efi, or is that subdirectory non-existent?

Unless you told the Installer (Ubiquity) otherwise, it is quite possible that it used the ESP (EFI System Partition) that goes hand in hand with Windows 10/11 (which one is it?) to place the Linux bootloader.

3. Do you have Timeshift installed? If not, you can get it from Ubuntu's Software Centre.

Some of the options I am looking at for Glenn to try are as follows (if it helps Helpers), but I should say first Glenn to make sure you have your Windows safeguarded (eg USB Recovery), and perform these steps bright-eyed and bushy-tailed (fresh).

One thing - if you use your File Manager, or Terminal to determine if there is a presence of

/sys/firmware/efi/efivars

if there is content there, you have your system running under UEFI.

Option 1 (subject to Question 1) is to try reinstalling Grub form the Terminal of Ubuntu booted via F9.

Determine first what partition your Ubuntu root is on with eg lsblk, and then

Code:
sudo grub-install /dev/sdxy
sudo reboot

where xy is the alpha and numeric identifier for your root partition.

Option 2 would be, having installed Timeshift, take a snapshot, then use that to restore Ubuntu over the top of itself. The default, under the Advanced Options button in Timeshift is for it to rebuild/reconfigure Grub.

If you already have Timeshift installed and a snap already taken, that is no use to you if it precedes the time when you reinstalled on the SSD, so you would delete that first.

Option 3 - would be, armed with an Ubuntu Live USB stick, to use a process called

chroot

from the stick to enter your Ubuntu install and rebuild Grub from there.

I have Thread on Timeshift here if that helps.

Useful in the meantime would be if you can give us a screenshot of the GParted status of both drives.

Cheers

Chris
 
Code:
glenn@LinuxBox:~$ sudo parted -l
[sudo] password for glenn:
Model: ATA SanDisk SDSSDH3 (scsi)
Disk /dev/sda: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot, esp
 2      106MB   123MB   16.8MB               Microsoft reserved partition  msftres
 3      123MB   300GB   300GB   ntfs         Basic data partition          msftdata
 5      300GB   330GB   30.0GB  ext4
 6      330GB   1024GB  694GB   ext4
 4      1024GB  1024GB  533MB   ntfs                                       hidden, diag

Code:
glenn@LinuxBox:~$ sudo grub-install /dev/sda6
Installing for x86_64-efi platform.
Installation finished. No error reported.

Rebooting boots windows.

I will try the option 2 timeshift trick and update this post with the results.

timeshift set up grub, but it still boots to windows.

I give up, esc F9 to boot the grub menu isn't that horrible. I usually just shut the lid and hibernate it, so I don't boot that often.

Thanks,
--glenn
 
Last edited:
It has been my HP experience F9 as well with dual booting. I think it's a conspiracy.......

The AMD Ryzen / Asus MB desktop I just built (crap it was last year now) dual boots and no issues.
 
Back from my trip, thanks for that info, Glenn.

So Windows and Ubuntu share the same drive, and it appears that you installed Windows first and then Ubuntu, which is the correct sequence.

My humble apologies, I mis-wrote Option 1.

It should have read

Code:
sudo grub-install /dev/sdx (in your case, now, that is /dev/sda, no number)
sudo update-grub (I failed to specify that)
sudo reboot

and that would likely work.

If you want to pursue this you can, and I would ask for the content of (the // is a comment only)

Code:
cat /etc/default/grub

// and

cat /etc/fstab

but if you are OK with F9, your call.

Cheers

Chris
 
I would really like to get grub working. My bios doesn't have a submenu under OS boot manager, so I can't move Linux to the top. I did grub-install to /dev/sda and ran update-grub, but it's still booting to windows. I also tried changing the boot order with efibootmgr, it changes ok but upon rebooting windows is again first in the boot order. I think I have funky bios. I also updated the bios hoping to get a submenu under OS Boot Manager, no joy.

Code:
glenn@LinuxBox:~$ cat /etc/default/grub
# 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=10
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"
Code:
glenn@LinuxBox:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=7c1a099d-3263-4d58-b7cc-33ef8b9d3b98 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
#UUID=ECEA-B00F  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda5 during installation
UUID=9703b703-f978-4bd3-9513-26b512945caf /home           ext4    defaults        0       2
/swapfile                                 none            swap    sw              0       0
#UUID=ECEA-B00F  /boot/efi       vfat    defaults      0       1
UUID=ECEA-B00F  /boot/efi       vfat    defaults      0       1

Boot-repair summary
Code:
boot-repair-4ppa157                                              [20220109_1826]

============================== Boot Info Summary ===============================

 => Windows 7/8/2012 is installed in the MBR of /dev/sda.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:        /efi/Boot/bkpbootx64.efi /efi/Boot/bootx64.efi
                       /efi/Boot/fbx64.efi /efi/Boot/grubx64.efi
                       /efi/Boot/mmx64.efi /efi/ubuntu/grubx64.efi
                       /efi/ubuntu/mmx64.efi /efi/ubuntu/shimx64.efi
                       /efi/ubuntu/grub.cfg /efi/Microsoft/Boot/bootmgfw.efi
                       /efi/Microsoft/Boot/bootmgr.efi
                       /efi/Microsoft/Boot/memtest.efi

sda2: __________________________________________________________________________

    File system:      
    Boot sector type:  -
    Boot sector info:

sda3: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 8 or 10
    Boot files:        /Windows/System32/winload.exe

sda4: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System: 
    Boot files:       

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System: 
    Boot files:       

sda6: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Ubuntu 20.04.3 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub


================================ 2 OS detected =================================

OS#1:   The OS now in use - Ubuntu 20.04.3 LTS CurrentSession on sda6
OS#2:   Windows 8 or 10 on sda3

================================ Host/Hardware =================================

CPU architecture: 64-bit
Video: Richland[RadeonHD8650G] from   Advanced Micro Devices, Inc. [AMD/ATI]
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.11.0-44-generic root=UUID=7c1a099d-3263-4d58-b7cc-33ef8b9d3b98 ro quiet splash vt.handoff=7
df -Th / : /dev/sda6      ext4  635G  9.4G  594G   2% /


===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
No EFI in dmseg.
SecureBoot disabled.

efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0002,3002,0003,2001,2002,2003
Boot0000* Internal EFI Shell    MemoryMapped(11,0xaa248010,0xaaa4800f)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)RC....
Boot0001* Internal EFI Shell    MemoryMapped(11,0xa9ae8010,0xaa2e800f)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)RC....
Boot0002* Windows Boot Manager    HD(1,GPT,3da7dec9-bd9a-4a19-a30e-400c630ef687,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0003* ubuntu    HD(1,GPT,3da7dec9-bd9a-4a19-a30e-400c630ef687,0x800,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0004* Internal EFI Shell    MemoryMapped(11,0xa9ae8010,0xaa2e800f)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)RC....
Boot2001* USB Drive (UEFI)    RC
Boot2002* Internal CD/DVD ROM Drive (UEFI)    RC
Boot3000* Internal Hard Disk or Solid State Disk    RC
Boot3002  Internal Hard Disk or Solid State Disk    RC
Boot3003* Internal Hard Disk or Solid State Disk    RC



============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sda    : is-GPT,    no-BIOSboot,    has---ESP,     not-usb,    not-mmc, has-os,    has-win,    2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sda6    : is-os,    64, apt-get,    signed grub-pc grub-efi ,    grub2,    grub-install,    grubenv-ok,    update-grub,    farbios
sda1    : no-os,    32, nopakmgr,    no-docgrub,    nogrub,    nogrubinstall,    no-grubenv,    noupdategrub,    not-far
sda3    : is-os,    32, nopakmgr,    no-docgrub,    nogrub,    nogrubinstall,    no-grubenv,    noupdategrub,    farbios
sda4    : no-os,    32, nopakmgr,    no-docgrub,    nogrub,    nogrubinstall,    no-grubenv,    noupdategrub,    farbios
sda5    : no-os,    32, nopakmgr,    no-docgrub,    nogrub,    nogrubinstall,    no-grubenv,    noupdategrub,    farbios

Partitions info (2/3): _________________________________________________________

sda6    : isnotESP,    fstab-has-goodEFI,    no-nt,    no-winload,    no-recov-nor-hid,    no-bmgr,    notwinboot
sda1    : is---ESP,    part-has-no-fstab,    no-nt,    no-winload,    no-recov-nor-hid,    no-bmgr,    notwinboot
sda3    : isnotESP,    part-has-no-fstab,    no-nt,    haswinload,    no-recov-nor-hid,    no-bmgr,    notwinboot
sda4    : isnotESP,    part-has-no-fstab,    no-nt,    no-winload,    recovery-or-hidden,    no-bmgr,    notwinboot
sda5    : isnotESP,    part-has-no-fstab,    no-nt,    no-winload,    no-recov-nor-hid,    no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

sda6    : not-sepboot,    with-boot,    fstab-without-boot,    not-sep-usr,    with--usr,    fstab-without-usr,    std-grub.d,    sda
sda1    : not-sepboot,    no-boot,    part-has-no-fstab,    not-sep-usr,    no---usr,    part-has-no-fstab,    std-grub.d,    sda
sda3    : not-sepboot,    no-boot,    part-has-no-fstab,    not-sep-usr,    no---usr,    part-has-no-fstab,    std-grub.d,    sda
sda4    : not-sepboot,    no-boot,    part-has-no-fstab,    not-sep-usr,    no---usr,    part-has-no-fstab,    std-grub.d,    sda
sda5    : maybesepboot,    no-boot,    part-has-no-fstab,    not-sep-usr,    no---usr,    part-has-no-fstab,    std-grub.d,    sda

fdisk -l (filtered): ___________________________________________________________

Disk sda: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk identifier: A391D5FF-1C78-4097-AF69-E6B3C699555E
           Start        End    Sectors   Size Type
sda1        2048     206847     204800   100M EFI System
sda2      206848     239615      32768    16M Microsoft reserved
sda3      239616  586177115  585937500 279.4G Microsoft basic data
sda4  1999366144 2000406527    1040384   508M Windows recovery environment
sda5   586178560  644771839   58593280    28G Linux filesystem
sda6   644771840 1999366143 1354594304 645.9G Linux filesystem
Partition table entries are not in disk order.

parted -lm (filtered): _________________________________________________________

sda:1024GB:scsi:512:512:gpt:ATA SanDisk SDSSDH3:;
1:1049kB:106MB:105MB:fat32:EFI system partition:boot, esp;
2:106MB:123MB:16.8MB::Microsoft reserved partition:msftres;
3:123MB:300GB:300GB:ntfs:Basic data partition:msftdata;
5:300GB:330GB:30.0GB:ext4::;
6:330GB:1024GB:694GB:ext4::;
4:1024GB:1024GB:533MB:ntfs::hidden, diag;

Free space (filtered): _________________________________________________________

sda:976762MiB:scsi:512:512:gpt:ATA SanDisk SDSSDH3:;
1:0.02MiB:1.00MiB:0.98MiB:free;
1:286219MiB:286220MiB:0.71MiB:free;
1:976761MiB:976762MiB:1.32MiB:free;

gdisk (filtered): ______________________________________________________________

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 2000409264 sectors, 953.9 GiB
Disk identifier (GUID): A391D5FF-1C78-4097-AF69-E6B3C699555E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 2000409230
Partitions will be aligned on 2048-sector boundaries
Total free space is 6161 sectors (3.0 MiB)
Number  Start (sector)    End (sector)  Size       Code  Name
1            2048          206847   100.0 MiB   EF00  EFI system partition
2          206848          239615   16.0 MiB    0C01  Microsoft reserved ...
3          239616       586177115   279.4 GiB   0700  Basic data partition
4      1999366144      2000406527   508.0 MiB   2700
5       586178560       644771839   27.9 GiB    8300
6       644771840      1999366143   645.9 GiB   8300

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL PARTLABEL
sda                                                                                            
├─sda1 vfat     ECEA-B00F                            3da7dec9-bd9a-4a19-a30e-400c630ef687       EFI system partition
├─sda2                                               6a90b853-d014-454f-8e63-f541043608ec       Microsoft reserved partition
├─sda3 ntfs     38B0153BB01500D4                     97fc5cbb-e5b7-4c87-961c-d15aa7ab1991       Basic data partition
├─sda4 ntfs     36FCE105FCE0C06B                     d64433f8-57ab-4c58-9bdd-7d398ad2a3a3      
├─sda5 ext4     9703b703-f978-4bd3-9513-26b512945caf d54876e4-0970-4650-98fa-f2a4e392a737      
└─sda6 ext4     7c1a099d-3263-4d58-b7cc-33ef8b9d3b98 d182c6cc-053b-410b-8f5c-81aa08f7c7a8      

df (filtered): _________________________________________________________________

                   Avail            Use% Mounted on
sda3              931.8G 25185954747007% /mnt/boot-sav/sda3
sda4               88.1M             83% /mnt/boot-sav/sda4
sda5               22.5G             13% /home
sda6              593.1G              1% /

Mount options: __________________________________________________________________

sda3              rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda4              rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5              rw,relatime
sda6              rw,relatime,errors=remount-ro

===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 7c1a099d-3263-4d58-b7cc-33ef8b9d3b98 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda6/boot/grub/grub.cfg (filtered) ======================

Ubuntu   7c1a099d-3263-4d58-b7cc-33ef8b9d3b98
Ubuntu, with Linux 5.11.0-44-generic   7c1a099d-3263-4d58-b7cc-33ef8b9d3b98
Ubuntu, with Linux 5.11.0-27-generic   7c1a099d-3263-4d58-b7cc-33ef8b9d3b98
Windows Boot Manager (on sda1)   osprober-efi-ECEA-B00F
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings   uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###

========================== sda6/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=7c1a099d-3263-4d58-b7cc-33ef8b9d3b98 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
# /home was on /dev/sda5 during installation
UUID=9703b703-f978-4bd3-9513-26b512945caf /home           ext4    defaults        0       2
/swapfile                                 none            swap    sw              0       0
UUID=ECEA-B00F  /boot/efi       vfat    defaults      0       1

======================= sda6/etc/default/grub (filtered) =======================

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER=false

==================== sda6: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
 441.580253601 = 474.143186944  boot/grub/grub.cfg                             1
 441.048046112 = 473.571733504  boot/vmlinuz                                   1
 312.827789307 = 335.896281088  boot/vmlinuz-5.11.0-27-generic                 1
 441.048046112 = 473.571733504  boot/vmlinuz-5.11.0-44-generic                 1
 312.827789307 = 335.896281088  boot/vmlinuz.old                               1
 315.833435059 = 339.123568640  boot/initrd.img                                4
 315.680248260 = 338.959085568  boot/initrd.img-5.11.0-27-generic              1
 315.833435059 = 339.123568640  boot/initrd.img-5.11.0-44-generic              4
 315.680248260 = 338.959085568  boot/initrd.img.old                            1

===================== sda6: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root 18151 Aug 12 02:18 10_linux
-rwxr-xr-x 1 root root 42359 Aug 12 02:18 10_linux_zfs
-rwxr-xr-x 1 root root 12894 Aug 12 02:18 20_linux_xen
-rwxr-xr-x 1 root root 12059 Aug 12 02:18 30_os-prober
-rwxr-xr-x 1 root root  1424 Aug 12 02:18 30_uefi-firmware
-rwxr-xr-x 1 root root   214 Aug 12 02:18 40_custom
-rwxr-xr-x 1 root root   216 Aug 12 02:18 41_custom




Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would purge (in order to unsign-grub) and reinstall the grub-efi of
sda6,
using the following options:        sda1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s  use-standard-efi-file  restore-efi-backups 

Final advice in case of suggested repair: ______________________________________


Please do not forget to make your UEFI firmware boot on the The OS now in use - Ubuntu 20.04.3 LTS CurrentSession entry (sda1/efi/****/grub****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.

If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\grub****.efi (**** will be updated in the final message)

I don't know about bcdedit, what are the asterisks meaning?

Thanks,
--glenn
 
Last edited:

Members online


Latest posts

Top