Option to select between windows 10 and ubuntu 20.04 is not showing.

bharu

New Member
Credits
196
Hi guys,
I have recently dual booted my HP Pavilion laptop with Ubuntu 20.04. I have successfully installed Ubuntu 20.04 but whenever I restart my laptop, the system directly enters windows 10 without showing the options to select ubuntu or windows that is GNU GRUB menu.

What I do now is whenever I restart I press ESC to pause startup and out of various options, I press F9 to select Boot Device Options to enter boot options and after that I will be shown with options such as OS boot manager and a lot of Ubuntu (Hitachi HTs541010A9E680) and Boot from EFI File. There I will select the first Ubuntu then I will be shown with GNU GRUB version 2.04 where I will be given with options such as *Ubuntu , Advanced options for ubuntu, windows boot manager (on/dev/sda2) and UEFI Firmware Settings.

I want the system to show the GNU Grub menu at the begin of each restart/power on.

Is there any way to do it now?
Please help.
 


wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
14,465
G'day @bharu and welcome to linux.org :)

The first option I would provide works in more cases than not - if not, then we will need to delve deeper.

....Advanced options for ubuntu,
First head to that point and press Enter, you will be presented with a small number of lines

2. One of them (maybe 2) will feature the words Recovery Mode. Choose the first one and press Enter.

3. You will go to a graphical text screen with a number of choices, arrow down to the one saying "Drop to root shell prompt", don't Enter, press Tab to go to OK and press Enter.

4. You will have an amount of output scroll through and when it finishes it will offer you the option to Ctrl-D to continue boot or Enter to enter Maintenance. Choose Enter to Maintenance.

5. Now you will have a prompt that ends in a # meaning you are Root.

We need to establish the partitions and drives your Ubuntu OS is on, unless you are sure you know them. From the looks of what you have said above, Windows will be on /dev/sda2, /dev/sda1 may be an ESP (EFI System Partition) serving both Windows and Ubuntu, and Ubuntu may be on /dev/sda3. Or not.

To establish these things

6. Type in lsblk and press Enter (that is, in radio language lima, sierra, bravo, lima, kilo). This will provide a number of lines one to two of which will feature a forward slash / . One line will just have the / and that is the root partition with your Ubuntu OS files on it. There may be one with /boot/efi, and that is your ESP.

We won't worry about the partition numbers, what is important is to establish the drive (device), so use the correct alpha character to

7. Type in and enter

grub-install /dev/sda (or discovered letter, eg sdb - no need for sudo, we are Root for now) and Enter.

Hopefully you will get a message after a few moments that Grub has been installed with no errors.

8. Then type in

update-grub

and press Enter.

When that is complete

9. Type in and Enter

reboot

The computer will reboot and the desired outcome is to have a Grub Menu appear that will feature Ubuntu on top, followed by Ubuntu Advanced Options, followed by Windows Boot Manager.

See how you go and report back here with the results.

Cheers

Chris Turner
wizardfromoz

Edited - step 7, corrected to grub-install
 
Last edited:

bharu

New Member
Credits
196
G'day @bharu and welcome to linux.org :)

The first option I would provide works in more cases than not - if not, then we will need to delve deeper.



First head to that point and press Enter, you will be presented with a small number of lines

2. One of them (maybe 2) will feature the words Recovery Mode. Choose the first one and press Enter.

3. You will go to a graphical text screen with a number of choices, arrow down to the one saying "Drop to root shell prompt", don't Enter, press Tab to go to OK and press Enter.

4. You will have an amount of output scroll through and when it finishes it will offer you the option to Ctrl-D to continue boot or Enter to enter Maintenance. Choose Enter to Maintenance.

5. Now you will have a prompt that ends in a # meaning you are Root.

We need to establish the partitions and drives your Ubuntu OS is on, unless you are sure you know them. From the looks of what you have said above, Windows will be on /dev/sda2, /dev/sda1 may be an ESP (EFI System Partition) serving both Windows and Ubuntu, and Ubuntu may be on /dev/sda3. Or not.

To establish these things

6. Type in lsblk and press Enter (that is, in radio language lima, sierra, bravo, lima, kilo). This will provide a number of lines one to two of which will feature a forward slash / . One line will just have the / and that is the root partition with your Ubuntu OS files on it. There may be one with /boot/efi, and that is your ESP.

We won't worry about the partition numbers, what is important is to establish the drive (device), so use the correct alpha character to

7. Type in and enter

grub install /dev/sda (or discovered letter, eg sdb - no need for sudo, we are Root for now) and Enter.

Hopefully you will get a message after a few moments that Grub has been installed with no errors.

8. Then type in

update-grub

and press Enter.

When that is complete

9. Type in and Enter

reboot

The computer will reboot and the desired outcome is to have a Grub Menu appear that will feature Ubuntu on top, followed by Ubuntu Advanced Options, followed by Windows Boot Manager.

See how you go and report back here with the results.

Cheers

Chris Turner
wizardfromoz
Hey , thanks for the reply.

I did exactly what you said and I got the following error.
What shall I do now?
 

Attachments

Condobloke

Well-Known Member
Credits
9,956
Are you sure Ubuntu is on /dev/sda
 

bharu

New Member
Credits
196
G'day @bharu and welcome to linux.org :)

The first option I would provide works in more cases than not - if not, then we will need to delve deeper.



First head to that point and press Enter, you will be presented with a small number of lines

2. One of them (maybe 2) will feature the words Recovery Mode. Choose the first one and press Enter.

3. You will go to a graphical text screen with a number of choices, arrow down to the one saying "Drop to root shell prompt", don't Enter, press Tab to go to OK and press Enter.

4. You will have an amount of output scroll through and when it finishes it will offer you the option to Ctrl-D to continue boot or Enter to enter Maintenance. Choose Enter to Maintenance.

5. Now you will have a prompt that ends in a # meaning you are Root.

We need to establish the partitions and drives your Ubuntu OS is on, unless you are sure you know them. From the looks of what you have said above, Windows will be on /dev/sda2, /dev/sda1 may be an ESP (EFI System Partition) serving both Windows and Ubuntu, and Ubuntu may be on /dev/sda3. Or not.

To establish these things

6. Type in lsblk and press Enter (that is, in radio language lima, sierra, bravo, lima, kilo). This will provide a number of lines one to two of which will feature a forward slash / . One line will just have the / and that is the root partition with your Ubuntu OS files on it. There may be one with /boot/efi, and that is your ESP.

We won't worry about the partition numbers, what is important is to establish the drive (device), so use the correct alpha character to

7. Type in and enter

grub install /dev/sda (or discovered letter, eg sdb - no need for sudo, we are Root for now) and Enter.

Hopefully you will get a message after a few moments that Grub has been installed with no errors.

8. Then type in

update-grub

and press Enter.

When that is complete

9. Type in and Enter

reboot

The computer will reboot and the desired outcome is to have a Grub Menu appear that will feature Ubuntu on top, followed by Ubuntu Advanced Options, followed by Windows Boot Manager.

See how you go and report back here with the results.

Cheers

Chris Turner
wizardfromoz
Hey, I did everything which you have mentioned in the steps , but it still booted into windows directly.
 

captain-sensible

Well-Known Member
Credits
10,311
ok access bios and disable fast boot and see if that helps, if not its going to be :
then we will need to delve deeper.
going baack to your image irt seems you were root so sudo was not needed; did you get output grub installed ok and when you ran update-grub , did it mention os Windows found ?
 
Last edited:

captain-sensible

Well-Known Member
Credits
10,311
you power down completely, power on and you need to hit the right key. Common keys are F10, F2, F12, F1, or DEL then search around to find fast boot. For my wifes HP laptop that had Windows 10 on it, i had to set up admin account in order to access "hidden" bios options
 

captain-sensible

Well-Known Member
Credits
10,311
any luck with finding fast boot ?

I think now its a matter of info gathering for Chris , who will no doubt when time zone allows
help you out. Some of my questions might just be helpful , maybe not ?

looking at your image there is an EFI partition , which Windows was using and your motherboard is uefi. I'm wondering if an entry was created for ubuntu on EFI, also when Ubuntu is booted up if its showing that efi is mounted?

Couple of things to try if you want while waiting for Chris , after getting Ubuntu up and running



At a terminal if i enter :

Code:
bash-5.0# efibootmanager -v
bash: efibootmanager: command not found
bash-5.0# efibootmgr  -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0000,9999
Boot0000* Slackware    HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32000)/File(\EFI\Sl
you can see theres an entry for Slackware (thats my only OS)

To do that you will probably need to install efibootmgr either using apt-get or apt.
Code:
//maybe update repo

sudo apt-get update

sudo apt-get install efibootmgr

//or apt

sudo apt update

sudo apt install efibootmgr

//then run command below

sudo efibootmgr -v
//copy and paste from terminal and paste forum



[CODE]

Also post output of:

[CODE]
cat /etc/fstab
eg mine :

Code:
bash-5.0$ cat /etc/fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda3        /                ext4        defaults         1   1
/dev/sda1        /boot/efi        vfat        defaults         1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0
you can do that without sudo

that shows that my efi partition is mounted ; i'm wondering if yours is for Ubuntu once booted.
 

wizardfromoz

Super Moderator
Staff member
Gold Supporter
Credits
14,465

bharu

New Member
Credits
196
any luck with finding fast boot ?

I think now its a matter of info gathering for Chris , who will no doubt when time zone allows
help you out. Some of my questions might just be helpful , maybe not ?

looking at your image there is an EFI partition , which Windows was using and your motherboard is uefi. I'm wondering if an entry was created for ubuntu on EFI, also when Ubuntu is booted up if its showing that efi is mounted?

Couple of things to try if you want while waiting for Chris , after getting Ubuntu up and running



At a terminal if i enter :

Code:
bash-5.0# efibootmanager -v
bash: efibootmanager: command not found
bash-5.0# efibootmgr  -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0000,9999
Boot0000* Slackware    HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32000)/File(\EFI\Sl
you can see theres an entry for Slackware (thats my only OS)

To do that you will probably need to install efibootmgr either using apt-get or apt.
Code:
//maybe update repo

sudo apt-get update

sudo apt-get install efibootmgr

//or apt

sudo apt update

sudo apt install efibootmgr

//then run command below

sudo efibootmgr -v
//copy and paste from terminal and paste forum



[CODE]

Also post output of:

[CODE]
cat /etc/fstab
eg mine :

Code:
bash-5.0$ cat /etc/fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda3        /                ext4        defaults         1   1
/dev/sda1        /boot/efi        vfat        defaults         1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro,comment=x-gvfs-show 0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0
you can do that without sudo

that shows that my efi partition is mounted ; i'm wondering if yours is for Ubuntu once booted.
Hey ,
I couldn't find fast boot to disable it.
Meanwhile , I tried the code you said.
Here is the output.

Thanks,
Bharu
 

Attachments

captain-sensible

Well-Known Member
Credits
10,311
had a quick look. It seems as far as i can tell that Ubuntu indeed has a entry for boot on the esp. Its stating hd2 the same for Windows; but does that mean you have another hard drive attached ?

In theory though grub appears to be installed ok on the basis of using uefi . It also seems that in terms of boot order Ububtu is first.So that takes out thinking of trying to change boot order ?
 

bharu

New Member
Credits
196
had a quick look. It seems as far as i can tell that Ubuntu indeed has a entry for boot on the esp. Its stating hd2 the same for Windows; but does that mean you have another hard drive attached ?

In theory though grub appears to be installed ok on the basis of using uefi . It also seems that in terms of boot order Ububtu is first.So that takes out thinking of trying to change boot order ?
Yes.
 

captain-sensible

Well-Known Member
Credits
10,311
well i'm sure Chris is looking into this. Perhaps it can't do any harm to propose suggestions. Either they will be on the right track or off track. I'm sure Chris will clarify then at least i might learn something . I haven't really touched Windows in quite a while .To be true i'm a Slackware man dabbling in Debian, derivatives. Thats the disclaimer over :^)


Now suggestions:

  • Boot into Windows OS
  • Combine Windows + r together and type cmd to open command prompt.
  • Type bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi and hit enter key

Path is important an d i've crossed referenced from your image's you posted . The efi entry from efibootmgr was \EFI\ubuntu\grubx64.efi
so above should be Ok
 
Last edited by a moderator:

bharu

New Member
Credits
196
well i'm sure Chris is looking into this. Perhaps it can't do any harm to propose suggestions. Either they will be on the right track or off track. I'm sure Chris will clarify then at least i might learn something . I haven't really touched Windows in quite a while .To be true i'm a Slackware man dabbling in Debian, derivatives. Thats the disclaimer over :^)


Now suggestions:

  • Boot into Windows OS
  • Combine Windows + r together and type cmd to open command prompt.
  • Type bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi and hit enter key

Path is important an d i've crossed referenced from your image's you posted . The efi entry from efibootmgr was \EFI\ubuntu\grubx64.efi
so above should be Ok
Hey,
Thanks for the suggestion man, but no luck yet.
 

Condobloke

Well-Known Member
Credits
9,956
@bharu ....the name of the game is patience.

Show some patience.

All members/Moderators here are volunteers
We are not paid for our input, ...nor do we expect it.
Every member has a home life/private life
That comes before everything else. And that includes answering questions here.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top