1

I had a dual boot Ubuntu/Windows 8, and I wanted to remove Windows for good. I backed up both my Ubuntu and Windows data.

I decided to use OS-Uninstaller, so I booted a Ubuntu 18.04.1 live-USB and proceeded to the removal of "Windows (/dev/sda1)".

The OS-Uninstaller process ended with an error message saying

"An error occurred during uninstallation"

Before exiting this live session, I backed up the output of a dmesg command (I can post it if it helps).

Then I rebooted, expecting my installed Ubuntu to start. Instead, a black screen appeared with the message

"Invalid parition table!"

I just pressed shortly the switchoff button of my computer and it switched off. Then I rebooted a live session to use boot-repair. I didn't execute the "Recommended repair", I just produced the report (I can post it if needed).


EDIT: After some reading, I realize that the problem is that /dev/sda1 was my /boot/efi partition. It has apparently been formatted to ntfs, but the other partitions, especially the Ubuntu partitions, seem untouched. Is it possible to restore this /boot/efi partition? Should I try first the "Recommended repair" of boot-repair?


Could you please help me to have my Ubuntu boot as before? I know there is this post, but I am not sure what to do in my case and I am afraid to screw something up even more.

Giuseppe
  • 187

1 Answers1

2

My problem is solved: I recovered my system as it was before the problem.

For those having the same problem as I had (EFI partition formatted but all other partitions intact), you should first have an Ubuntu live-USB. Once you have it, here is exactly what to do (check out also the links at the end of this answer):

1. Read the following docs to know the necessary about EFI partitions:

https://en.wikipedia.org/wiki/EFI_System_partition

https://help.ubuntu.com/community/UEFI#Creating_an_UEFI_partition

2. Make sure the boot mode of your computer is UEFI: Access you BIOS settings (if on a Dell computer, press F2 before startup), and make sure the UEFI boot is enabled (and Legacy mode disabled).

3. Boot your Ubuntu live-USB, select "Try Ubuntu without installing" in the grub menu. Once on the desktop, verify that you effectively booted in UEFI mode by running the following command in the terminal:

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"

This should output Legacy boot on HDD. It is important to boot the live-USB in UEFI mode, because we use Boot-Repair in a following step. Boot-Repair can regenerate automatically the EFI files that were deleted from the EFI partition when it was formatted, as from my understanding, but the live-USB from which you use it should have booted in UEFI.

From this point it will be a good habit to take screenshots of your partitions and of the messages you get from the different utilities.

4. Format the EFI partition to fat32: Open GParted; make sure you identify the partition that used to be your EFI partition (normally mounted as /boot/efi; it was 500MB-large on my install); right click on the partition in the lower part of GParted's window and choose to format to fat32. Apply this change. Then, make sure this partition has the "boot" and "esp" flags (if not, you can set them with a right click on the partition, then apply the change).

5. Install and run Boot-Repair: First read the Boot-Repair doc. Then install Boot-Repair (using the commands indicated in this doc). Once Boot-Repair is opened, it is advised to do the "Recommended repair", though it didn't work in my case: it ended by a Please create a BIOS-Boot partition message, as if it did not recognize that the UEFI boot mode was on. Instead, I simply went to the "Advanced options" of Boot-Repair, then in the "GRUB location" tab, I found a box called "Separate /boot/efi partition: (select a partition)". I checked this box with verifying that the selected partition was the EFI one, and left all the other options as they were. Then I applied the repair. Accept to create a BootInfo report and to post it into a pastebin (note well the link to this pastebin, just in case).

After that, a reboot should show you a GRUB, from which to access your previous install.


Useful/Related posts


Note: In the OS-Uninstaller doc, there should be a warning with an invitation to verify that the partition found by OS-Uninstaller as the one to format is not shared with another installed OS. In my case, to uninstall Windows, OS-Uninstaller proposed automatically to delete the content of my EFI partition, while it was also used by my linux install. All of this happened because I trusted the ability of OS-Uninstaller to do what was needed.

Giuseppe
  • 187