Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] Lost efi boot

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
25 posts • Page 1 of 1
Author
Message
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

[SOLVED] Lost efi boot

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 3:14 pm

I feel sick! I screwed up my ryzen system. I put in the sysrescuecd, shut it down, replaced the sda drive with my new SSD and rebooted. I got to the BIOS. Surspised I rebooted agin. Back to the BIOS. Selected CDROM first, rebooted, same same. Powered down, put my original disk in, rebooted, into the BIOS. Selected hard disk priority, booted again. Into the BIOS. It will not boot. Screwed up my best system.

I get a strange crackle from the speakers when I boot.

Split from Should partition sizes be powers of 2 ? per OP request -- NeddySeagoon
Last edited by Tony0945 on Fri Jan 22, 2021 11:25 pm, edited 2 times in total.
Top
figueroa
Advocate
Advocate
User avatar
Posts: 3032
Joined: Sun Aug 14, 2005 8:15 pm
Location: Edge of marsh USA
Contact:
Contact figueroa
Website

  • Quote

Post by figueroa » Fri Jan 22, 2021 3:26 pm

Don't give up. Consider options, inculuding warranty.
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi -wayland
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56084
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Jan 22, 2021 3:30 pm

Tony0945,

It will do that if the settings got corrupted somehow.
Go through all the BIOS settings, check them and even if you don't change anything, save and exit.
The save rewrites the checksum.

When the checksum fails on startup, it takes you to the BIOS.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 3:57 pm

Feeling a little better but only slightly. I'm on the computer in question right now, but booted from the DVD drive in legacy mode. Sysrescuecd.
And thanks to both of you for ultraswift response!

I had the BIOS set for UEFI only and it should have booted my sysrescuecd usb stick but didn't. Anyway, switching to USB+legacy and hitting F11 repeatedly got the DVD to boot.
It is seeing the drives:

Code: Select all

root@MSI /root % ls -l /dev/sd?
brw-rw---- 1 root disk 8,  0 Jan 22 09:41 /dev/sda
brw-rw---- 1 root disk 8, 16 Jan 22 09:41 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jan 22 09:41 /dev/sdc
brw-rw---- 1 root disk 8, 48 Jan 22 09:41 /dev/sdd
I think if I can get it back to UEFI mode, it might be OK. First, I will mount the drives and see if the filesystems look good.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 4:03 pm

Code: Select all

root@MSI /root % parted -l
Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End    Size   File system  Name              Flags
 1      1049kB  106MB  105MB  fat32        EFI System        boot
 2      106MB   500GB  500GB  ext4         Linux filesystem


Model: ATA WDC WD2003FZEX-0 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2000GB  2000GB  ext4


