With a pretty red face I am trying to recover my Deepin install.

I had Ubuntu 16.04 installed but wanted to try something different. When I previously removed Ubuntu from my windows dual boot I had to manually remove the ubuntu EFI directory to stop the system launching in the boot menu everytime. Like a moron I tried to do the same with my linux only machine and now everytime I boot I just get:

GNU GRUB version 2.02~berta2-36ubuntu2

I tried just exiting using the exit command but then I just get a message saying install a proper boot device.

I tried to enter failsafe mode from the deepin boot drive to add the efi file back in but I think this is just a live mode so everytime I reboot the ubuntu directory is gone again.

Is there any way to overcome this short of a reinstall? Can I somehow just get the ubuntu efi directory back in there from GRUB or something?

I have now gone through the recovery process as per the comment with Boot-Repair and it still boots in gnu grub.


Since the efi ubuntu directory has been deleted you would have to copy the efi files from a live cd of the same version as your current ubuntu

So lets first Boot into a live cd of Ubuntu 16.04 LTS .
Sometimes other versions of ubuntu would work but don't use another distro to do the live cd

open your terminal and list the partitions on your computer

lsblk

yOu get something like

sda            8:0    0 931.5G  0 disk 
├─sda1         8:1    0 601.4G  0 part 
├─sda2         8:2    0 325.2G  0 part 
└─sda3         8:3    0   200M  0 part 
sr1           11:1    1  1024M  0 rom  
sdb
├─sdb1         8:1    0 4.4G  0 part /media/user/pendrive

Guess your linux ext4 filesytem, sdXY . In this case mine was sda1. Replace it with your own

Now we should mount the linux filesystem:

sudo mount /dev/sdXY /mnt

mount some other required things:

for i in  /dev  /dev/pts  /proc  /sys  /run; do sudo mount -B $i  /mnt$i; done

Now chroot into the mounted partition.

sudo chroot /mnt

You should now be in your old ubuntu filesystem

Now Create the directory where grub would install the files:

# mkdir -p /boot/efi

lets identify our EFI partition:

lsblk

it is usually around 100MB or 200MB. Mine was sda3. I would be representing it using sdxy. The disk is sda.

Now mount the efi partition:

# mount /dev/sdxy /boot/efi 

Install grub to the disk:

# apt install efibootmgr
# grub-install /dev/sdX

grub would install all the nessary efi files required to boot your PC

After installing grub do:

# update-grub

When you are done exit the chroot:

# exit

Now reboot:

reboot

Hopefully this should fix it