2

I have a laptop with a 250 GB SSD containing EFI copies of Windows 10 and Ubuntu 16.04, and a 1 TB HDD with a couple data partitions. I had been using this system with both Secure Boot and Fastboot enabled for a few weeks without issue.

Last night Ubuntu hung indefinitely during shutdown and so I hard powered the computer off by holding down the power button. When I attempted to start the computer after this, the UEFI menu could not see either the SSD or the two boot options it contained. It could still see the HDD (which contains no boot loaders, just data).

I was able to boot Ubuntu from a live USB and could not detect the SSD via Gparted or parted from within that Ubuntu system.

When I tried to reboot again this morning after the battery had run out last night, UEFI can again see the SSD and both the the Ubuntu and Windows boot options on it. However it won't boot either successfully.

Grub is able to load by default and it shows the boot options for both operating systems. When I try to boot Windows, I get the splash screen for a longer period of time than usual (maybe 30 or 60 seconds) and then it reverts back to the Grub interface to select an OS.

If I pick Ubuntu, it goes to an Ubuntu splash for a bit and then enters a terminal where it prints out:

/dev/sda4: clean, 580575/9322496 files, 5157737/37265152 blocks
[  OK  ] Started udev Kernel Device Manager.
         Starting Show Plymouth Boot Screen...
Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to try again to boot into default mode. 
Press Enter for maintenance

When I view the system logs with "journalctl -xb" I get a whole lot of text including the following error messages:

secureboot: Secure boot could not be determined (node 0)

and

Kernel is locked down from EFI secure boot: see man kernel_lockdown.7

and

tboot: non-0 tboot_addr but it is not of type E820_TYPE_RESERVED

When I run "man kernel_lockdown.7" I get an error saying that file doesn't exist.

Also, booting again into a live Ubuntu USB still does not let me see the SSD from either Gparted or parted, despite it now being visible from the UEFI boot options menu.

I've tried all of the above with SecureBoot and Fastboot both turned on and off in the UEFI menu.

I don't really understand how UEFI works but I think it seems like because I hard shut down the computer during the shutdown process, the SSD was has been left in a locked state in a way that makes it impossible to reload those two boot options? How would I go about fixing something like this?

Thanks!

EDIT:

I ran a chkdsk over night from within the installed Windows recovery environment cmd prompt (not from USB):

chkdsk D: /x /f /r

Which didn't locate any bad sectors or output any obvious error messages. It doesn't seem to have brought about any change in the behavior of Windows when I try to boot.

Also ran a fsck within an Ubuntu Live USB on the ext4 data partition for the Ubuntu installation, which didn't find any issues. That ext4 is on the HDD although the efi boot partition for both Windows and Ubuntu is on the SSD.

When I'm logged in to the Ubuntu Live USB I can see and navigate through the ext4 data partition for the original Ubuntu installation and open files and everything looks fine - and the same thing for the Windows data partition (located on the SSD) when I'm on a Windows recovery cmd line. I don't think there are any issues with file corruption there.One thing I was surprised by was that when loaded into that environment, the SSD was automatically mounted as D: and the HDD as C:, when the opposite was previously true in Windows - but both were mounted successfully and accessible for read access.

Not sure what to try next here beyond a clean re-install of the OSes. I also still can't seem to access the SSD from the Ubuntu live USB for some reason.

EDIT:

Here is a boot-info report created within a Ubuntu Live USB:

http://paste.ubuntu.com/p/73hdknqv6p/

EDIT:

Ubuntu cannot see the SSD as a filesystem I guess because it is currently not in AHCI mode - here's I think a pertinent output generated on a Ubuntu Live USB:

root@ubuntu:~# dmesg | grep -i 'ahci'
[    4.938935] ahci 0000:00:17.0: version 3.0
[    4.939107] ahci 0000:00:17.0: Found 1 remapped NVMe devices.
[    4.939107] ahci 0000:00:17.0: Switch your BIOS from RAID to AHCI mode to use them.
[    4.939344] ahci 0000:00:17.0: AHCI 0001.0301 32 slots 1 ports 6 Gbps 0x1 impl RAID mode
[    4.939346] ahci 0000:00:17.0: flags: 64bit ncq sntf pm clo only pio slum part deso sadm sds apst 
[    4.939946] scsi host1: ahci

