Announcement

Collapse
No announcement yet.

Lost but Found

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [System] Lost but Found

    Last night my Desktop went into Sleep mode. Normal. But when I tried to Wake it (keyboard key press or Mouse click): nothing. This has happened several times previously, but no big deal, just use the Magic Key Sequence: alt+prtsc+REISUB and Bob's your uncle. Not this time. When the PC rebooted, I was presented with: grub> Not good! I rebooted and entered the UEFI/BIOS. There was only one NVMe SSD identified; there are two in my PC. Not good! Rebooted from a Kubuntu 26.04 LiveUSB and launched KDE Partition Manager. It also showed only one of the two NVMe SSDs, and the one it was showing was the one I have configured as a DATA drive. Not good!

    I was thinking the SSD had died suddenly. But it's only two-years old. That, and how was I getting a grub> prompt if the OS drive was dead? Sooooo, as I'm pretty darn good at asking meaningful questions, I began an inquiry with Google AI. That's what is presented below. My SSD is seen again. Grub issue fixed. Desktop PC is working as expected again.

    A lot of people are demonizing developing AI. But I see it for what it is: a tool. And like any tool, it can be used for its intended purpose, or for bad. Which, is entirely up to the user at the keyboard.

    Google AI Transcript - Why grub> and how to fix (Quotes are my input)

    Two drives. Both NVMe SSD. Desktop. Both SSD showed up in BIOS/UEFI before. Last night, the system entered Sleep and wouldn't Wake. This has happened a few times previously, but using alt+prtsc+REISUB to safely reboot would reboot the PC. Last night, alt+prtsc+REISUB rebooted, but I ended at the grub> prompt. Rebooted and entered the BIOS/UEFI. The 2nd NVMe SSD was not identified, just the one configured as a DATA drive.
    Those extra details make the picture very clear: Ubuntu installed its GRUB bootloader onto the EFI System Partition (ESP) of your DATA NVMe drive, while your OS NVMe drive's controller crashed during the Sleep/Wake failure and hasn't reinitialized.

    Why You Still See grub>

    When you install Ubuntu on a machine with two drives, the Ubuntu installer frequently places grubx64.efi on whichever drive already has an EFI partition (often your secondary drive, especially if Windows or an older OS was ever on it).

    • UEFI boots the DATA drive. Your motherboard sees the DATA NVMe drive, reads its EFI partition, and launches GRUB.
    • GRUB looks for the OS drive. GRUB then tries to find /boot/grub/grub.cfg on the Ubuntu NVMe drive using its UUID.
    • The OS drive is offline. Because that second NVMe drive dropped off the PCIe bus, GRUB can't find its configuration file and drops straight to the grub> rescue shell.

    Why Sleep/Wake Knocked the NVMe Drive Offline

    NVMe SSDs enter low-power sleep states (APST — Autonomous Power State Transitions) when a Linux PC suspends. When a drive fails to wake from sleep—and you have to force a reboot via REISUB—the SSD's controller can get stuck in a hung state, or the motherboard's PCIe slot doesn't properly reset power during a warm reboot. Even a regular reboot sometimes leaves an NVMe controller unpowered or locked until a full cold power cycle occurs.

    Recommended Next Steps (In Order)

    1. Do a complete cold power drain. Shut the PC down completely, flip the switch on the back of the power supply (or unplug the power cable), hold the front power button for 10–15 seconds to drain residual capacitors, wait 2–3 minutes, then plug it back in and check BIOS/UEFI. Many hung NVMe controllers recover immediately once 3.3V standby power is completely cut.

    2. Reseat the OS NVMe drive. If a cold power cycle doesn't bring it back in BIOS/UEFI, power down, remove the M.2 screw, pull the drive out of the slot, and reinsert it firmly. You can also test it in the other M.2 slot to rule out a dead motherboard slot vs. a dead SSD controller.

    3. Check ls at the grub> prompt. Before opening the case, you can type ls at the grub> prompt and press Enter. You will likely only see (hd0) and (hd0,gpt1) (your DATA drive), confirming that the firmware isn't exposing the second NVMe drive at all.

    4. Prevent future Sleep/Wake NVMe dropouts. Once the drive is back and Ubuntu boots, check if your SSD has a firmware update available (many NVMe drives—especially Samsung, WD, Crucial, and Kingston—had early firmware bugs with Linux APST sleep states). You can also disable deep NVMe power-saving states in /etc/default/grub by adding nvme_core.default_ps_max_latency_us=0 to GRUB_CMDLINE_LINUX_DEFAULT and running sudo update-grub.


    Did a full power-supply unplug/drain bring the NVMe drive back in BIOS/UEFI, or is it still missing? If you'd like, share the SSD brand/model and motherboard model so I can give exact firmware or BIOS steps.

    Did Recommended Next Steps 1. Still booting to grub> but now ls shows: (hd0) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt2) (hd1,gpt1)
    That's a huge win—the cold power drain revived the second NVMe drive (hd1), and GRUB now sees both drives and their partitions.
    The reason it still stopped at grub> is likely just a minor boot-order or filesystem hiccup after the crash. You can boot directly into Ubuntu right from that grub> prompt and repair the boot configuration once you're in.

    Step 1: Identify Your Ubuntu Partition

    At the grub> prompt, inspect the partitions to find which one holds your Linux root filesystem (/):

    ls (hd0,gpt2)/
    ls (hd1,gpt2)/

    Use code with caution.

    (Note: include the trailing / so GRUB lists the folders inside).

    • One of those will list familiar Linux folders like boot/, etc/, home/, usr/, and var/.
    • Usually, (hd1,gpt2) will be your Ubuntu partition (while gpt1 is the small EFI partition). Make a note of which (hdX,gptY) has your Linux folders.

    Step 2: Boot Into Ubuntu Manually

    Assuming your Ubuntu installation is on (hd1,gpt2) (replace hd1,gpt2 with hd0,gpt2 if that's where your folders showed up), enter these four commands one by one:

    set root=(hd1,gpt2)
    linux /boot/vmlinuz root=/dev/nvme1n1p2
    initrd /boot/initrd.img
    boot

    Use code with caution.

    • If nvme1n1p2 drops you to an (initramfs) shell: Reboot back to grub> and try root=/dev/nvme0n1p2 instead—Linux sometimes assigns nvme0 and nvme1 in the opposite order of GRUB's hd0 and hd1.
    • If /boot/vmlinuz says "file not found": Type ls /boot/ after setting root to see the exact filenames (e.g., vmlinuz-6.8.0-xx-generic and initrd.img-6.8.0-xx-generic) and use those full names.

    Step 3: Permanently Fix GRUB Once Logged In

    Once Ubuntu boots to your desktop, open a terminal (Ctrl+Alt+T) and run these commands so you don't land at grub> again:

    1. Reinstall and update GRUB:

    sudo grub-install
    sudo update-grub

    Use code with caution.

    2. Prevent future NVMe Sleep/Wake dropouts:
    Open the GRUB config file:

    sudo nano /etc/default/grub

    Use code with caution.

    Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add nvme_core.default_ps_max_latency_us=0 inside the quotes so it looks like this:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme_core.default_ps_max_latency_us=0"

    Use code with caution.

    Save (Ctrl+O, Enter) and exit (Ctrl+X), then apply it:

    sudo update-grub

    Use code with caution.

    Let me know which partition (hd0,gpt2 or hd1,gpt2) shows your Linux folders or if you hit any error messages during those commands so we can adjust the boot parameters.

    ls (hd1,gpt2)/ returns @/ @home/
    That confirms (hd1,gpt2) is your Ubuntu root partition, and it uses a Btrfs filesystem with @ (root) and @home (home) subvolumes—which is standard on newer Ubuntu setups.
    Because of the @ subvolume, your boot files are located under /@/boot/ rather than /boot/, and the kernel needs rootflags=subvol=@ to mount properly.

    Step 1: Boot Into Ubuntu From grub>

    Enter these four commands one by one at the grub> prompt:

    set root=(hd1,gpt2)
    linux /@/boot/vmlinuz root=/dev/nvme1n1p2 rootflags=subvol=@
    initrd /@/boot/initrd.img
    boot

    Use code with caution.

    • If it drops to (initramfs): Reboot back to grub> and change nvme1n1p2 to nvme0n1p2 (Linux sometimes numbers NVMe drives in the opposite order of GRUB).
    • If /@/boot/vmlinuz isn't found: Run ls (hd1,gpt2)/@/boot/ to view the exact vmlinuz-... and initrd.img-... filenames and type those full names instead.

    Step 2: Repair GRUB & Prevent Future NVMe Sleep Crashes

    Once you are back on your Ubuntu desktop, open a terminal (Ctrl+Alt+T) and run these commands:

    1. Reinstall and regenerate GRUB's config:

    sudo grub-install
    sudo update-grub

    Use code with caution.

    2. Prevent NVMe Sleep/Wake dropouts:

    Open the GRUB configuration file:

    sudo nano /etc/default/grub

    Use code with caution.

    Add nvme_core.default_ps_max_latency_us=0 inside the quotes of GRUB_CMDLINE_LINUX_DEFAULT:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme_core.default_ps_max_latency_us=0"

    Use code with caution.

    Save (Ctrl+O, Enter), exit (Ctrl+X), and apply the change:

    sudo update-grub

    Use code with caution.

    Let me know if those commands get you back to your Ubuntu desktop, or share any error message if it stops along the way.

    PC is booting into Kubuntu 26.04 again! Thank you.
    Awesome news—glad your Kubuntu 26.04 system is back up and booting normally!​
    Last edited by Snowhog; Today, 03:03 PM.
    Slava Ukraini! 🇺🇦
    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes​

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X