You are not logged in.

#1 2013-04-20 10:02:17

wakkadojo
Member
Registered: 2009-05-31
Posts: 50

Problem with UEFI and poweroff [SORTA SOLVED]

I suddenly had a very weird problem with starting up my computer. It seems that when I shut my computer down with poweroff or shutdown, my computer can't reboot. I need to boot off a live usb, reinstall grub, and then the system boots. Once booted, I can run reboot with no problems. But, if I ever run poweroff or shutdown, booting takes me to the BIOS, and I need to reinstall grub off the live usb...

The thing is, when I run "poweroff" and try to power up again, arch doesn't even show up as a UEFI option. It only reappears as a UEFI boot option after reinstalling the bootloader. Again, there is no problem with "reboot"ing. When I reboot, arch shows up as a UEFI option and everything runs normally.

What the heck is happening? Has anyone seen anything like this before?

I do not know where to begin diagnosing this, any help is appreciated. This problem did not onset right after a system upgrade or anything, rather, it onset suddenly and seemingly randomly, making it very hard to diagnose.

UPDATE

Bringing the system from full power down to the live usb does not identify my hard drive

root@archiso ~ # systemctl | grep ADATA
root@archiso ~ #

However, after running "reboot" and entering the liveusb again, the hard drive is found

root@archiso ~ # systemctl | grep ADATA
sys-devi...-sda-sda1.device loaded active plugged    ADATA_XM11_128GB
sys-devi...-sda-sda2.device loaded active plugged    ADATA_XM11_128GB
sys-devi...-sda-sda3.device loaded active plugged    ADATA_XM11_128GB
sys-devi...block-sda.device loaded active plugged    ADATA_XM11_128GB
root@archiso ~ #

Last edited by wakkadojo (2013-04-23 19:57:40)

Offline

#2 2013-04-20 17:44:51

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Problem with UEFI and poweroff [SORTA SOLVED]

It's odd that such a problem has just appeared randomly after working correctly. Aside from that detail (and perhaps in spite of it), I'd say that this sounds like a firmware bug. There are a couple of possible workarounds to this bug on other systems:

  • Use an EFI utiliity, such as the firmware's own user interface or the "bcfg" command in an EFI version 2 shell, to set the boot options and boot order.

  • Rename your default desired boot program to EFI/BOOT/bootx64.efi on the ESP. This is the fallback boot loader, and most EFIs will launch it if nothing else is available, so if you give your boot loader this name and then ensure that nothing else is in the boot list (as nothing else is for you, if you're booting straight into the firmware setup utility), then it should launch.

Another possibility that occurs to me is that you may have rejiggered your shutdown items such that something is calling efibootmgr with options to remove boot items or reset the boot order to be empty or to refer only to invalid boot items. This seems improbable, though, since efibootmgr isn't normally called in startup or shutdown scripts. Thus, such an accidental change would require adding a very specific command to a shutdown script, which is something that would take deliberate action. It might still have happened if you were editing such a script and accidentally pasted in an efibootmgr command, though. You could try grepping through your shutdown scripts for references to efibootmgr to rule this possibility out (or track down the problem, if this is what's happening).

Offline

#3 2013-04-22 17:26:39

wakkadojo
Member
Registered: 2009-05-31
Posts: 50

Re: Problem with UEFI and poweroff [SORTA SOLVED]

Thanks for the suggestions srs5694. I have tried them and they didn't help.

I also updated the BIOS for my computer, and this didn't solve the problem either.

Basically, if the computer is started up from cold, it doesn't see the ssd. If I reboot the computer, it sees the ssd. I've confirmed this is the case for both arch linux and windows (yes, I went so far as to install windows...)

It sounds like it might be a SSD firmware issue, however I don't have access to the SSD firmware. My computer is an ASUS UX31a, and the firmware for its specialized/proprietary hard drive is not public. What kind of non-mac manufacturer does this sort of thing? Stupid ASUS, I will never purchase one of your computers again!

/rant_over

Anyway are there any other ideas? I tried reformatting my SSD and everything, but is there some sort of lower level reset I can perform that isn't a firmware reset?

Offline

#4 2013-04-22 17:34:18

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Problem with UEFI and poweroff [SORTA SOLVED]

wakkadojo wrote:

Basically, if the computer is started up from cold, it doesn't see the ssd. If I reboot the computer, it sees the ssd. I've confirmed this is the case for both arch linux and windows (yes, I went so far as to install windows...)

If this is a desktop system, try moving the SSD's cable to another connector on the motherboard; it could be that the one you're using is failing, or is sluggish for some reason. Similarly, you could try replacing the cable.

Another thing to try is to check for firmware options related to delays; in the past, some firmwares had options to delay the startup process for the benefit of sluggish disks. I'm not sure how common such options are today (I've never needed them, and so haven't paid attention to them). It's conceivable that adding a delay to the startup process would enable your disk to settle and become detected.

If you've got more than one disk (an SSD and a spinning disk, for instance), you could try moving your EFI boot managers and boot loaders to an ESP on the other disk. Note that the speed hit for doing this, if they're on an SSD right now, will be trivial.

Offline

#5 2013-04-22 20:26:05

wakkadojo
Member
Registered: 2009-05-31
Posts: 50

Re: Problem with UEFI and poweroff [SORTA SOLVED]

srs5694, unfortunately my computer is a laptop with only one hard drive.

It seems that the Windows UEFI menu option is retained on full-shutdown, but all linux entries are not. I can go into the BIOS and manually add the path to the .efi file on the EFI partition and then linux boots. But, again, on shutdown this menu entry is forgotten. Weird how it remembers the Windows option and none of the Linux options.

Where can I set the start-up delays? I guess since I can't find it in my BIOS then it might not be available.

I'll check the connection inside my laptop when I am back home later this week and have the tools I need.

UPDATE

I noticed something quite funky from hdparm...

stella ~ # hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
	Model Number:       ADATA XM11 128GB                        
	Serial Number:      2200282607000704    
	Firmware Revision:  322ABBF0

...
...

Security: 
	Master password revision code = 1
		supported
	not	enabled
	not	locked
	not	frozen
	not	expired: security count
	not	supported: enhanced erase
	2min for SECURITY ERASE UNIT. 
Logical Unit WWN Device Identifier: 0000000000000000
	NAA		: 0
	IEEE OUI	: 000000
	Unique ID	: 000000000
Checksum: correct

Look at the end... weird!

Last edited by wakkadojo (2013-04-22 21:12:56)

Offline

#6 2013-04-22 21:29:46

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Problem with UEFI and poweroff [SORTA SOLVED]

Some EFIs are badly broken in such a way that they have the Windows boot loader entry (EFI/Microsoft/Boot/bootmgfw.efi) hard-coded so that it's retained even after a full firmware reset. Apparently this is a workaround for bugs or hardware faults that cause the firmware to "forget" their usual entries. One way to deal with such systems is to name your desired boot manager or boot loader EFI/Microsoft/Boot/bootmgfw.efi. Unfortunately, that's not as practical with direct booting of the Linux kernel as it is with most others, since you probably need to pass options to the kernel that you don't need to pass to other boot loaders and boot managers. If this is your situation, my best suggestion is to start using rEFInd or gummiboot, named as EFI/Microsoft/Boot/bootmgfw.efi or EFI/BOOT/bootx64.efi. Either of these boot managers can then hand off control to the kernel, including passing it whatever options you need to use.

Offline

#7 2013-04-23 19:07:44

wakkadojo
Member
Registered: 2009-05-31
Posts: 50

Re: Problem with UEFI and poweroff [SORTA SOLVED]

I had an idea and I was wondering what anyone thought.

I was reading that there have been similar sorts of issues on some other Sandforce ADATA SSD's, and it seems like secure wiping/full SSD reset helped. Could I make a full boot image (dd if=/dev/sda of=/path/to/image), do a secure wipe, then restore (dd if=/path/to/image of=/dev/sda), or will this just "undo" my secure wipe?

Offline

#8 2013-04-23 19:57:17

wakkadojo
Member
Registered: 2009-05-31
Posts: 50

Re: Problem with UEFI and poweroff [SORTA SOLVED]

I used the bcfg/EFI shell to write to the NVRAM, and the boot entries are retained.

There is still the funky issue of full-power-off then booting not identifying the hard drive. This slightly annoying issue isn't so bad because if I immediately reboot from the BIOS, the hard drive is found and my EFI boot options are there. Thanks!

Offline

Board footer

Powered by FluxBB