There's an option in the UEFI menu to switch to AHCI, but selecting that option doesn't seem to do anything. After switching to AHCI there and logging in to the Live USB, Ubuntu still doesn't see the SSD and the above output is the same, and shutting down and booting back into the UEFI menu shows the option switched back to the RST version instead.

16
  • After a hard shutdown, you often have file corruption. With Windows NTFS partitions you need to run chkdsk from your Windows repair flash drive. You may be able to directly boot Windows from UEFI menu & f8 into its internal repair console. Similar with Ubuntu you need to run fsck on all ext4 partitions using Ubuntu live installer. You may be able to boot recovery mode & run fsck from there if partitions unmounted. askubuntu.com/questions/642504/…
    – oldfred
    Aug 29, 2019 at 21:26
  • When I try to boot into recovery mode from the existing ubuntu installation it hangs at the step "A start job is running for dev-disk-by" for 90 seconds before appearing to time out. Then it goes to the normal recovery mode screen but says "filesystem state: read-only" and won't respond to any keystrokes (eg up/down arrows to select between menu items) - had to sysrq-alt-REISUB out.
    – Conor
    Aug 29, 2019 at 22:21
  • Attempting to run fsck from a live Ubuntu USB doesn't work because like I mentioned the Live USB can't see the SSD.
    – Conor
    Aug 29, 2019 at 22:23
  • Does it make sense that the windows boot system would get corrupted by a hard reboot from Ubuntu? Is this something that just impacts the whole disk, as opposed to a single partition? I've just tried and I am able to get in to a Windows cmd line from the recovery mode for the existing Windows installation, and that cmd line can see the SSD in DiskPart, so I'm going to try running a chkdsk later when I'm home (currently out and can't commit to leaving the laptop running for hours undisturbed)
    – Conor
    Aug 29, 2019 at 22:33
  • Corruption may only occur on partitions or files that are in use. If in Ubuntu you have mounted a NTFS partition and that was part of the issue, then chkdsk may be required. Generally Windows & Ubuntu are separate and one should not change other.
    – oldfred
    Aug 30, 2019 at 3:42

1 Answer 1

0

Based on oldfred's advice and a lot of googling, this is what I ended up doing which seems to have corrected the problem:

1) Loaded UEFI settings and turned OFF secure boot and fast boot. Make sure to save UEFI setting changes before booting an operating system - at least on my firmware this isn't done by default, you actually need to click Save before booting out of the options menu into an OS

2) Booted Windows but used F8 to enter recovery options menu

3) Navigated through recovery menu to the cmd prompt

4) Set windows to boot in safe mode:

bcdedit /set {current} safeboot minimal

5) Restart and boot Windows again (in safe mode, given the above setting)

6) Open regedit and change the registry values and default values for the following keys to 0:

HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ iaStorV -> start
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ iaStorV\ StartOverride 
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ storahci -> start
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ storahci\ StartOverride 

7) Restart the computer again, and load the UEFI settings. Changed SATA options to AHCI mode, from Intel IDE RST

8) Boot Windows, which will again boot into safemode, but will this time install all the AHCI drivers (NOTE - trying to boot into Windows after switching to AHCI without having it in safe mode will cause a bluescreen)

9) Run the following command in a cmd prompt to remove default safe mode booting

bcdedit /deletevalue {current} safeboot

10) Restart and boot into Windows, which should now load properly in non-safe mode with AHCI

11) Restart and boot into Ubuntu, which should now load properly and detect the AHCI SSD

12) Turned Secure Boot and Fast Boot back on in the UEFI options and verified that both operating systems can still boot properly

I THINK that this is the full list of things I did which are important to reproducing the successful fix. I did a lot of other stuff before figuring this out though so it's possible I've missed something else relevant!

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .