Ubuntu Version:

24.04

Problem Description:

I had a working, existing, dual boot on an HP laptop with Windows 11 and Ubuntu 22.04 LTS. Using a Ubuntu Live USB (made with Rufus), I attempted to update Ubuntu to 24.04, making sure to select only the ext4 and swap partitions. The install went well. The Windows (NTFS) partition is still in place.

However, when I boot, I get an operating system not found error. Grub is gone as well.

I tried commands in Terminal with the Live USB, and I also tried to restore the boot record using a Windows Live USB. No luck. Finally, I utilized the Boot-Repair utility and it failed as well.

This is the link to the Pastebin Boot-Repair results:
https://paste.ubuntu.com/p/Qnk2hnFpzW/

Please let me know if any other details would be helpful. I can run commands from both the Ubuntu and Windows Live USBs.

Thanks for any help getting a boot menu back!

– Charlie

So you did everything right: pointed the 24.04 installer only at your ext4 + swap, kept Windows untouched, and the copy process finished without a hiccup—yet now the firmware greets you with the dreaded No operating system found. What happened? In almost every HP-laptop case I’ve seen, the core issue is the EFI System Partition (ESP) flag, not the install itself.


Why the boot vanished

1.24.04 rewrote GRUB onto the ext4 root but never told the firmware where to find it.
2. Your disk still has a 300-ish MB FAT partition (you can see it in the Boot-Repair log at nvme0n1p1), but its GPT type is Linux filesystem, not EFI System. UEFI firmware simply ignores it.
3. Because Windows Fast Startup was active, Boot-Repair couldn’t safely mount the NTFS volume either, so the automatic fix aborted.


The five-minute remedy

Goal: Flip the right GPT flag, reinstall grub-efi, and let UEFI see ubuntu again.

Boot the Ubuntu live USB Try Ubuntu.
Identify the ESP candidate

sudo lsblk -f        # look for the small vfat partition (likely /dev/nvme0n1p1)

Turn that partition into a real ESP

sudo umount /dev/nvme0n1p1 || true
sudo parted /dev/nvme0n1 set 1 esp on
sudo parted /dev/nvme0n1 set 1 boot on
sudo mkfs.fat -F32 /dev/nvme0n1p1   

Mount and chroot

sudo mount /dev/nvme0n1p4 /mnt               # your Ubuntu root
sudo mount /dev/nvme0n1p1 /mnt/boot/efi      # new ESP mount-point
for i in /dev /proc /sys /run; do sudo mount --bind $i /mnt$i; done
sudo chroot /mnt

Install GRUB for UEFI

apt remove --purge grub-pc                 
apt install grub-efi-amd64 shim-signed
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
update-grub
exit

Reboot and tap F9/F12(HP boot menu) - choose the new ubuntu entry.Once inside Ubuntu, run efibootmgr -v; if ubuntu is first in BootOrder, you’re golden.


Final clean-up

Disable Windows Fast Startup and run powercfg /h off in an admin cmd. That prevents NTFS hibernation from tripping GRUB in future.
Optionally re-enable Secure Boot; shim-signed makes Ubuntu happy in SB mode.

1 Like

Did you backup your Ubuntu and Windows personal data before installing Ubuntu 24.04?

Hi, thingizkhan!

I cannot believe how quick and complete your help was posted!

So far, I have a system that boots directly into Ubuntu – no grub menu for dual boot (no Windows choice) but the Windows partition is mounted for viewing in Ubuntu.

Ubuntu 24.04 looks pretty awesome!

This is the output of efitbootmgr -v (there seems to be leftover entries for my various Live USB drives) but Ubuntu is first (no entry for Windows). I am also guessing that I have to do something about the Timeout: 0 seconds.

