Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EFI boot problem after crash: hang or "media not present"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Tue May 29, 2018 12:04 pm    Post subject: EFI boot problem after crash: hang or "media not presen Reply with quote

OK, this is a slightly cryptic one, bare with me.

The machine in this story is an HP ZBook 15 with two HDDs: primary is a Samsung EVO 850, secondary is an mSATA Samsung 32GB.

Out of curiosity the other week, I ran gpu-top from x11-apps/intel-gpu-tools-1.20. It ticked over for a few seconds, reporting data from the Intel GPU. Then the machine crashed.
Btw, I was silly enough to run the gpu top program as root without really thinking about it. (Maybe it requires root for that kind of low-level HD info, I'm not sure.)
This particular machine rarely ever crashes, so I can pretty safely attribute the crash to the running of the gpu-top program.
Power off, power back on... HP boot logo just sits there. Nothing happens. Nothing.
After trying not to freak out and determining that I can actually still access the BIOS, I take the HDD out and put it in another HP laptop: SAME PROBLEM.
Now I'm confused. Something has happened to the HDD?? I put it back in the original machine.
If I press F9 (Boot menu) and select the EFI boot partition or OS Boot Manager or whichever options are for rEFInd, I get an error from the HP BIOS/EFI firmware:

Code:
An error occurred with the boot selection
verify media is present and retry


If I select the option to manually choose an EFI program, then the firmware lets me choose any of the devices that have an EFI partition, and navigate the directories to find the bootx64.efi file or whatever I want.
But when I choose such a file, then I just get a black screen and... nothing happens.

Using SysRescueCD, I deleted the EFI partition, created it again and reinstalled rEFInd and Linux kernels. No change.
Then I tried creating the EFI partition on the secondary HDD (which I had previously never used). No good.

It does, however, successfully boot from the EFI partition on the external USB disc.

WHAT HAS HAPPENED???

How can a crash from a GPU top program cause an EFI boot problem???

I'm really puzzled by what is happening and would like to find a solution other than complete reformat of the disc, which I'm not even sure will solve it.
I'll be really grateful for any advice. Thanks in advance, cheers.
Back to top
View user's profile Send private message
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Tue May 29, 2018 2:08 pm    Post subject: Reply with quote

Hi,

I have seen something similiar with HP Compaq 8200. My system refused to boot from EFI with Seagate HDD and Samsung Pro SSD. UEFI did not recognize the EFI-Partition. The odd part: USB-pendrive and Samsung EVO worked without any problems.

I have the impression HP could have some issues with their EFI implementation. If you have access to newer firmware, you might have luck getting it to work again. It is possible that the crash has triggered a bug in the EFI-firmware.
You could check if you can change the efibootvar and reboot to check if those are permanent. My system, after a reboot, the efibootvars are reset.

For my part, Samsung Pro has more capacity than Samsung EVO I have, so I am using legacy BIOS booting and lilo. This works and I have no advantages with EFI at the moment.

BR
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue May 29, 2018 2:44 pm    Post subject: Reply with quote

Joseph K. ...

please post the output of 'efibootmgr -v' (when booted from a efi capable USB). My guess is that you're mounting efivarfs +w which would allow anything (with permissions) to write to NVRAM.

best ... khay
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Wed May 30, 2018 1:19 am    Post subject: Reply with quote

Hi khay,

khayyam wrote:
Joseph K. ...

please post the output of 'efibootmgr -v' (when booted from a efi capable USB). My guess is that you're mounting efivarfs +w which would allow anything (with permissions) to write to NVRAM.

best ... khay


I don't have access to the machine right now, but I'm pretty sure that yes, I had enabled write access by default to the efivarfs. Because, of course, it was convenient when I was first setting up the machine and was constantly updating it. But I'm guessing that I probably should have left it at read-only by default and enabled it for writing when necessary. Lesson learned.

But if the gpu top program accidentally corrupted the efivarfs... how does that explain why the HDD won't boot in another laptop? That's weird, right?

I'll post the output when I get home. Cheers.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed May 30, 2018 3:11 am    Post subject: Reply with quote

Joseph K. wrote:
But if the gpu top program accidentally corrupted the efivarfs... how does that explain why the HDD won't boot in another laptop? That's weird, right?

Joseph K. ... it would be, but then I'm not really sure what efivarfs does in terms of writing back to NVRAM, I assume it does, but I can't say when that happens, or what happens if it doesn't get the chance (ie, on a crash). That is what I was thinking of in terms of 'corruption', rather than gpu_top being involved.

As I understand it, NVRAM holds a record of lastboot, bootorder, etc, and I assume these are written at some point (probably when the firmware hands off to the efi executable) but when using efivarfs these are exposed/written on tmpfs, and at some point written to NVRAM. I've always considered this a poor design, because 1). I don't see the problem writing directly to NVRAM (and so the "problem" efivarfs is supposedly addressing), and 2). writing to an intermediate medium just seem prone to mismatch and/or corruption. Writing to NVRAM is risky enough without there being some 'pending' writes. I've never adopted efivarfs for this reason, and I'm still using efibootmgr-0.5.4 because it doesn't have efivarfs as a requirement.

