LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 12-03-2018, 02:21 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Rep: Reputation: 15
Help needed restoring UEFI boot to Fedora 28 system


Hi, thanks for reading this.

I have a problem with a Fedora 28 system. I'm not sure what I did. It may have been a software update to the kernel that failed because /boot partition filled up, or it may have been a 'dnf clean all'. The problem is the system will no longer boot.

I get a message like "Reboot and Select proper Boot Device or Insert Boot Media in selected Boot Device and press a key". I suspect this is my BIOS talking, so I'm not even getting to grub2.

I can use a Fedora Live CD to get the computer running, and my disk looks like this ...

Code:
[root@localhost-live liveuser]# parted -ls
Model: ATA SanDisk SDSSDA24 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  53.5MB  52.4MB  fat16           EFI System Partition  boot, esp
 2      53.5MB  273MB   219MB   ext4
 3      273MB   16.3GB  16.0GB  linux-swap(v1)                        swap
 4      16.3GB  240GB   224GB   ext4
I am using standard partitions and not LVM so

/dev/sda1 is /boot/efi
/dev/sda2 is /boot
/dev/sda4 is /

My BIOS is a Gigabyte thing (BIOS version F2 dated 11/24/16, ID 8A0BAG08), and I can't seem to explicitly tell it to use UEFI, but if it sees a device with it, it adds it to the list of bootable devices, and flags it as UEFI.

This system was all working fine until 3 days ago.

I have followed the instructions at https://fedoraproject.org/wiki/GRUB_2 with no luck.

I do not need UEFI secure boot, just a plain simple boot into Linux.

Has anyone got any suggestions ?
 
Old 12-03-2018, 03:32 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,795
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Doesn't the F12 key at POST produce a boot selection menu where you can choose the ESP partition to boot from? My 2018 Gigabyte's BIOS F12 menu currently shows 5 selections, plus "enter setup". Once you can get booted, using rescue media if necessary, you should be able to fix the UEFI boot menu behavior with Fedora's efibootmgr command.
 
Old 12-03-2018, 04:10 AM   #3
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Yes it does show the drive and partition, but it is not flagged as UEFI, and if I select it nothing happens, I just get "Reboot and select a drive..." message.

I suspect the BIOS probes the drive and can't find the UEFI stuff because something on the drive is missing or has been clobbered.

*LATER* rebooted again with a Live CD and if I try efibootmgr it says

[liveuser@localhost-live ~]$ efibootmgr
EFI variables are not supported on this system.
[liveuser@localhost-live ~]$

Last edited by Mike Davies; 12-03-2018 at 04:18 AM.
 
Old 12-03-2018, 04:23 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Erk - that doesn't sound good.
How did you ceate the liveUSB ?. When you reboot, get into the firmware (BIOS if you like) and make sure there are 2 entries for the USB - select the EFI one, then see what efibootmgr says.

Also make sure /dev/sda{1,2} are mounted then run "df -hT" and post that as well.
 
Old 12-03-2018, 05:12 AM   #5
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Originally this was a Fedora 27 system, and I did an online upgrade to Fedora 28. That was months ago, say back in May/June this year.

When I got these boot problems, I downloaded Fedora-Xfce-Live-x86_64-28-1.1.iso and used dd to write it to a SDHC card. That produced an UEFI system with 3 partitions.

My firmware now shows in it's boot menu as order of boot attempts
Code:
P4:DRW-24D5MT
P1:SanDisk SDSSD2240G
UEFI:Mass Storage Device
UEFI:Mass Storage Device, Partition 1
Top line is my CD drive, next is what I'd like to boot - but it doesn't seem to be in UEFI mode, and the next two lines represents my SDHC card plugged into the USB

It is now booting one of the last two lines. Not sure which, probably the last.

efibootmgr still says...
Code:
[root@localhost-live liveuser]# efibootmgr -v
EFI variables are not supported on this system.
[root@localhost-live liveuser]#
Here's the other info asked for.
Code:
[root@localhost-live liveuser]# df -hT /dev/sda1
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda1      vfat   50M  1.1M   49M   3% /mnt/root/boot/efi
[root@localhost-live liveuser]# df -hT /dev/sda2
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda2      ext4  199M  184M  847K 100% /mnt/root/boot
Mike