Model: ATA CT1000MX500SSD1 (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size   File system  Name  Flags
 1      1049kB  250GB   250GB  ext4
 2      250GB   500GB   250GB  ext4
 3      500GB   1000GB  500GB  ext4


Model: General USB Flash Disk (scsi)
Disk /dev/sdd: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End     Size    Type     File system  Flags
 1      123kB  16.0GB  16.0GB  primary  fat32        lba


Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0
has been opened read-only.
Error: /dev/sr0: unrecognised disk label                                  
Model: HL-DT-ST BDDVDRW CH10LS28 (scsi)
Disk /dev/sr0: 369MB
Sector size (logical/physical): 2048B/2048B
Partition Table: unknown
Looking good. I see the USB is msdos partition, so that's why it wouldn't boot UEFI? It did boot previously.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 4:08 pm

Mounted /dev/sda2 as /mnt/gentoo. Files look good. But why won't it boot as UEFI?

EDIT: can't chroot into /mnt/gentoo , not good

Code: Select all

oot@MSI /root % chroot /mnt/gentoo /bin/bash
chroot: failed to run command `/bin/bash': Exec format error
Top
figueroa
Advocate
Advocate
User avatar
Posts: 3032
Joined: Sun Aug 14, 2005 8:15 pm
Location: Edge of marsh USA
Contact:
Contact figueroa
Website

  • Quote

Post by figueroa » Fri Jan 22, 2021 4:43 pm

I find that UEFI is a gift from hell. My pretty modern primary desktop machine boots in legacy mode and I am constantly happy for having made that decision.
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi -wayland
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56084
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Jan 22, 2021 4:44 pm

Tony0945,

What does

Code: Select all

file /mnt/gentoo/bin/bash
return?
What does

Code: Select all

uname -a
tell?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 4:56 pm

Code: Select all

root@MSI /root % file /mnt/gentoo/bin/bash
/mnt/gentoo/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, stripped

Code: Select all

root@MSI /root % uname -a
Linux MSI 2.6.38-std231-i586 #2 SMP Tue Aug 23 17:46:59 UTC 2011 i686 AMD Ryzen 7 2700X Eight-Core Processor AuthenticAMD GNU/Linux
That doesn't look right! This should be the last Gentoo based sysrecuecd.

Rummaging through the junk pile on my desk I find a CD hand labeled "sysrecuecd 5.3.2 Last Version".
Going to shut down and boot that.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56084
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Jan 22, 2021 5:04 pm

Tony0945,

That's why you can't chroot ... but you know that.
SystemRescueCD boots i686 by default. You need to choose a 64 bit kernel at the boot menu.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 5:20 pm

I must have pulled a plug in my head and my brains ran out!

Code: Select all

root@MSI /root % uname -a
Linux MSI 4.14.80-std532-amd64 #2 SMP Sun Nov 11 18:59:44 UTC 2018 x86_64 AMD Ryzen 7 2700X Eight-Core Processor AuthenticAMD GNU/Linux
EDIT:
efibootmgr won't run. I'll see if I can re-boot the CD in EFI mode. Otherwise I'll burn the Gentoo LiveUSB on a third machine.

Apologies for my stupidity in this thread!
Last edited by Tony0945 on Fri Jan 22, 2021 11:27 pm, edited 1 time in total.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Fri Jan 22, 2021 7:23 pm

Tony0945 wrote:

Code: Select all

root@MSI /root % parted -l
Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End    Size   File system  Name              Flags
 1      1049kB  106MB  105MB  fat32        EFI System        boot
You haven't set the esp flag here?
Compare to https://wiki.gentoo.org/wiki/EFI_System ... cteristics
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 7:43 pm

Code: Select all

root@MSI /root % parted /dev/sda print
Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name              Flags
 1      1049kB  106MB  105MB  fat32        EFI System        boot, esp
 2      106MB   500GB  500GB  ext4         Linux filesystem

The problem is there is no efibootmgr listing. I followed advice to reinstall refind but the efibootmgr failed.
Here is efibootmgr from a working refind system:

Code: Select all

~ # efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0004,0005,0002,0003
Boot0000* rEFInd Boot Manager	HD(1,GPT,16438771-d6bb-482a-ad34-a1c04d0363c7,0x800,0x200000)/File(\EFI\refind\refind_x64.efi)
...
Here are the results from the system I'm trying to fix:
{ I'm booted non-efi right now }
I'll try to reboot the CD efi. It did it before but hung the last three times.
There should be a way to tell the BIOS to find all existing efi boots.[/code]
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 7:56 pm

Tried to boot sysrescuecd in EFI mode and now it locks up on checking the syslog-ng configuration file.

Is the live DVD EFI? The latest I can find is dated 2017. The admin cd? Is the minimal install UEFI?

When I re-installed refind and it reported efibootmgr failed, I tried to read the shell script. OMG! I can't make heads or tails of it.

There has got to be a way to recover. Apparently when I disconnected the drive and rebooted, the BIOS forget all about that boot listing.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 8:02 pm

Moderator: Please split this at "I feel sick" and title the split part "Lost efi boot" or something similar as it's a diversion from the original thread.
Top
Buffoon
Veteran
Veteran
User avatar
Posts: 1369
Joined: Wed Jun 17, 2015 2:22 pm
Location: EU or US

  • Quote

Post by Buffoon » Fri Jan 22, 2021 9:14 pm

Tried to boot sysrescuecd in EFI mode and now it locks up on checking the syslog-ng configuration file.
Did you run fsck when booted from external media? Anyhow, you must boot in EFI mode to get access to efivars. You may use interactive boot to skip steps which fail in normal mode.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 9:26 pm

OK. In EFI mode from sysrecuecd. I had downloaded the admincd but couldn't write to the DVD writer on the machine I downloaded on.

Anyway, I discovered how to create the new entry, but I got this.

Code: Select all

root@MSI /root % efibootmgr -c -L "REFIND" -l '\EFI\refind\refind_x64.efi'
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
GUID Partition Table Header signature is wrong: 40000064f2fd43a0 != 5452415020494645
Could not prepare Boot variable: Read-only file system
but

Code: Select all

root@MSI /root % mount |grep sda1
/dev/sda1 on /mnt/gentoo/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
 # mount|grep sda
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
How to mount /dev/sda1 so that efibootmgr can write?
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 11:14 pm

Well, it wasn't the partition that was write only. It was the pseudo file system.

The answer was here in the forums:

mount -o remount,rw /sys/firmware/efi/efivars
So the commands to restore the boot were:

Code: Select all

mount -o remount,rw /sys/firmware/efi/efivars
efibootmgr -c -L "REFIND" -l '\EFI\refind\refind_x64.efi' 
Executed from the chroot. The efibootmgr command used the default /dev/sda1, equivalent to paramters " -d /dev/sda -p 1"

I feel GREAT relief to mark this as [SOLVED]
Thank you. thank you. Thank you.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 11:24 pm

figueroa wrote:I find that UEFI is a gift from hell.
Think you are right. I feel like I took a journey into Hell.

I just wanted to run grub-install on a drive from a box with no /dev/sr0 and wouldn't boot my usbstick.
Apparently, disconnecting the drive and connecting another cause the BIOS to forget that choice.

Time to buy another DVD drive. I WON'T disconnect this machine's primary drive again!
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Jan 22, 2021 11:40 pm

Code: Select all

tony@MSI ~ $ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0007,0002
Boot0000* Linux	HD(1,GPT,6cc06059-07a5-450a-be59-c954bf6e846b,0x800,0x32000)/File(\EFI\refind\refind_x64.efi)REFIND
Boot0001  Hard Drive	BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.T.5.0.0.M.X.5.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L.8.1.4.4.1.E.5.D.9.0.0.0. . . . . . . . ........BO..NO..........W.D.C. .W.D.2.0.0.3.F.Z.E.X.-.0.0.S.R.L.A.0...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L. . . . .W. .-.D.M.W.6.C.0.N.2.P.X.7.C.D........BO..NO..........C.T.1.0.0.0.M.X.5.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L.9.1.0.2.2.E.3.0.F.C.9.9. . . . . . . . ........BO
Boot0002  CD/DVD Drive	BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.D.V.D.R.W. .C.H.1.0.L.S.2.8...................\.,.@.r.d.=.X..........A.................................>..Gd-.;.A..MQ..L.8.K.C.L.9.5.0.F.0.6. .1. . . . . . . . ........BO
Boot0003  UEFI: PXE IP4 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x2)/Pci(0x1,0x0)/Pci(0x0,0x0)/MAC(309c231b4251,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0004  UEFI: PXE IP6 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x2)/Pci(0x1,0x0)/Pci(0x0,0x0)/MAC(309c231b4251,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0007* UEFI: HL-DT-ST BDDVDRW CH10LS28, Partition 1	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x1)/Sata(5,65535,0)/CDROM(1,0x4b,0xb40)/HD(1,MBR,0x0,0x0,0xb40)..BO
Can't seem to get rid of the PXE boots, but they are not in the boot order anyway.
Thecaption for B0000 should have been "REFIND" but, hey, "Linux" is fine!
Top
obiwanbill
n00b
n00b
Posts: 7
Joined: Wed Feb 10, 2021 5:21 pm

  • Quote

Post by obiwanbill » Sat Feb 13, 2021 3:52 am

I noticed this exact same issue ... “when you disconnect the SATA drive and reconnect it, the EFI BOOT entry is gone”.

Solution? Recreate the EFI BOOT entry.

Btw, to delete any EFI boot entry do this ....

$ efibootmgr -b 0003 -B

(This deletes the 3ʳᵈ entry)

Bill
Duran Duran, "You got to believe it will be alright in the end!"
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sat Feb 13, 2021 3:14 pm

obiwanbill wrote:I noticed this exact same issue ... “when you disconnect the SATA drive and reconnect it, the EFI BOOT entry is gone”.

Solution? Recreate the EFI BOOT entry.
So i found out, Bill. I just didn't expect it and paniced when I couldnt boot into the machine that has all the virtualbox machines. BOS boots didn't work like that. If you disconnected all dtives the "boot from hard drive" and "boot from CDROM" entries are still there. I have to explicitly remove PXE boot and "boot from floppy".
Top
Buffoon
Veteran
Veteran
User avatar
Posts: 1369
Joined: Wed Jun 17, 2015 2:22 pm
Location: EU or US

  • Quote

Post by Buffoon » Sat Feb 13, 2021 3:33 pm

Yes firmwares tend to remove all custom entries which point to files which are not present. OTOH, EFI/boot/bootx64.efi must be shown in boot menu if it exists. See the significance of this feature? If you put a valid EFI executable by this name in this location you do not need to use efibootmgr to set it up.
Life is a tragedy for those who feel and a comedy for those who think.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sat Feb 13, 2021 4:11 pm

Buffoon,
I disconnected the boot drive and temporarily connected a BIOS boot drive. There is no FAT partition and no bootx64.efi file. That was the problem.
The orognal drive did, but the BIOS did not pick it up when that drive was reinserted.

The solution was to reboot using UEFI media and recreate the boot entry. DuckDuckGo indicated that the solution was to re-install refind. That might work on CentOS or something, but on Gentoo, after installing refind you still need to run efibootmgr and add your boot selection.
Top
Buffoon
Veteran
Veteran
User avatar
Posts: 1369
Joined: Wed Jun 17, 2015 2:22 pm
Location: EU or US

  • Quote

Post by Buffoon » Sat Feb 13, 2021 5:18 pm

Me sad. You did not get the point.
Life is a tragedy for those who feel and a comedy for those who think.
Top
Post Reply

25 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic