3

I had dual OS running on my system (the default was Windows 10, then I installed Ubuntu alongside Windows). With the intention of deleting Windows and keeping only Ubuntu, I logged in to my Ubuntu (chose Ubuntu from GRUB), used Gparted, and deleted ALL the partitions, except the following:-

  • Partition containing linux installation
  • Partition for linux swap space
  • Other NTFS Partitions - containing my data.

So, basically I deleted the Windows C partition, system reserved partition, and EFI partition.
This caused my Ubuntu to not load.

As instructed in this answer, I used a bootable USB drive (Porteus Linux) and booted from it (in TRIAL mode).
Using Gparted, I created a new partition named "EFI System partition" setting its flag to boot, esp.

My partitions now look like this:- enter image description here Then I installed GRUB using this guide.

Notice that the name of my efi partition is not /boot/efi intead it is /dev/sda1.

Somehow, the GRUB menu has returned, as I see it when I boot my PC.
But, when I try to choose Linux from there, I get the following error:-

enter image description here

Even now, I can't seem to boot my Ubuntu.

What can I do to resolve the issue?

1 Answers1

2

Welcome to Unix & Linux StackExchange!

/dev/sda1 is the name of the Linux device corresponding to your EFI system partition, and /boot/efi is the location where the EFI partition is expected to be mounted.

The ACPI error messages are probably not fatal and most likely unrelated. The Linux kernel is successfully starting, but something is going wrong in the boot process. And since you have destroyed & recreated some partitions, the most likely reason is that the contents of the /etc/fstab file no longer match the actual partitioning of your disk.

To do anything in this state, you'll first need to enter the root password. If you haven't set a specific root password, it might be the same as the password of the first user account created when installing the system. There will be no asterisks or any visible confirmation of your keystrokes until you press Enter. If you can successfully enter the root password, you will be in the command prompt with root privileges and can start checking and fixing things.

The /etc/fstab file specifies the disk devices that should be automatically mounted as part of the boot procedure, and the mount point locations and mount options for them. Unless explicitly specified otherwise, the system will assume all the mounts specified are absolutely necessary and will stop the boot process and fall back into text-based emergency mode if even a single specified mount fails.

In /etc/fstab, you can specify disk devices either by device name, like /dev/sda1, or by filesystem UUID, like UUID=<some hexadecimal numbers>. The UUID is a number generated at the time the filesystem is created ("formatted"), and is essentially random. By default, modern Ubuntu uses the latter method to specify that the EFI system partition needs to be mounted to /boot/efi. The resulting line in /etc/fstab should look somewhat like this:

UUID="XXXX-XXXX"    /boot/efi    vfat    umask=0077,shortname=winnt,flush,tz=UTC,codepage=437,iocharset=iso8859-1 0 2

This allows the system to mount the correct partition even if you make changes to your hardware configuration so that the disks are no longer detected in the same order as before.

Now, since you have deleted and recreated your EFI system partition, its UUID has been changed. But the instructions you followed did not seem to include any advice for updating it. You could use the /sbin/blkid /dev/sda1 command to find out the new UUID. The response should be something like this:

/dev/sda1: LABEL="EFISYS" UUID="1BC6-5A0E" TYPE="vfat" PARTLABEL="EFISYS" PARTUUID="4fb8aadb-9507-44b5-8cab-a052a0091e2b"

The important thing is the UUID="1BC6-5A0E" part: it tells you the UUID you need for updating your /etc/fstab file. (The PARTUUID is not used in /etc/fstab, but if you ever edit your firmware boot settings using the efibootmgr command, be aware that the UUIDs used with it are specifically PARTUUIDs.)

Most likely, once you enter the root password and reach the emergency command prompt, you will need only a few commands.

To find out the new UUID:

/sbin/blkid /dev/sda1

To edit the /etc/fstab file:

nano /etc/fstab

If the nano editor fails to save the modified file, you might need to run this command and then try and edit the file again:

mount -o remount,rw /

Once the /etc/fstab file has been successfully edited, you just need to use the exit command to exit the emergency command prompt and resume the boot process.

telcoM
  • 96,466
  • Hey, thanks. Your tip worked.

    BUT, when I turn on the computer, the menu still shows the usual 4 options:-
    • Ubuntu • Ubuntu advanced options • Windows from Boot • System setup

    But, the windows options should have been gone, since I system reserved partitions and previous EFI partition. How can I remove the Windows option??

    – Avinash D Jun 30 '20 at 21:47
  • 1
    The Windows boot option is still defined in the /boot/grub/grub.cfg file, which is autogenerated with the update-grub tool and probably hasn't been updated since you removed the Windows partition. Run sudo update-grub and it should be gone. – telcoM Jun 30 '20 at 21:50
  • Also, would deleting the partitions (that I mentioned above) cause any trouble for the Ubuntu installed or anything, down the line? – Avinash D Jun 30 '20 at 21:50
  • 1
    Not really, since you already fixed the worst damage you could possibly cause that way. The "system reserved" partition is a Windows thing, some space reserved to make switching from MBR to GPT or enabling Windows Dynamic Disks easier, or something. Just remember in the future that before removing any partitions, you should first check /etc/fstab for references to the partitions you wish to delete, and either delete or comment out those lines in advance, to avoid a visit to the emergency mode after deleting the partitions. – telcoM Jun 30 '20 at 21:56