BootCurrent: 0005
Timeout: 0 seconds
BootOrder: 0005,0002,0003,0004
Boot0000* PNY USB 3.2.2 FD 071C4A414F519626 PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(2,0)4eac0881119f594d850ee21a522c59b21000000049535048
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1c / 01 01 06 00 00 00 / 01 01 06 00 00 02 / 01 01 06 00 00 00 / 03 05 06 00 02 00 / 7f ff 04 00
data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 10 00 00 00 49 53 50 48
Boot0002 USB: PciRoot(0x0)/Pci(0x14,0x0)4eac0881119f594d850ee21a522c59b20b80000049535048
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 14 / 7f ff 04 00
data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 0b 80 00 00 49 53 50 48
Boot0003 Network Boot:IPV4 PciRoot(0x0)/Pci(0x0,0x0)/IPv4(0.0.0.00.0.0.0,0,0)4eac0881119f594d850ee21a522c59b21b90000049535048
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 00 / 03 0c 1b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 1b 90 00 00 49 53 50 48
Boot0004 Network Boot:IPV6 PciRoot(0x0)/Pci(0x0,0x0)/IPv6([::]:<->[::]:,0,0)4eac0881119f594d850ee21a522c59b21b98000049535048
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 00 / 03 0d 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 / 7f ff 04 00
data: 4e ac 08 81 11 9f 59 4d 85 0e e2 1a 52 2c 59 b2 1b 98 00 00 49 53 50 48
Boot0005* Ubuntu HD(1,GPT,f81e5c9c-d5b5-4ed1-8a37-5e30948dd73c,0x1000,0xb3800)/File(\EFI\ubuntu\shimx64.efi) File(.)
dp: 04 01 2a 00 01 00 00 00 00 10 00 00 00 00 00 00 00 38 0b 00 00 00 00 00 9c 5c 1e f8 b5 d5 d1 4e 8a 37 5e 30 94 8d d7 3c 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
data: 04 00 00 00 49 53 50 48
Boot0009* PNY USB 3.2.2 FD 071C4A414F519626 BBS(HD,PNY USB 3.2.2 FD 071C4A414F519626,0x900)/PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(255,255)13001000000049535048
dp: 05 01 2a 00 02 00 00 09 50 4e 59 20 55 53 42 20 33 2e 32 2e 32 20 46 44 20 30 37 31 43 34 41 34 31 34 46 35 31 39 36 32 36 00 / 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1c / 01 01 06 00 00 00 / 01 01 06 00 00 02 / 01 01 06 00 00 00 / 03 05 06 00 ff ff / 7f ff 04 00
data: 13 00 10 00 00 00 49 53 50 48
Boot000A* Kingston DataTraveler 3.0 E0D55EA57409E4A179C7664B BBS(HD,Kingston DataTraveler 3.0 E0D55EA57409E4A179C7664B,0x900)/PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(255,255)13001000000049535048
dp: 05 01 3b 00 02 00 00 09 4b 69 6e 67 73 74 6f 6e 20 44 61 74 61 54 72 61 76 65 6c 65 72 20 33 2e 30 20 45 30 44 35 35 45 41 35 37 34 30 39 45 34 41 31 37 39 43 37 36 36 34 42 00 / 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1c / 01 01 06 00 00 00 / 01 01 06 00 00 02 / 01 01 06 00 00 00 / 03 05 06 00 ff ff / 7f ff 04 00
data: 13 00 10 00 00 00 49 53 50 48

Any suggestion for next steps?

Also, when I entered one of suggested commands (sudo mount /dev/nvme0n1p1 /mnt/boot/efi), there was no efi directory. So, I created it (so the mount command would work) and continued with your recommendations without a problem. Since /boot/efi is now empty, may I delete it (grub is in /boot/grub)?

Thanks for you help,
Charlie

1 Like

I saved what I needed from the prior Ubuntu /home partition. So, I am good there.

I did not need personal data from the Windows partition but I need to recover the Windows installation since I do not have a practical way to reinstall Windows or install any software add-ons in Windows.

Thanks for asking!

– Charlie

Okay, I changed the grub timeout entry to read GRUB_TIMEOUT=10 and did a sudo update-grub. This is the output (I probably need to do something with os-prober but I am out of my element):

sudo update-grub
Sourcing file `/etc/default/grub’
Generating grub configuration file …
Found linux image: /boot/vmlinuz-6.11.0-26-generic
Found initrd image: /boot/initrd.img-6.11.0-26-generic
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings …
done

Thanks again for any help!

Hey Charlie,
You’re welcome. I’m so glad I could help you.

Put Windows back on the menu

Ubuntu 24.04 ships with os-prober disabled by default, so GRUB never looks for other OSes unless you re-enable it.

# inside Ubuntu
sudo apt install --yes os-prober
sudo sed -i 's/^#\?GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=false/' /etc/default/grub
sudo update-grub

You should see a line such as
Found Windows Boot Manager on /dev/nvme0n1p3 …
during the scan.


Give yourself time to choose

While you’ve got /etc/default/grub open, set a visible menu and a friendly delay:

GRUB_TIMEOUT_STYLE=menu   # always show the list
GRUB_TIMEOUT=5            # 5-second countdown

Save - sudo update-grub again - reboot and enjoy the menu.


Clean the UEFI boot list (optional, nice to do)

Each Boot00xx entry lives in NVRAM. You can drop the leftover USB sticks like this:

# example for the PNY entry (0000) – repeat for any you don’t need
sudo efibootmgr -b 0000 -B

Then reorder so Ubuntu comes first, Windows second:

sudo efibootmgr -o 0005,0006     # adjust numbers to match your actual Ubuntu/Windows IDs

Run efibootmgr -v once more to confirm.


About that /boot/efi directory

Keep it. In UEFI mode /boot/efi is the mount-point for the ESP where shimx64.efi and grubx64.efi live. If you created it manually, just be sure it mounts automatically:

grep /boot/efi /etc/fstab || \
echo 'UUID=07E5-97FA  /boot/efi  vfat  defaults  0  1' | sudo tee -a /etc/fstab

(Replace the UUID with whatever lsblk -f shows for nvme0n1p1.)


I hope I could help you. If you need help, please do not hesitate to write again. I would be happy to help you, If I can :smiley:.

TAKE CARE!

Hello, again,

I cleaned up the boot list and I fixed the entries in /etc/default/grub.

Unfortunately, os-prober is not finding Windows during the scan. And just running sudo os-prober results in the same blank return. sudo lsblk -f does show ntfs Windows on nvme0n1p3 .

Is there something else I can do so that os-prober will see Windows?

Thanks,
Charlie

os-prober does two checks before it adds Windows to the GRUB menu:

1- The NTFS volume must be clean (no hibernation / Fast-Startup). If the volume is marked hibernated or dirty it skips it.
2- The EFI System Partition must contain EFI/Microsoft/Boot/bootmgfw.efi. That file is what the firmware and os-prober look for.

When we reformatted the old FAT partition to become a fresh ESP we also wiped the Microsoft folder that used to live there, so criterion 2 now fails. You’re seeing criterion 1 pass but criterion 2 fail, therefore no Windows entry.


Make sure the NTFS volume is truly clean

# try to clear the dirty bit & hiberfile from Linux
sudo ntfsfix /dev/nvme0n1p3
# or, if you want to see what would happen first
# sudo ntfsfix -n /dev/nvme0n1p3

ntfsfix can remove the hibernation flag; if it complains that the drive is still hibernated you’ll also have to disable Fast Startup after Windows boots the first time.


rebuild Windows’ EFI files

You need a Windows 11 installation or recovery USB for this part.

Boot the Windows USB - Repair your computer - Troubleshoot - Command Prompt
In the console:

diskpart
list vol                     # note the letter of the ESP (it’s the 360 MB FAT32 one)
list vol                     # note the letter of the Windows partition (usually C:)
select vol <ESP-number>
assign letter=V:             # give the ESP a temporary letter
exit
bcdboot C:\Windows /s V: /f UEFI

What that does: bcdboot copies the Boot Manager files into V:\EFI\Microsoft\Boot\ and writes a fresh Windows Boot Manager entry in NVRAM.
3. Reboot - choose Ubuntu - run:

sudo update-grub

You should now see the magical lineFound Windows Boot Manager on /dev/nvme0n1p3 …
Reboot once more and the GRUB menu will list both Windows and Ubuntu.


After Windows finally boots, disable Fast Startup permanently:Control Panel - Power Options - Choose what the power buttons do - un-tick Fast Startup then run an admin CMD: powercfg /h off.
Keep /boot/efi exactly as is – it now contains both EFI/ubuntu and the newly rebuilt EFI/Microsoft tree.
efibootmgr -v will show a fresh Windows Boot Manager entry (usually Boot0006). If you like, reorder so Ubuntu (0005) then Windows (0006) are first:

sudo efibootmgr -o 0005,0006

That’s it!

After these two steps os-prober will always find Windows, and your dual-boot menu will stick around through future kernel updates. Let me know how it goes.

3 Likes

To thingizkhan:

Life is good! All is well. Thank you for all of your help.

Everything is back where it should be and now with 24.04.2 LTS.

I did hit a personal confusion. I wanted the efibootmgr order to be as you said but I wanted grub to default to Windows (because Windows sometimes gets mad mid-updates when rebooting to another OS). I forgot that what I needed was to set GRUB_DEFAULT in grub to the Windows index (in my case, 4). So, now I have Ubuntu first with grub’s default as Windows Boot Manager – and I have 5 seconds to make the right choice. :slight_smile:

– Charlie

1 Like

For completeness … keep rEFInd up your sleeve to get you out of a hole until parallel loader is restored. They are independent. I use it as my default.

Thanks, dragonfly41!

I am glad that you can solve it. Take care.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.