Last edited by Mike Davies; 12-03-2018 at 05:14 AM.
 
Old 12-03-2018, 06:08 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I'd definitely increase that boot, but first can you run these.
Code:
mount | grep -i efi
ls /sys/firmware/efi/efivars
That first one should list the dir used in the second. If not that may be your problem, but the liveCD should always mount it on UEFI systems.
 
Old 12-03-2018, 06:16 AM   #7
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I ran those commands. Nothing there. It just reports a mount point.

Code:
[root@localhost-live liveuser]# mount | grep -i efi
/dev/sda1 on /mnt/root/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
[root@localhost-live liveuser]# 
[root@localhost-live liveuser]# ls /sys/firmware/efi/efivars
ls: cannot access '/sys/firmware/efi/efivars': No such file or directory
[root@localhost-live liveuser]# ls /sys/firmware/efi
ls: cannot access '/sys/firmware/efi': No such file or directory
[root@localhost-live liveuser]# ls /sys/firmware
acpi  dmi  memmap
[root@localhost-live liveuser]#
 
Old 12-03-2018, 07:49 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,343

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
for some reason or another it appears that you are booting in legacy mode. Check your bios and see if legacy mode can be disabled.
 
Old 12-03-2018, 08:03 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I thought I had a F28 UEFI system, but I had re-purposed it, so I went and pulled the F29 Live iso and copied it to a USB. That efivars needs to be there - the fact it isn't is a worry. I remembered something from a while back - not what I had in mind, but read this. Sit down first.

This may not be your situation - the use of efivarfs is supposed to avoid this sort of thing, but it is suspicious. A failed update shouldn't be able to delete the efivars - raise a bug against Fedora and see what the devs have to say.
 
Old 12-04-2018, 08:40 AM   #10
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
OK. I've managed to get a system running that has efivarfs.

Not entirely sure how. There were some entries in the BIOS menus that only appeared if "Windows" was selected under "Windows 8/10 Features" - I had it set to "Non-Windows", and there were some entries in the BIOS menus I overlooked because they has scrolled off the screen. Everywhere I saw it was possible to select UEFI I changed it to explicitly state UEFI. It is also possible that UEFI doesn't work on the USB bus which was where I was booting my SDHC card from - I have burnt a new FC28 CD, and I have a system with efivars - as you can see.

Code:
[liveuser@localhost-live ~]$ mount | grep -i efi
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
[liveuser@localhost-live ~]$ ls /sys/firmware/efi/efivars
 AdvMitAttrib-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 AmiEntryS3Addr-074e1e48-8132-47a1-8c2c-3f14ad9a66dc
 AMITSESetup-c811fa38-42c8-4579-a9bb-60e94eddfb34
 AuditMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
 Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c
 Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c
 Boot0004-8be4df61-93ca-11d2-aa0d-00e098032b8c
 Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c
 BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c
 BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
 BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c
 ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c
 ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
 ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
 ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
 CoolConCRC-46fe2754-75ed-40db-a395-032d70994457
 CoolConsole-46fe2754-75ed-40db-a395-032d70994457
 CpuSetupVolatileData-b08f97ff-e6e8-4193-a997-5e9e9b0adb32
 CpuSmm-90d93e09-4e91-4b3d-8c77-c82ff10e3c81
 dbDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c
 dbxDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c
 DefaultBootOrder-45cf35f6-0d6e-4d04-856a-0370a5b16f53
 DefaultLegacyDevOrder-3c4ead08-45ae-4315-8d15-a60eaa8caf69
 DeployedMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
 DeploymentModeNv-97e8965f-c761-4f48-b6e4-9ffa9cb2a2d6
 EasyHealthAddress-dd41adf5-4368-4654-b1ca-46a6b98d9e84
 EasyTuneSetupAddress-2a64d079-aceb-4ad9-afd5-252e35ba994a
 EasyVoltageAddress-dd41adf5-4368-4654-b1ca-46a6b98d9e84
 Ep-73dad563-8f27-42af-918f-8651eb0a93ef
 EPCBIOS-c60aa7f6-e8d6-4956-8ba1-fe26298f5e87
 ErrOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
 ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
 FlexIoData-98744b1b-d66d-41fd-8e89-80adbd668140
 FPDT_Volatile-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 HiiDB-1b838190-4625-4ead-abc9-cd5e6af18fe0
 IntUcode-eda41d22-7729-5b91-b3ee-ba619921cefa
 KEKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c
 LegacyDevOrder-a56074db-65fe-45f7-bd21-2d2bdd8e9652
 MaximumTableSize-4b3082a3-80c6-4d7e-9cd0-583917265df1
 MemMitAttrib-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 MemoryOverwriteRequestControl-e20939be-32d4-41be-a150-897f85d49829
 MemoryOverwriteRequestControlLock-bb983ccf-151d-40e1-a07b-4a17be168292
 MeSetupStorage-5432122d-d034-49d2-a6de-65a829eb4c74
 MeVS-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 MokListRT-605dab50-e046-4300-abb6-3dd810dd8b23
 MonotonicCounter-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 NetworkStackVar-d1405d16-7afc-4695-bb12-41459d3695a2
 NewOptionPolicy-69ecc1be-a981-446d-8eb6-af0e53d06ce8
 OA3MSDMvariable-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c
 PCI_COMMON-aca9f304-21e2-4852-9875-7ff4881d67a5
 PcieSataModVar-5e9a565f-cdc0-413b-ad13-1fe8713ffdcd
 PKDefault-8be4df61-93ca-11d2-aa0d-00e098032b8c
 PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c
 PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
'PREBOOT CLOCK DATA-35c6ccb8-e380-41ef-5ba7-92850d9a5a0a'
 ProcMitAttrib-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 Profile0-b05e6b5f-6ed8-4015-b5c5-b1049faf3e5b
 RstOptaneConfig-4da4f952-2516-4d06-8975-65036403a8c7
 SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
 SecureBootSetup-7b59104a-c00d-4158-87ff-f04d6396a915
 SensorPeciErrorCurrentCounter-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 SensorPeciErrorMaxCounter-01368881-c4ad-4b1d-b631-d57a8ec8db6b
 Setup-80e1202e-2697-4264-9cc9-80762c3e5863
 SetupCpuFeatures-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 SetUpdateCountVar-81c76078-bfde-4368-9790-570914c01a65
 Setup-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
 SetupXtuBufferAddress-e6a01b2b-a795-41f0-85a0-53acaab21d97
 SignatureSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
 SmbiosEntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1
 SmbiosScratchBuffer-4b3082a3-80c6-4d7e-9cd0-583917265df1
 SmbiosV3EntryPointTable-4b3082a3-80c6-4d7e-9cd0-583917265df1
 SOFTWAREGUARDSTATUS-9cb2e73f-7325-40f4-a484-659bb344c3cd
 StdDefaults-4599d26f-1a11-49b8-b91f-858745cff824
 TbtHRStatusVar-ba1d893b-803e-4b26-a3de-585703ff7bd6
 Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c
 UsbSupport-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
 VendorKeys-8be4df61-93ca-11d2-aa0d-00e098032b8c
 WriteOnceStatus-4b3082a3-80c6-4d7e-9cd0-583917265df1
[liveuser@localhost-live ~]$
Now what ? efibootmgr gives me ...

