LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2024, 07:14 AM   #1
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Rep: Reputation: 32
Ghost of replaced install still in efi boot


Not a linux newbie. Definitely an EFI booting newbie and at wit's end.

Old Dell laptop but UEFI capable. Had been using legacy BIOS compatible mode for years but when I got a new ssd decided to go all UEFI and modern-like. On new ssd I had put in 4 installs on 4 partitions you can still see below.

Code:
Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1128447   1126400  550M EFI System
/dev/sda2    1128448 144488447 143360000 68.4G Microsoft basic data
/dev/sda3  144488448 322303999 177815552 84.8G Linux filesystem
/dev/sda4  322304000 411922431  89618432 42.7G Linux filesystem
/dev/sda5  411922432 500117503  88195072 42.1G Linux filesystem
they are in order windows 10, kubuntu, linuxmint (formerly PCLOS) and mageia

I replaced PCLOS on sda4 with linuxmint by just pointing installer at sda4 and it went fine. Rebooted got the mint grub and mint was default (kubuntu my daily drive) figured that was an easy fix later and went to play with mint. Rebooted with f2 to get into BIOS setup to move the ubuntu on top of EFI boot but to my surprise it was already at the top and PCLOS is still in there down in the list, linuxmint not in there. I could take a shot with my phone if anybody thinks seeing it will help plz advise. I was able to uncheck PCLOS in BIOS but mint did not exist to check to add. I fired up the live ubuntu usb to fix grub in efi. I had previously done this after trying to install mint on an external drive got really hairy. I did:

Quote:
sudo mount /dev/sda3 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
update-grub
No errors. Rebooted, checked in BIOS setup on the way, PCLOS still exists in BIO and mint doesn't. Ubuntu is the default, it's grub does have mint (and mageia) along with windows choice. How does one "reset" what the BIOS is seeing? This is the output for efibootmgr

BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0001,0003,0002,0000
Boot0000* Windows Boot Manager
Boot0001 pclinuxos
Boot0002* mageia
Boot0003* ubuntu

Please help me sort this. I like to play with distros on the side and even USB 2.0 can be slow for running them on a stick and persistence is almost as tricky to get going as this efi. But I could fix up old grub grub 2 on legacy BIOs no matter how many different ones I tried out. With EFI are you stuck with the ghost of every distro past or something? I am ready to chuck it all, wipe the disk and back to just windows and ubuntu and never look at new shiny pretty distros again. Someday they will lock the hardware down so bad it is only going to be one or none. this isn't funny anymore
 
Old 01-17-2024, 08:00 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,575
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
Another one! Business_kid and I have already experienced this. https://www.linuxquestions.org/quest...ll-4175732660/. I wonder how many of these rogue UEFIs there are out there and whether they are all from the same manufacturer.

It seems that some UEFIs don't respond to the instructions that efibootmgr writes into their nvram. Specifically, they don't recognise list priority or activation/deactivation of entries. You need to use efibootmgr's delete function to remove the UEFI's preferred option completely if you don't want it to be used.
 
Old 01-17-2024, 08:03 AM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,352

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Ubuntu based distros tend to use the ubuntu name tag on the efi partition and will overwrite the previously installed Ubuntu based distro boot loader on the efi partition versus using a unique name such as linuxmint. Check the contents of /boot/efi/EFI

Last edited by colorpurple21859; 01-17-2024 at 08:08 AM.
 
Old 01-17-2024, 08:53 AM   #4
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by hazel View Post
Another one! Business_kid and I have already experienced this. https://www.linuxquestions.org/quest...ll-4175732660/. I wonder how many of these rogue UEFIs there are out there and whether they are all from the same manufacturer.

It seems that some UEFIs don't respond to the instructions that efibootmgr writes into their nvram. Specifically, they don't recognise list priority or activation/deactivation of entries. You need to use efibootmgr's delete function to remove the UEFI's preferred option completely if you don't want it to be used.
Here is a pic of the setup screen if attaching a small pic works. There are options to delete and to add. What information is needed to add to this? There is a string prefilled and then another to add a file path.

Quote:
Originally Posted by colorpurple21859 View Post
Ubuntu based distros tend to use the ubuntu name tag on the efi partition and will overwrite the previously installed Ubuntu based distro boot loader on the efi partition versus using a unique name such as linuxmint. Check the contents of /boot/efi/EFI
Location of /boot/efi/EFI and command? I didn't have much luck finding it

Update: I tried using the BIOs setup to delete PCLINUXOS ghost and get the mint in there. Whoops. Had to reset BIOs to defaults, I now have just Windows. Data will all be there and be fine there was not formatting it must be there, will boot a live USB and transfer off my stuff, reinstall kubuntu alongside windows now with more room! Kubuntu will not have to share except with windows which totally ignores it anyway. I will not try and multiboot beyond a windows and one linux ever again. This is just too temperamental- the documentation and such are all over with what to do and I don't want to end up with a brick. Sadly, the attempt at keeping play distros for joyriding on an external drive proved no easier. When the external was not attached (which it usually isn't) all hell broke loose. UEFI was supposed to be the modern streamlined way, right? Oh and secure (haven't enabled secure boot yet and have no intention of ever doing so)
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	9
Size:	26.0 KB
ID:	42429  

Last edited by Nishtya; 01-17-2024 at 09:24 AM. Reason: more info, development
 
Old 01-17-2024, 09:34 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,352

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Open a terminal and post the output of the following:
Code:
 sudo ls -R /boot/efi/EFI
To give mint its own bootloader
Code:
sudo grub-install —bootloader-id=linuxmint
To change boot order
Code:
sudo efibootmgr -o xxxx xxxx xxxx
whereas xxxx is the id number of each entry
 
Old 01-17-2024, 09:42 AM   #6
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
I do the above from a live USB, don't mount anything or such? I am windows right now as it is my only boot choice.

I am in unknown territory here but in a pinch I can always throw the old SSD in that I have been using for an external if I screw the pooch will still have windows and my old ubuntu installs... as long as I don't brick it from BIOS

Last edited by Nishtya; 01-17-2024 at 09:43 AM. Reason: adding only windows accessible now
 
Old 01-17-2024, 09:57 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
I would "sort" it using these weapons - all reliable commands in efibootmgr. a user running it needs sudo
Code:
efibootmgr -b <boot-number> -B # deletes a phantom OS, e.g.
efibootmgr -b 2 -B # deletes boot 0002, mageia in your list
To change the boot order, you need to run the two commands below without rebooting in between!
Code:
efibootmgr -O
efibootmgr -o 3,2,1,0 # or whatever your new boot order is. No spaces, but commas.
This is all online if you're prepared to wade through the unnecessary bilge that populates any useful web page. If the boot order isn't right, try attacking the BIOS in Setup and setting it there.

Last edited by business_kid; 01-17-2024 at 09:58 AM.
 
Old 01-17-2024, 10:42 AM   #8
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
Unfortunately I don't have anything (that EFI recognizes anymore) to populate it with. Output from bootmgr

Code:
 kubuntu@kubuntu:~$ sudo efibootmgr
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* Windows Boot Manager
Boot0001* UEFI: ADATA USB Flash Drive 0.00, Partition 2
Short of reinstalling kubuntu I don't know what to do. Does it keep last old copy as a backup or anything
 
Old 01-17-2024, 11:09 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,575
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
You need to look at the contents of your EFI system partition. This is usually mounted on /boot/efi in Linux. I don't know where Windows mounts it but it should be easily accessible since it uses the old Windows-95 filesystem (vfat). There will be a directory on it called BOOT containing the Windows bootloader BOOTX86.efi and other directories containing various versions of GRUB. If I were you, I would just keep the Ubuntu GRUB and delete the others. You can always add extra distros to a GRUB menu. Then use Windows bcedit or efibootmgr in your live Kubuntu disc to add that GRUB to the UEFI menu.

Last edited by hazel; 01-17-2024 at 11:11 AM.
 
Old 01-17-2024, 12:08 PM   #10
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
Hazel, I will boot up live usb, will I be able to look for the files referenced in GUI? If not can you guide me CLI. I don't think my usb has vi or gedit maybe has nano
 
Old 01-17-2024, 12:24 PM   #11
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 777

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by Nishtya View Post
kubuntu@kubuntu:~$ sudo efibootmgr
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* Windows Boot Manager
Boot0001* UEFI: ADATA USB Flash Drive 0.00, Partition 2
Why don't your entries actually point to partitions, files, and UEFI loaders?

Code:
efibootmgr
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0007,0008,0000,0001,0006,000A,0004,0005
Boot0000* slackware-15.0+	HD(1,GPT,1d39afc6-46db-4550-b122-74c8381926f3,0x800,0x82000)/File(\EFI\SLACKWARE-15.0+\GRUBX64.EFI)
Boot0001* Slackware	HD(1,GPT,1d39afc6-46db-4550-b122-74c8381926f3,0x800,0x82000)/File(\EFI\SLACKWARE\ELILO.EFI)
Boot0004* Generic Usb Device	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* CD/DVD Device	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0006* UEFI OS	HD(1,GPT,1d39afc6-46db-4550-b122-74c8381926f3,0x800,0x82000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
Boot0007* HL-DT-ST DVDRAM GUE0N	BBS(CDROM,,0x0)..BO
Boot0008* WDC WD10EZEX-08WN4A0	BBS(HD,,0x0)..BO
Boot000A* Realtek PXE B01 D00	BBS(Network,,0x0)..BO
 
Old 01-17-2024, 01:24 PM   #12
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Quote:
Originally Posted by Nishtya View Post
Unfortunately I don't have anything (that EFI recognizes anymore) to populate it with. Output from bootmgr

Code:
 kubuntu@kubuntu:~$ sudo efibootmgr
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* Windows Boot Manager
Boot0001* UEFI: ADATA USB Flash Drive 0.00, Partition 2
Short of reinstalling kubuntu I don't know what to do. Does it keep last old copy as a backup or anything
From either a live boot or Kubuntu you can mount the partitions and chroot in to reinstall grub. Make sure to mount all of them + the efi partition in the proper places. It will also require you to mount /proc /sys and /dev with bind mounts.

example

Code:
mount /dev/$KUBUNTU /mnt
mount /dev/$EFI /mnt/boot/efi
for i in sys proc dev ; do
  mount --bind "$i" /mnt/"$i"
done
If you have the system set up with extra partitions that are for that installation then it would be good to mount them as well for the chroot grub install.
 
Old 01-17-2024, 01:34 PM   #13
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Get some linux running somehow.Mount the efi partition, and check that kubuntu has a section in the EFI directory. Here's my EFI partition
Code:
dec@Ebony:/boot/efi$ls EFI
Boot/  Microsoft/  Slackware/  debian/
If kubuntu has a directory there, post the contents. If not, and presuming you don't have a backup, reinstall. If you do have a backup, restore it.
 
Old 01-17-2024, 02:06 PM   #14
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by jayjwa View Post
Why don't your entries actually point to partitions, files, and UEFI loaders?

Code:

Good question. when I pulled it earlier in the disaster the GUIDs were there. That was before something went belly up and I did a default reset on the bios and everything but windows disappeared. Let me poke around with the other suggestions.
 
Old 01-17-2024, 02:10 PM   #15
Nishtya
Member
 
Registered: Feb 2004
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by business_kid View Post
Get some linux running somehow.Mount the efi partition, and check that kubuntu has a section in the EFI directory. Here's my EFI partition
Code:
dec@Ebony:/boot/efi$ls EFI
Boot/  Microsoft/  Slackware/  debian/
If kubuntu has a directory there, post the contents. If not, and presuming you don't have a backup, reinstall. If you do have a backup, restore it.
what does this mean besides the obvious?
Code:
root@kubuntu:/# /boot/efi$ls EFI
bash: /boot/efi: Is a directory
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] efi/boot/boot64.efi and slack uefi install Q BW-userx Slackware 4 10-14-2022 10:13 AM
EFI System Partition: Using it as /boot versus /boot/efi MirceaKitsune Linux - General 4 04-06-2021 11:07 AM
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
resize efi question [/boot/efi] with boot flag gparted mtdew3q Fedora 4 03-19-2017 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration