2

I deleted /dev/sda1 partition of Ubuntu 20.04 by mistake, now when I try to boot, system is not able to detect the OS, is there any way to fix this ? This the image of disks using live usb the partition which I delted another partition which contains all the files

I have tried various approaches mentioned in various articles including using boot repair, but nothing fixed it.

  • Have you tried creating a FAT32 partition where sda1 was and rerunning boot repair? – PonJar Jul 09 '20 at 09:39
  • yes, I created the fat32 partition while running boot repair, but that didn't work. – Mohit Malik Jul 09 '20 at 09:40
  • I think this link should provide the answer. https://askubuntu.com/questions/1028375/deleted-ubuntu-efi The answer below will leave you with two installations which I wouldn’t recommend – PonJar Jul 09 '20 at 09:49
  • @PonJar I tried this but in the step of installing grub grub-install /dev/sda I am getting error grub-install: error: /boot/efi doesn't look like an EFI partition Any idea how to fix this ? – Mohit Malik Jul 09 '20 at 10:32
  • I think an EFI partition needs to be marked as ESP. You should be able to do that with GParted. My EFI partition is flagged “boot, esp” – PonJar Jul 09 '20 at 10:43
  • I did mount /dev/sda1 /boot/efi again after the error and tried again installing grub and it worked. I am now able to boot. Thanks a lot for the help :-) – Mohit Malik Jul 09 '20 at 10:50

1 Answers1

1

Thanks @PonJar for the link. Using askubuntu.com/questions/1028375/deleted-ubuntu-efi I was able to fix it. If you face this error grub-install: error: /boot/efi doesn't look like an EFI partition during grub installation step, just do mount /dev/sdaxy /boot/efi again. This will fix it.