This is my final post with a summary of my problem and the corresponding solution in order to avoid to waste your time on resolving it.
The first thing to do is to check if you boot your live Ubuntu system in UEFI mode
Code:
[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
If the answer is "EFI boot on HDD" then you can proceed otherwise you have to modify your boot setting into the BIOS https://help.ubuntu.com/community/UEFI
Then you have to: 1) restore your efi partition and 2) reinstall the GRUB
1) To restore your efi partition
First install efi boot manager
Code:
sudo apt-get install efibootmgr
check that your partition is GPT and that you have an efi partition as first partition of your drive https://help.ubuntu.com/community/UEFI
Code:
sudo gdisk -l /dev/sda
Then you have to mount your Ubuntu system partition and efi partition. In my case the Ubuntu is located in /dev/sda2
Code:
sudo mkdir -p /mnt/system
sudo mount /dev/sda2 /mnt/system
while the efi partition is located in /dev/sda1
Code:
sudo mount /dev/sda1 /mnt/system/boot/efi
Finally you have to install one entry into the UEFI BIOS boot list with the following command
Code:
efibootmgr -c -d /dev/sda -p 1 -w -L ubuntu
Now you have installed the efi entry for the Ubuntu system.
2) To install the GRUB you have two possibilities. First, for both you have to install this
Code:
sudo apt-get install grub-efi-amd64
and now your live Ubuntu is able to install UEFI GRUB.
The first possibility is to manually install the GRUB with these following commands
Code:
sudo grub-install --boot-directory=/mnt/system/boot --bootloader-id=ubuntu --target=x86_64-efi --efi-directory=/mnt/system/boot/efi --recheck --debug /dev/sda
and
Code:
sudo grub-mkconfig -o /mnt/system/boot/efi/EFI/GRUB/grub.cfg
while the second possibility is a guided procedure using Boot-repair https://help.ubuntu.com/community/Boot-Repair
Code:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list"
sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)
Now you can launch Boot-Repair and follow the instructions at video. At certain point the Boot-Repair ask to you to launch these commands from terminal
Code:
sudo chroot "/mnt/system" dpkg --configure -a
sudo chroot "/mnt/system" apt-get install -fy
sudo chroot "/mnt/system" apt-get install -y --force-yes grub-efi-amd64-signed shim-signed linux-signed-generic
At the end you can boot again your Ubuntu system
Bookmarks