Code:
[liveuser@localhost-live ~]$ efibootmgr -v
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0001,0005,0004,0000
Boot0000  Fedora	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* Hard Drive	BBS(HD,,0x0)..GO..NO........o.S.a.n.D.i.s.k. .S.D.S.S.D.A.2.4.0.G....................A...........................>..Gd-.;.A..MQ..L.7.1.2.0.4.2.5.4.3.0.7.0. . . . . . . . ........BO..NO........o.W.D.C. .W.D.1.0.E.Z.E.X.-.0.8.W.N.4.A.0....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.6.C.0.Y.U.S.3.X.2.2........BO
Boot0004  CD/DVD Drive	BBS(CDROM,,0x0)..GO..NO........o.D.R.W.-.2.4.D.5.M.T....................A...........................>..Gd-.;.A..MQ..L.2.K.G.G.B.A.1.C.5.4. .5. . . . . . . . ........BO
Boot0005* UEFI: DRW-24D5MT	PciRoot(0x0)/Pci(0x17,0x0)/Sata(4,65535,0)/CDROM(1,0x72c2,0x48e0)..BO
[liveuser@localhost-live ~]$
This is still booting from a live CD rather than /dev/sda. If I try to booth from /dev/sda - that's Boot0001 above, it still says "Reboot and Select proper Boot Device or Insert Boot Media in selected Boot Device and press a key".

So where do I go from here ?
 
Old 12-04-2018, 03:40 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So you don't see the "Fedora" entry in the firmware boot list ?.

I would change that default order to put Fedora first and try that - if it breaks you can always reset it back from the liveCD.
Code:
sudo efibootmgr -o 0000,0001,0005,0004
 
Old 12-05-2018, 08:47 AM   #12
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
Thanks for the reply. I tried that, but it made no difference. I also tried making a new efi boot entry with
Code:
efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/fedora/grubx64.efi --label "Fedora Grub"
but that did not help. the BIOS was still not recognising the EFI partition as an EFI partition.

After some thought I reasoned that the EFI partition was corrupt in some way. I had already checked the files against a backup and nothing was missing, so I bit the bullet and used the Live CD to "Install to Hard Drive"

I reasoned that only /boot (/dev/sda2) and /boot/efi (/dev/sda1) were corrupt in some way, so I asked the installer to destroy and reformat those partitions. I told it to leave "/" (/dev/sda4) alone, and installed another drive and pointed / at that, the intention being to throw away this newly installed drive at "/" and use my old "/" on /dev/sda4

It worked. I can now boot in UEFI mode my system, and it starts up grub2 and I have a list of systems to boot.

My problem now is that the installer, when it re-formatted the partitions allocated them new UUID numbers, so nothing actually boots, in one way or another the boot process complains about missing disks. I think it's just a matter now of an edit or two.
 
Old 12-05-2018, 09:39 AM   #13
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Original Poster
Rep: Reputation: 15
OK. A final footnote to this thread.

I am now up and running again.

Anyone with a similar problem, then basically I used the "Install to Hard Drive" on a live CD to re-write my /boot and /boot/efi partitions. This also updated the efibootmgr with
Code:
Boot0000* Fedora	HD(1,GPT,2e0b5de1-8b5b-48cf-ba8c-c63b6af69717,0x800,0x19000)/File(\EFI\FEDORA\SHIMX64.EFI)
I then rolled into /boot and /boot/efi/EFI backups from a month ago when the system was working, replacing the old stuff from the Live CD with more up-to-date images.

I then manually editted the file /boot/efi/EFI/fedora/grub.cfg to have the new UUIDs that the "Install to Hard Drive" created when the partitions /dev/sda1 (/boot/efi/EFI) and /dev/sda2 (/boot) were reformatted.

Also had to edit /etc/fstab to reflect the new UUID numbers

Thanks to everyone who responded to my pleas for help. We got there in the end. :-)

Last edited by Mike Davies; 12-05-2018 at 01:47 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mobo only supports uefi boot - how do I boot off a non-uefi cd? Ulysses_ Linux - Hardware 3 02-25-2016 08:06 PM
Can't get dual boot, win 7 uefi and elementary freya os uefi working shywolf Linux - Newbie 4 12-10-2015 06:14 PM
Can't install LM 32bit with UEFI disabled on UEFI Asus X200MA laptop dblaisde Linux Mint 3 10-15-2015 05:37 AM
Help Creating UEFI A MENU For My Bootable (BIOS/UEFI) CDROM ssenuta Linux - Hardware 0 08-27-2012 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:28 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