[SOLVED] Ghost of replaced install still in efi boot
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Rep:
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
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
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.
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.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
Quote:
Originally Posted by hazel
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
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)
Last edited by Nishtya; 01-17-2024 at 09:24 AM.
Reason: more info, development
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
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
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.
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.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
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
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.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
Quote:
Originally Posted by jayjwa
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.