How can I repair GRUB after deleting my Ubuntu 20.04 partition?

0
0
Asked By MellowCedar47 On

I had Ubuntu 20.04 and 24.04 installed on separate 1 TB drives, but I mainly used 24.04. After getting DaVinci Resolve working on 24.04, I deleted the 20.04 partition. The system continued working until I rebooted for an update, and I then realized the deleted installation had been providing the bootloader.

Now the laptop drops into a GRUB 2 terminal. I can manually select the correct drive and partition, but Ubuntu fails to start and leaves me at an initramfs prompt with an error such as "no init found." I would like to repair the bootloader without reinstalling Ubuntu because I have around 1.6 TB of data, including roughly 700 GB that is important.

I booted from a live USB and checked the remaining Ubuntu 24.04 drive with GParted. It contains a 1 GB FAT32 partition marked boot/esp and a roughly 950 GB ext4 partition, so the EFI partition is still present.

3 Answers

Answered By CopperLantern63 On

If the system can reach the installed files but ends at initramfs, there may be a second issue beyond the EFI boot entry, such as an incorrect root UUID in the boot configuration or an incomplete kernel update. First repair and regenerate GRUB from a live USB. If it still stops at initramfs afterward, check the installed filesystem and verify that the root partition’s UUID matches the entries in /etc/fstab and the generated GRUB configuration.

Answered By PixelHarbor8 On

This sounds like a bootloader repair rather than a reason to reinstall the operating system. Boot from an Ubuntu live USB in UEFI mode, confirm that the 1 GB FAT32 partition is the EFI System Partition, and mount the Ubuntu root and EFI partitions. Then chroot into the installed system and reinstall GRUB for the correct disk. After updating the GRUB configuration, reboot and choose the remaining drive in the firmware boot menu.

You can also use a graphical boot-repair utility from the live environment, but make sure it targets the Ubuntu 24.04 installation and its EFI partition. Your data should remain intact as long as you do not format the ext4 or EFI partitions.

Answered By QuietMaple22 On

The old installation probably owned the EFI boot entry, even though the Ubuntu 24.04 files were on the other drive. Check the firmware settings and see whether the machine is still trying to boot from the disk that contained Ubuntu 20.04. If the remaining drive has an EFI partition, set its Ubuntu entry or that drive itself as the first boot option.

Since you found a FAT32 partition marked boot and esp on the 24.04 drive, you likely do not need to create another EFI partition. Reinstalling GRUB to that existing partition should be enough.

MellowCedar47 -

I initially missed it, but GParted shows that the FAT32 partition on the 24.04 drive is marked boot and esp. So the EFI partition is still there; I’ll focus on selecting that drive and repairing GRUB rather than reinstalling Ubuntu.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.