<SOLVED> Can only boot into mint. Resets boot order in UEFI

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

<SOLVED> Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

Hey there Mint fam! I've used linux on and off over the years. Not much more than to revive old laptops or to explore when i was bored with windows. I got a new to me thinkpad w550s a few months back and just put a second SSD in it and decided it was time to give it another more serious go. It's gotten a little too serious for my comfort real quick. I'm taking online college classes and my windows has everything in it (of course).

On to the issue... I downloaded and installed mint 20.2 xfce from usb to my second drive (sdb) without a single hiccup. I could swap between OS's through the UEFI menu no problem but could not for the life of me get a GRUB menu to show at boot. So i started following online walkthroughs and crawling the forums. It appears i followed a wrong path along the way because now i am only able to boot to Mint. My UEFI no longer sees the windows boot loader. When i change my boot order in UEFI and save and reboot, it blinks the lenovo splash a few times and eventually boots back into Mint. When i reboot into UEFI it shows that my boot order has been reset with Ubuntu at the top again.

So at this point I can not boot anything other than Mint. no USB, no Windows, nothing. I pulled the SSD with mint out to see if it would find windows and it booted to a basic GRUB 2 terminal. not like the GRUB menu im used to seeing. I put the SSD back in and same issue remains. Mint only.

It all started after i ran these commands:
sudo mount /dev/sdb2 /mnt
sudo grub-install --root-directory=/mnt /dev/sdb

I also used efibootmgr to attempt to change the boot order.

When i run update-grub it finds all the linux and windows partitions along with the windows bootloader. I'm just not sure how to get it back to the way things were without making it worse and squashing my machine. Any help would be greatly appreciated. I would love to be able to do my homework in windows and spend my free time learning linux.
Thank you in advance, ED
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

For reference. I've seen this information asked for in similar forum posts.

Code: Select all

lsblk -f
NAME FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                   
├─sda1
│    vfat         2C77-063C                                           
├─sda2
│                                                                     
├─sda3
│    ntfs         AC2E77F72E77B942                                    
└─sda4
     ntfs         C6BE105CBE1046F9                                    
sdb                                                                   
├─sdb1
│    vfat         A8D9-7F21                             503.2M     2% /boot/efi
└─sdb2
     ext4         409328e4-dc1d-40d7-9bc1-75a047538311  100.1G     9% /

Code: Select all

 blkid
/dev/sda1: UUID="2C77-063C" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="e91130ce-5555-4d05-a4fa-b4e6e71cc197"
/dev/sda3: UUID="AC2E77F72E77B942" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c288e815-1ea4-4c1e-a58e-e9bb98123287"
/dev/sda4: UUID="C6BE105CBE1046F9" TYPE="ntfs" PARTUUID="7446b794-ae51-443d-9139-5c67f4091cba"
/dev/sdb1: UUID="A8D9-7F21" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2c850779-5aea-437f-8834-680a807e52b9"
/dev/sdb2: UUID="409328e4-dc1d-40d7-9bc1-75a047538311" TYPE="ext4" PARTUUID="bab6946f-d251-4fa5-bc6d-d39647c8b6e3"

Code: Select all

sudo update-grub
           
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-84-generic
Found initrd image: /boot/initrd.img-5.4.0-84-generic
Found linux image: /boot/vmlinuz-5.4.0-74-generic
Found initrd image: /boot/initrd.img-5.4.0-74-generic
Found Windows Boot Manager on /dev/sda1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

More searching leads me to /etc/fstab, which states:
/ was on /dev/sdb2 during installation
and also:
/boot/efi was on /dev/sda1 during installation

In the disks program i can see all partitions on both drives, and that /dev/sdb1 is currently /boot/efi and /dev/sdb2 is mounted at root.
I'm assuming I need to change things back to the way they were at installation, but i'm currently unsure enough to make changes.
User avatar
Jo-con-Ël
Level 11
Level 11
Posts: 3511
Joined: Sun Jun 20, 2021 12:41 pm
Location: donde habita el olvido

Re: Can only boot into mint. Resets boot order in UEFI

Post by Jo-con-Ël »

Get into Lenovo BIOS setup looks to be tricky (For some models, instead of pressing F1, continuously press Enter during powering on until a Startup Interrupt Menu displays).
Ed351 wrote: Thu Sep 16, 2021 11:09 pm could not for the life of me get a GRUB menu to show at boot
If your problem is you can not see grub menu on booting you can edit /etc/default/grub

Code: Select all

xed admin:///etc/default/grub
and leave first lines as follow
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
Save file, close editor and update grub

Code: Select all

sudo update-grub 
Then reboot.
You can undo changes you have made as per your first post (*) but I think it is not necessary.

You talk about the changes you have tried with efibootmgr with no efect but didn't provide such information (sudo efibootmgr -v).

Maybe your firmware is defective (there is a BIOS update dated in september) and it is worth (always) change boot order in UEFI/BIOS settings.

You will have an entry to get into firmware setting (BIOS setup) in GRUB menu once you can see it (Adding boot menu entry for UEFI Firmware Settings).

--------------------------------------------------------------------------------------
(*) To turn back Mint directing boot from EFI in sda:
1)Unmount sb1 EFI partition

Code: Select all

sudo umount /boot/efi
2)Mount sda1 EFI partition

Code: Select all

sudo mount /dev/sda1 /boot/efi
3) Edit fstab and uncomment old EFI line and comment the new one

Code: Select all

xed admin:///etc/fstab
Remove # at the beginning of the old efi line
#/boot/efi was on /dev/sda1 during installation
#UUID="2C77-063C" /boot/efi.....
and add # at the beginning of the new efi line
#UUID="A8D9-7F21" /boot/efi...
Save file and close editor.
4)Reinstall grub

Code: Select all

sudo grub-install /dev/sda
5)Update grub

Code: Select all

sudo update-grub
6)Reboot
Arrieritos semos y en el camino nos encontraremos.
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

Sorry for the delayed response. I really appreciate the help. My bios is updated to the most recent version and I have no issue getting into the BIOS, as i have it set to diplay the prompt to press enter to interrupt normal startup. From there i can access the BIOS as normal. What I believe is happening is since i have the wrong /boot/efi partition mounted, it is unable to boot into any changes i make in BIOS, then when it finally does boot to Mint, it overrides my boot order.

As mentioned, here is the output for efibootmgr -v:

Code: Select all

sudo efibootmgr -v
[sudo] password for edison:            
BootCurrent: 0012
Timeout: 0 seconds
BootOrder: 0012,000C,0009,000B,0003,0007,0008,000A,000D
Boot0000  Setup	FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0001  Boot Menu	FvFile(126a762d-5758-4fca-8531-201a7f57f850)
Boot0002  Diagnostic Splash Screen	FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
Boot0003  Lenovo Diagnostics	FvFile(3f7e615b-0d45-4f80-88dc-26b234958560)
Boot0004  Startup Interrupt Menu	FvFile(f46ee6f4-4785-43a3-923d-7f786c3c8479)
Boot0005  Rescue and Recovery	FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
Boot0006  MEBx Hot Key	FvFile(ac6fd56a-3d41-4efd-a1b9-870293811a28)
Boot0007* USB CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0008* USB FDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0009* ATA HDD0	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot000A* ATA HDD1	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f601)
Boot000B* ATA HDD2	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
Boot000C* USB HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
Boot000D* PCI LAN	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
Boot000E* IDER BOOT CDROM	PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,1,0)
Boot000F* IDER BOOT Floppy	PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,0,0)
Boot0010* ATA HDD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)
Boot0011* ATAPI CD	VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a354)
Boot0012* ubuntu	HD(1,GPT,2c850779-5aea-437f-8834-680a807e52b9,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Again, thank so much for your help. I have learned my lesson to not blindly enter commands from the internet for sure!
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

If i were to run efibootmgr -O, would that remove any override to the BIOS boot order, or do i have to specify a new boot order?
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

Have just gone through all previous suggestions/commands. fstab now shows that sda1 is mounted as /boot/efi after reboot. also installed and updated grub. the output still sees windows bootloader. Although on reboot it still goes straight to Mint, even after changing BIOS boot order with ubuntu as 4th in the boot order. And efibootmgr still shows same output as i did not change it.

/etc/default/grub was updated to show the lines you mention as my first attempt to show grub, as that has worked for me in the past. That's what caused me to dig deeper.
After following your steps to correct /boot/efi and editing fstab, i ran the install and update for grub. It again sees windows in the output, but does not greet me upon booting.
Upon reopening grub to confirm the edit i get this but the file still opens:

Code: Select all

xed admin:///etc/default/grub

** (xed:2136): WARNING **: 11:19:30.251: The specified location is not mounted
here is grub default:

Code: Select all

GRUB_DEFAULT="menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-2C77-063C' {"
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=""
Ed351
Level 1
Level 1
Posts: 7
Joined: Thu Sep 16, 2021 7:40 pm

Re: Can only boot into mint. Resets boot order in UEFI

Post by Ed351 »

The steps to restore my fdisk to original worked perfectly. It seems what was keeping me from originally getting a grub menu and boot order being reset to boot straight into Mint was CSM under secure boot. Not sure how I overlooked that the first 10 times, but I can now boot to grub. The first time even after having installed and updating grub several times did not list windows in the menu. Although booting into Mint and running update-grub found Windows and it is now present in the boot menu. Now to attempt more research and forum crawling in my adventure in linux! Big shout-out to Jo-con_El!
Locked

Return to “Installation & Boot”