As for your problem, lets see what 'efibootmgr -v' shows.

best ... khay
Back to top
View user's profile Send private message
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Wed May 30, 2018 6:06 am    Post subject: Reply with quote

Is your EFI-Partition sane? Maybe you should check it.

BR
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Wed May 30, 2018 6:25 am    Post subject: Reply with quote

joanandk wrote:
Is your EFI-Partition sane? Maybe you should check it.

BR


How exactly would you check it? Sane is a pretty vague term.
fdisk and parted don't report any errors. What else?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed May 30, 2018 9:35 am    Post subject: Reply with quote

joanandk wrote:
Is your EFI-Partition sane? Maybe you should check it.

Joseph K. wrote:
How exactly would you check it? Sane is a pretty vague term. fdisk and parted don't report any errors. What else?

Joseph K. ... the following should provide the required information:

Code:
# gdisk -l /dev/sda | grep '^. GPT\|EF00'
# lsblk -o +fstype /dev/sda1

You shoud see 'GPT: present', the code as 'EF00', and vfat for filesystem. There might also be an issue with size, some firmwares require >200M

HTH & best ... khay
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Wed May 30, 2018 11:53 am    Post subject: Reply with quote

khayyam wrote:

Code:
# gdisk -l /dev/sda | grep '^. GPT\|EF00'
# lsblk -o +fstype /dev/sda1

You shoud see 'GPT: present', the code as 'EF00', and vfat for filesystem. There might also be an issue with size, some firmwares require >200M

HTH & best ... khay


Code:
root@sysresccd /root % gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): D114EC86-B013-4CB3-83BB-53B6D331FFFB
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          255999   124.0 MiB   EF00 
   2          256000        78229503   37.2 GiB    8300  rootfs
   3        78229504       289173503   100.6 GiB   8300  home
   4       289173504       500117503   100.6 GiB   8300  stuff

Code:

root@sysresccd /root % lsblk -o +fstype /dev/sda1
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT FSTYPE
sda1   8:1    0  124M  0 part            vfat


Code:
root@sysresccd /root % efibootmgr -v             
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000
Boot0000* rEFInd Boot Manager   HD(1,GPT,48465c39-cd56-4413-b308-63a562ed425d,0x800,0x3e000)/File(\EFI\refind\refind_x64.efi)


I can't remember whether I added this rEFInd boot entry myself or rEFInd did it automatically; probably the latter. I do remember that immediately after the probelms started, this list of boot entries was empty.
Back to top
View user's profile Send private message
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Wed May 30, 2018 12:14 pm    Post subject: Reply with quote

Joseph K. wrote:
joanandk wrote:
Is your EFI-Partition sane? Maybe you should check it.

BR


How exactly would you check it? Sane is a pretty vague term.
fdisk and parted don't report any errors. What else?


Code:
fsck.vfat /dev/sda1
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Wed May 30, 2018 12:27 pm    Post subject: Reply with quote

Considering all the information provided there is something with this particular SSD, motherboard firmware cannot read it the way it wants. It really shouldn't make any difference with an EFI setup, but as a last resort you could try and set the MBR boot flag.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Wed May 30, 2018 11:52 pm    Post subject: Reply with quote

joanandk wrote:
Joseph K. wrote:
joanandk wrote:
Is your EFI-Partition sane? Maybe you should check it.

BR


How exactly would you check it? Sane is a pretty vague term.
fdisk and parted don't report any errors. What else?


Code:
fsck.vfat /dev/sda1


I'll run this command later just so that no-one can say I didn't, but the fact is I deleted and recreated the partition.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu May 31, 2018 12:10 am    Post subject: Reply with quote

Possibly your ESP is not formatted FAT32?
vfat does not necessarily = FAT32
gparted from sysresccd GUI can specify FAT32 partition format
or run
mkfs.fat -F 32 /dev/sda1 from CLI

OOPS edit to make that /dev/sda1

Thanks Khay!

(although the command should just fail to execute if mkfs works as designed, -I required to format entire disk as filesystem)
Quote:
mkfs.fat -F 32 /dev/sde
mkfs.fat 4.1 (2017-01-24)
attribute "partition" not found
mkfs.fat: Partitions or virtual mappings on device '/dev/sde', not making filesystem (use -I to override)

_________________
Defund the FCC.


Last edited by DONAHUE on Thu May 31, 2018 2:33 am; edited 1 time in total
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Thu May 31, 2018 12:11 am    Post subject: Reply with quote

Jaglover wrote:
Considering all the information provided there is something with this particular SSD, motherboard firmware cannot read it the way it wants. It really shouldn't make any difference with an EFI setup, but as a last resort you could try and set the MBR boot flag.


But remember, this is not an installation issue (apologies if that was not clear): this is not the first time I tried to set-up the EFI boot. It has been working fine for months until I ran the gpu top program.
So in theory, all this hardware and firmware work fine together. Just something subtle and weird changed.

The part that flummoxes me is the fact that when I take the primary drive out and put it into another HP laptop, my old EliteBook, in which it also used to work fine, the same problem arises.
That's the part that kind of breaks my brain but unavoidably suggests that the root cause of the problem is something on the drive. But something that doesn't appear in typical drive partitioning tools.

If I'm desperate, what are the options for a 'low-level' format of the drive? Does such a thing exist? I vaguely recall such a thing from HDD days but I'm not sure if it applies to SSD.

Btw: thank you to everyone that has replied to offer help, I really appreciate it.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu May 31, 2018 2:04 am    Post subject: Reply with quote

DONAHUE wrote:
mkfs.fat -F 32 /dev/sda from CLI

DONAHUE ... ooops, there goes the contents of /dev/sda :)

@Joseph K. ... nothing in the above output suggests a problem, and with the issue being replicated on another machine we should probably consider it hardware.

Joseph K. wrote:
If I'm desperate, what are the options for a 'low-level' format of the drive? Does such a thing exist? I vaguely recall such a thing from HDD days but I'm not sure if it applies to SSD.

You'd remove the gpt partition table, and recreate it.

Code:
# sgdisk --zap-all /dev/sda
# gdisk /dev/sda

Some disks have a "secure erase" feature ('hdparm --security-erase') but I'm not sure what effect this has on SSD.

HTH & best ... khay
Back to top
View user's profile Send private message
Joseph K.
Guru
Guru


Joined: 07 Jun 2006
Posts: 436
Location: Sydney, Australia

PostPosted: Wed Jun 27, 2018 11:42 pm    Post subject: Reply with quote

I still haven't fixed the problem, but I at least found a work-around to boot kernels from the internal SSDs.
Using the rEFInd USB ISO, and editing the refind config to point to the correct root location, I can now boot the system, hurrah!
After which point, everything functions as normal.

Curiously, in the past few days, HP issued a critical advisory for their business notebook range describing one symptom that is similar to mine (stops responding at the HP logo). My ZBook 15 (the 'G1') is not actually included in the list, so I'm not expecting it to be a solution, but it was a weird coincidence to see the advisory.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum