Solving Boot Loop on Samsung NP500P4C

You switched to UEFI and was annoyed that you can no longer get to the BIOS setup, even through the Windows troubleshooting options (the thing that you get to after holding Shift while restarting) because the option to boot to change the BIOS UEFI settings is not there.

So what you did was to look for BIOS updates and alas, Samsung software pointed you to flash the BIOS with P07RAA.rom.

However, after setting the BIOS with the newly flashed rom to boot in UEFI mode, you lose access to the BIOS Setup again. The next time you want to flash, you can’t, because the flashing utility tells you that it cannot flash when the BIOS has a newer firmware.

So you find a workaround on how to flash the BIOS manually without using the official flashing utility by Samsung. This involves running the exe from Samsung, and while it’s displaying a confirmation dialog, sifting through C:\users\<user>\appdata\local\temp\__samsung_update for the rom file and winflash.exe utility.

However, this workaround only flashed the BIOS. Apparently there’s also a MICOM component that you could only flash using the official utility. So your strategy was to flash with an older firmware using the workaround (BIOS and MICOM mismatched as it will be), and then use the official flashing utility to flash a newer BIOS and MICOM firmware.

So you look for your original firmware installer, which is P05RAA. However, you were unable to extract the rom file from this official installer because it only runs on Windows 7 and you already upgraded to Windows 10 which is the reason why you were enticed to convert the partition table to GPT from MBR and ditch Legacy boot for UEFI in the first place. You try the dumb idea to run the installer on another Windows 7 computer but of course, it has a different BIOS and didn’t even run, so that’s just dumb.

For the time being you settled on manually flashing with the P06RAA rom because that runs on Windows 10, and then using the official flashing utility to flash the P07RAA again.

At this point, you solved the BIOS and MICOM version mismatch, but not your original problem which was lack of access to BIOS setup while in UEFI mode. Also, you unnecessarily updated the BIOS from the original P05RAA to P07RAA and can’t downgrade for the moment. You will need Windows 7 to run again on this laptop to do that, and you cannot install Windows 7 because you know that after switching to UEFI boot, booting to an installer comes after Windows Boot Manager in boot priority. You cannot change that because you cannot access the BIOS setup, and Windows troubleshooting options does not list booting to USB as an option either. Weirdly, it lists your ubuntu entry on the EFI partition as the sole other option to boot from, and Windows sees it as a USB HDD at that. Supposedly, you have the option here to boot to BIOS settings, and any other boot options provided by the BIOS, if the BIOS firmware is following standards, that is. But at this point, you learn that Samsung has a history of not giving a shit about this. Because, who on earth dual boots anyway?

You are lost and defeated.

You muck around with bcdedit on Windows and efibootmgr on Ubuntu. The latter was a bad idea. A VERY BAD idea it turns out.

When lost, stop what you are doing and sleep.

Using bcdedit on Windows, you can see the entries on the Boot Configuration Data. Using efibootmgr, you cannot. You are weirded out about this. So you tried to recreate the bcd using efibootmgr. You feel uncomfortable about what you did, so on next reboot, you pressed F4 to boot to Windows recovery. Your full intention was to do the sane thing which was to repair startup from Windows. Possibly issue a bootrec.exe /rebuildbcd or something. But it was 4 a.m. and you mistakenly proceeded to shutdown the laptop instead.

That was stupid. efibootmgr corrupted the NVRAM.

The next time you powered up the laptop was fun. It starts the fan and shows SAMSUNG logo welcoming you, telling you to press F2 to access setup or F4 for recovery, but neither of which does anything. It then halts, and reboots doing the same thing. A boot loop.

Screwed as you are, you get the screwdrivers out, literally.

The first thing to get unscrewed was the laptop hard disk. The idea was that the boot priority will cascade to USB when HDD is not present. It did not. That was unnerving.

The next thing that got unscrewed is everything that has screws on the laptop. Because theoretically, if you remove the CMOS battery for a while, NVRAM will be cleared and BIOS will be reset.

So you watch disassembly videos of laptops with similar chassis design. (There are none for the exact make and model of the one you have). After a while, you feel simultaneously hopeful, desperate, and confident enough to disassemble the thing yourself. After successfully disassembling the laptop without physically breaking anything (that you know of), you remove the CMOS battery and let it rest. Boot loop persisted.

Well, at least you were able to clean the fan and replace the thermal paste. You find solder notches labeled BIOS CRS and RTC RESET and gets excited. Shorting these did nothing. Boot loop persisted.

Out of ideas, you just randomly smash keys. When nothing makes sense, everything is possible. Ex falso quod libet.

Of course, there is a method to randomly smashing keys. You figure that smashing any of the function keys was priority. Also, you do this while having a USB installer that can boot to either UEFI and Legacy plugged in to a USB 2.0 port and not the USB 3.0 one.

After a day of smashing keys while hopelessly thinking about other options including reading success stories about hot flashing the BIOS and fighting a very strong temptation to dust off a soldering iron somewhere, a breakthrough: pressing F9 allows you to boot to USB. You hear angels sing while Ubuntu liveusb loads. Light descends upon mankind once again. This is happiness.

The goal now is to flash the BIOS with the original firmware, return the hard disk partition table to MBR, and forget about using UEFI in this laptop altogether.

The only thing that’s needed is to find a way to boot Windows 7 from USB. This is supposedly unsupported by Microsoft. But compared to actually disassembling the laptop, this is easy.

You make a fresh install of Windows 7 on an old desktop, and figure out how to use a tool called Win2USB to transfer this installation to an external hdd. Booting to Windows 7, you can at last flash P04RAA rom first using the workaround method, and then flash the original firmware P05RAA using the official firmware installer from Samsung.

You backup the HDD somewhere else, convert the partition table to MBR, copy the partitions back, use Windows installer startup repair to fix booting into Windows 10, and then use Ubuntu live usb to switch grub on the installed Linux system back to grub-pc from grub-efi. At this point, all these was trivial and a joy to be able to do to a laptop that was near death just moments, no, days ago.

Contents of /etc/apt/trusted.gpg.d/ shouldn’t reach 40 items

Yep.

So if you are fond of adding PPAs to your Ubuntu system (who isn’t?), sooner or later you will reach this limit and suddenly the next sudo apt-get update you do will throw multiple “…public key is unavailable: NO_PUBKEY …” errors, which will be cryptic as hell.

You will first blame your internet connection, and then be paranoid that perhaps your VPN host is mucking with your security, and then after trying multiple sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXXXXXXXXXXXX with processed:1 unchanged:1 results, you will realize that you need to ask Google, which will eventually tell you that there’s this bug.

And that, yeah, you have to go check  /etc/apt/trusted.gpg.d and remove duplicates and entries that aren’t in use anymore, because apparently, it happens that even after a ppa-purge the gpg keyring remains in there, filling up space, waiting for this resource limit to be reached, finally putting a rather innocent apt-get update into tantrums.

So, do a sudo apt-key list right now, and keep those gpg files at /etc/apt/trusted.gpg.d to less than 40 entries, perhaps while pondering about the life of Werner Koch, and the decisions that led him to institute such a resource limit.