<SOLVED>Boot-repair failed after deleting windows and remaking new efi partition

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

<SOLVED>Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Hi, I recently decided to remove windows from my SSD as I do not use it much. While using gparted to remove windows, I removed the efi partition also which was the main cause of this problem, causing it to not boot. I made a new efi partition with gparted and ran boot-repair thru the installation usb. The boot-repair had errors stating that ESP was locked. I proceeded to restart my pc and it booted into the grub command shell.

From there, I was able to boot into linux using this.

Code: Select all

grub> linux (hd4,4)/boot/vmlinuz-3.13.0-29-generic root=/dev/sda4
grub> initrd (hd4,4)/boot/initrd.img-4.15.0-99-generic
grub> boot
While in it, I ran the boot-repair again this time the error is "Please do not forget to make your UEFI firmware boot on sda1/EFI/ubuntu/shimx64.efi file!".
Link to the boot-repair log: http://paste.ubuntu.com/p/nc65bSc4rB/
After reboot, I'm back to the same grub command shell, using the same method above to boot into linux.

How do I get the grub menu back? Thanks in advance :D

Code: Select all

inxi -Fxxxrz
System:
  Host: lucifer-Z170X-UD5-TH Kernel: 4.15.0-99-generic x86_64 bits: 64 
  compiler: gcc v: 7.5.0 Desktop: Cinnamon 4.4.8 wm: muffin 4.4.2 
  dm: LightDM 1.26.0 Distro: Linux Mint 19.3 Tricia 
  base: Ubuntu 18.04 bionic 
Machine:
  Type: Desktop System: Gigabyte product: Z170X-UD5 TH v: N/A 
  serial: <filter> 
  Mobo: Gigabyte model: Z170X-UD5 TH-CF serial: <filter> 
  UEFI: American Megatrends v: F5 date: 03/14/2016 
CPU:
  Topology: Quad Core model: Intel Core i7-6700K bits: 64 type: MT MCP 
  arch: Skylake-S rev: 3 L2 cache: 8192 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 64128 
  Speed: 800 MHz min/max: 800/4200 MHz Core speeds (MHz): 1: 800 2: 800 
  3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
Graphics:
  Device-1: NVIDIA GM204 [GeForce GTX 970] vendor: ASUSTeK driver: nvidia 
  v: 440.59 bus ID: 01:00.0 chip ID: 10de:13c2 
  Display: x11 server: X.Org 1.19.6 driver: nvidia 
  unloaded: fbdev,modesetting,nouveau,vesa 
  resolution: 1920x1080~60Hz, 1920x1080~60Hz 
  OpenGL: renderer: GeForce GTX 970/PCIe/SSE2 v: 4.6.0 NVIDIA 440.59 
  direct render: Yes 
Audio:
  Device-1: Intel 100 Series/C230 Series Family HD Audio 
  vendor: Gigabyte Sunrise Point-H driver: snd_hda_intel v: kernel 
  bus ID: 00:1f.3 chip ID: 8086:a170 
  Device-2: NVIDIA GM204 High Definition Audio vendor: ASUSTeK 
  driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:0fbb 
  Device-3: BEHRINGER type: USB driver: snd-usb-audio bus ID: 1-2:3 
  chip ID: 1397:0508 
  Sound Server: ALSA v: k4.15.0-99-generic 
Network:
  Device-1: Intel Ethernet I219-V driver: e1000e v: 3.2.6-k port: f000 
  bus ID: 00:1f.6 chip ID: 8086:15b8 
  IF: enp0s31f6 state: down mac: <filter> 
  Device-2: Broadcom and subsidiaries BCM4360 802.11ac Wireless Network 
  Adapter 
  driver: wl v: kernel port: e000 bus ID: 04:00.0 chip ID: 14e4:43a0 
  IF: wlp4s0 state: up mac: <filter> 
  Device-3: Wacom Wireless adapter for Bamboo tablets type: USB 
  driver: usbhid,wacom bus ID: 1-3:4 chip ID: 056a:0084 
Drives:
  Local Storage: total: 1.72 TiB used: 1.02 TiB (59.3%) 
  ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO M.2 250GB 
  size: 232.89 GiB speed: 6.0 Gb/s serial: <filter> rev: 1B6Q scheme: GPT 
  ID-2: /dev/sdb vendor: Toshiba model: DT01ACA100 size: 931.51 GiB 
  speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: A750 scheme: MBR 
  ID-3: /dev/sdc vendor: Western Digital model: WD6400BEVT-22A0RT0 
  size: 596.17 GiB speed: 3.0 Gb/s rotation: 5400 rpm serial: <filter> 
  rev: 1A01 scheme: MBR 
Partition:
  ID-1: / size: 228.13 GiB used: 83.53 GiB (36.6%) fs: ext4 dev: /dev/sda4 
Sensors:
  System Temperatures: cpu: 44.0 C mobo: 29.8 C gpu: nvidia temp: 52 C 
  Fan Speeds (RPM): N/A gpu: nvidia fan: 10% 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
  1: deb [arch=amd64,arm64,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.4/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/deluge-team-stable-bionic.list 
  1: deb http://ppa.launchpad.net/deluge-team/stable/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/inkscape_dev-stable-bionic.list 
  1: deb http://ppa.launchpad.net/inkscape.dev/stable/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-debian.gcc5.list 
  1: deb http://ppa.launchpad.net/kxstudio-debian/gcc5/ubuntu wily main
  2: deb http://ppa.launchpad.net/kxstudio-debian/gcc5/ubuntu xenial main
  3: deb http://ppa.launchpad.net/kxstudio-debian/gcc5-deps/ubuntu xenial main
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-debian.gcc5plus.list 
  1: deb http://ppa.launchpad.net/kxstudio-debian/kxstudio/ubuntu xenial main
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-debian.list 
  1: deb [arch=amd64,i386] http://ppa.launchpad.net/kxstudio-debian/libs/ubuntu lucid main
  2: deb [arch=amd64,i386] http://ppa.launchpad.net/kxstudio-debian/music/ubuntu lucid main
  3: deb [arch=amd64,i386] http://ppa.launchpad.net/kxstudio-debian/plugins/ubuntu lucid main
  4: deb [arch=amd64,i386] http://ppa.launchpad.net/kxstudio-debian/apps/ubuntu lucid main
  5: deb [arch=amd64,i386] http://ppa.launchpad.net/kxstudio-debian/kxstudio/ubuntu lucid main
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-debian.new.list 
  1: deb http://ppa.launchpad.net/kxstudio-debian/libs/ubuntu trusty main
  2: deb http://ppa.launchpad.net/kxstudio-debian/music/ubuntu trusty main
  3: deb http://ppa.launchpad.net/kxstudio-debian/plugins/ubuntu trusty main
  4: deb http://ppa.launchpad.net/kxstudio-debian/apps/ubuntu trusty main
  5: deb http://ppa.launchpad.net/kxstudio-debian/kxstudio/ubuntu trusty main
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-free.gcc5.list 
  1: deb [arch=amd64,i386] http://kxstudio.linuxaudio.org/repo/ gcc5 free
  Active apt repos in: /etc/apt/sources.list.d/kxstudio-free.list 
  1: deb [arch=amd64,i386] http://kxstudio.linuxaudio.org/repo/ stable free
  Active apt repos in: /etc/apt/sources.list.d/obsproject-obs-studio-bionic.list 
  1: deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://mirror.0x.sg/linuxmint tricia main upstream import backport
  2: deb http://mirror.0x.sg/ubuntu bionic main restricted universe multiverse
  3: deb http://mirror.0x.sg/ubuntu bionic-updates main restricted universe multiverse
  4: deb http://mirror.0x.sg/ubuntu bionic-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ bionic partner
  Active apt repos in: /etc/apt/sources.list.d/ondrej-php-bionic.list 
  1: deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main
  Active apt repos in: /etc/apt/sources.list.d/steam.list 
  1: deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
  2: deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
  Active apt repos in: /etc/apt/sources.list.d/vscode.list 
  1: deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
  Active apt repos in: /etc/apt/sources.list.d/yannubuntu-boot-repair-bionic.list 
  1: deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu bionic main
Info:
  Processes: 269 Uptime: 48m Memory: 15.61 GiB used: 1.85 GiB (11.8%) 
  Init: systemd v: 237 runlevel: 5 Compilers: gcc: 7.5.0 alt: 7 Shell: bash 
  v: 4.4.20 running in: gnome-terminal inxi: 3.0.32
Last edited by lucifertan on Sat May 23, 2020 4:23 pm, edited 1 time in total.

HaveaMint
Level 5
Level 5
Posts: 746
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in the USA
Contact:

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by HaveaMint »

"Tune for maximum Smoke and then read the Instructions".

lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Hi, thanks for helping me out. I've just tried to follow the steps in the link provided but I still have the same problem of booting into grub shell instead of menu.

Code: Select all

mint@mint:~$ sudo mount /dev/sda4 /mnt
mint@mint:~$ sudo mount /dev/sda1 /mnt/boot/efi
mint@mint:~$ for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
mint@mint:~$ sudo chroot /mnt
root@mint:/# grub-install /dev/sda
Installing for x86_64-efi platform.
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Installation finished. No error reported.
root@mint:/# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/60_mint-theme.cfg'
Generating grub configuration file ...
/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/fonts/UbuntuMono16.pf2'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by pbear »

Please boot a live session and report the output of sudo parted --list. My hunch is that you neglected to set the boot/esp flags. Several ways to do that, of which GParted is probably the easiest. Once you have, install Grub again. No need for chroot.* This should do it:

Code: Select all

apt install grub-efi-amd64-signed shim-signed
sudo mount /dev/sda4 /mnt
sudo mount /dev/sda1 /mnt/boot/efi 
sudo grub-install /dev/sda --boot-directory=/mnt/boot --uefi-secure-boot 
* Generally speaking, chroot is only needed when installing Grub if you want to generate (or regenerate) the grub.cfg file.

If this doesn't work, it's because Boot Repair modified something which reinstall isn't overwriting. In that event, escalate to purge-and-reinstall. Boot the live session again. For this you will need chroot. When prompted, confirm removal of the boot loader. When prompted, designate EFI partition for boot loader destination, but don't also install to the root partition.

Code: Select all

sudo mount /dev/sda4 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo cp /etc/resolv.conf /mnt/etc
modprobe efivars
sudo chroot /mnt
apt purge grub-common
apt install grub-efi-amd64-signed os-prober shim-signed
exit
for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
sudo umount /mnt/boot/efi 
sudo umount /mnt
You'll notice this is similar to, but different from what's described on the askubuntu page. We're doing something similar but different. :wink:
Also, these instructions will get you secure boot compatibility, where askubuntu's will not.

lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Hi, I did set the boot/esp flags after creating a new EFI partition in GParted.

Code: Select all

mint@mint:~$ sudo parted -l
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  106MB  105MB  fat32        EFI System Partition  boot, esp
 4      106MB   250GB  250GB  ext4


Model: ATA TOSHIBA DT01ACA1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1000GB  1000GB  primary  ntfs


Model: ATA WDC WD6400BEVT-2 (scsi)
Disk /dev/sdc: 640GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  640GB  640GB  primary  ntfs


Model: SanDisk Cruzer Blade (scsi)
Disk /dev/sdh: 8000MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                 Flags
 1      1049kB  8000MB  7999MB  fat32        Main Data Partition  msftdata
So, I proceeded with the first suggestion and it did not work for me. I then tried to purge-and-reinstall but the same problem still persists.
However, during the installation it did not prompt me to designate boot loader destination as you have mentioned.

Code: Select all

mint@mint:~$ sudo mount /dev/sda4 /mnt
mint@mint:~$ sudo mount /dev/sda1 /mnt/boot/efi
mint@mint:~$ for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
mint@mint:~$ sudo cp /etc/resolv.conf /mnt/etc
mint@mint:~$ modprobe efivars
mint@mint:~$ sudo chroot /mnt
root@mint:/# apt purge grub-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  glade2script glade2script-python3
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  boot-repair* boot-sav* grub-common* grub-efi* grub-efi-amd64*
  grub-efi-amd64-bin* grub-efi-amd64-signed* grub2-common* os-prober*
  shim-signed*
0 upgraded, 0 newly installed, 10 to remove and 25 not upgraded.
After this operation, 24.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 300522 files and directories currently installed.)
Removing boot-repair (4ppa122) ...
Removing boot-sav (4ppa122) ...
Removing grub-efi (2.02-2ubuntu8.15) ...
Removing shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) ...
Removing grub-efi-amd64-signed (1.93.16+2.02-2ubuntu8.15) ...
Removing grub-efi-amd64 (2.02-2ubuntu8.15) ...
Removing grub-efi-amd64-bin (2.02-2ubuntu8.15) ...
Removing os-prober (1.74ubuntu1) ...
Removing grub2-common (2.02-2ubuntu8.15) ...
Removing grub-common (2.02-2ubuntu8.15) ...
Running in chroot, ignoring request.
Processing triggers for desktop-file-utils (0.23+linuxmint8) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
(Reading database ... 299969 files and directories currently installed.)
Purging configuration files for grub-efi-amd64 (2.02-2ubuntu8.15) ...
Purging configuration files for shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) ...
Purging configuration files for boot-repair (4ppa122) ...
Purging configuration files for grub-common (2.02-2ubuntu8.15) ...
dpkg: warning: while removing grub-common, directory '/etc/grub.d' not empty so not removed
Purging configuration files for grub-efi (2.02-2ubuntu8.15) ...
Processing triggers for ureadahead (0.100.0-21) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (237-3ubuntu10.40) ...
Processing triggers for ubuntu-system-adjustments (2019.12.09) ...
Reloading systemd
Running in chroot, ignoring request: daemon-reload
Removed /etc/systemd/system/multi-user.target.wants/hddtemp.service.
Created symlink /etc/systemd/system/multi-user.target.wants/hddtemp.service → /etc/systemd/system/hddtemp.service.
root@mint:/# apt install grub-efi-amd64-signed os-prober shim-signed
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  glade2script glade2script-python3
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  grub-common grub-efi-amd64 grub-efi-amd64-bin grub2-common
Suggested packages:
  multiboot-doc grub-emu xorriso desktop-base
The following NEW packages will be installed:
  grub-common grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed
  grub2-common os-prober shim-signed
0 upgraded, 7 newly installed, 0 to remove and 25 not upgraded.
Need to get 0 B/3672 kB of archives.
After this operation, 21.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package grub-common.
(Reading database ... 299951 files and directories currently installed.)
Preparing to unpack .../0-grub-common_2.02-2ubuntu8.15_amd64.deb ...
Unpacking grub-common (2.02-2ubuntu8.15) ...
Selecting previously unselected package grub-efi-amd64-bin.
Preparing to unpack .../1-grub-efi-amd64-bin_2.02-2ubuntu8.15_amd64.deb ...
Unpacking grub-efi-amd64-bin (2.02-2ubuntu8.15) ...
Selecting previously unselected package grub2-common.
Preparing to unpack .../2-grub2-common_2.02-2ubuntu8.15_amd64.deb ...
Unpacking grub2-common (2.02-2ubuntu8.15) ...
Selecting previously unselected package grub-efi-amd64.
Preparing to unpack .../3-grub-efi-amd64_2.02-2ubuntu8.15_amd64.deb ...
Unpacking grub-efi-amd64 (2.02-2ubuntu8.15) ...
Selecting previously unselected package grub-efi-amd64-signed.
Preparing to unpack .../4-grub-efi-amd64-signed_1.93.16+2.02-2ubuntu8.15_amd64.deb ...
Unpacking grub-efi-amd64-signed (1.93.16+2.02-2ubuntu8.15) ...
Selecting previously unselected package os-prober.
Preparing to unpack .../5-os-prober_1.74ubuntu1_amd64.deb ...
Unpacking os-prober (1.74ubuntu1) ...
Selecting previously unselected package shim-signed.
Preparing to unpack .../6-shim-signed_1.37~18.04.3+15+1533136590.3beb971-0ubuntu1_amd64.deb ...
Unpacking shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) ...
Setting up grub-common (2.02-2ubuntu8.15) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Running in chroot, ignoring request.
Processing triggers for ubuntu-system-adjustments (2019.12.09) ...
Reloading systemd
Running in chroot, ignoring request: daemon-reload
Removed /etc/systemd/system/multi-user.target.wants/hddtemp.service.
Created symlink /etc/systemd/system/multi-user.target.wants/hddtemp.service → /etc/systemd/system/hddtemp.service.
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Setting up grub2-common (2.02-2ubuntu8.15) ...
Setting up os-prober (1.74ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.40) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up grub-efi-amd64-bin (2.02-2ubuntu8.15) ...
Setting up grub-efi-amd64 (2.02-2ubuntu8.15) ...

Creating config file /etc/default/grub with new version
Installing for x86_64-efi platform.
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Installation finished. No error reported.
Setting up grub-efi-amd64-signed (1.93.16+2.02-2ubuntu8.15) ...
Installing for x86_64-efi platform.
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Installation finished. No error reported.
Setting up shim-signed (1.37~18.04.3+15+1533136590.3beb971-0ubuntu1) ...
Installing for x86_64-efi platform.
Skipping unreadable variable "Boot0002": Input/output error
Skipping unreadable variable "Boot0002": Input/output error
Installation finished. No error reported.
Generating a new Secure Boot signing key:
Can't load /var/lib/shim-signed/mok/.rnd into RNG
139705529492608:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:98:Filename=/var/lib/shim-signed/mok/.rnd
Generating a RSA private key
.........+++++
...............................+++++
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
-----
Secure Boot not enabled on this system.
root@mint:/# exit
exit
mint@mint:~$ for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
mint@mint:~$ sudo umount /mnt/boot/efi
mint@mint:~$ sudo umount /mnt

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by pbear »

Well, bother. Kudos, though, for careful execution of instructions. Let's see if we can find what's missing. Can you still boot into the system from the grub prompt, as you did in the OP? If so, run apt install tree, then report the output of:

Code: Select all

sudo tree /boot/efi
efibootmgr --verbose
ls -l /etc/grub.d
cat /etc/fstab

lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Yup, I'm still able to boot from grub prompt.

Code: Select all

sudo tree /boot/efi
/boot/efi
└── EFI
    ├── BOOT
    │   ├── bkpbootx64.efi
    │   ├── bootx64.efi
    │   ├── fbx64.efi
    │   └── grubx64.efi
    └── ubuntu
        ├── BOOTX64.CSV
        ├── grub.cfg
        ├── grubx64.efi
        ├── mmx64.efi
        └── shimx64.efi

Code: Select all

efibootmgr --verbose
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0004,0002,0003
Boot0000* ubuntu	HD(1,GPT,a05dd597-7947-4ef4-b099-1c28a428ba6c,0x800,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0002* Hard Drive	BBS(HD,,0x0)..GO..NO........o.S.a.m.s.u.n.g. .S.S.D. .8.5.0. .E.V.O. .M...2. .2.5.0.G.B....................A...........................>..Gd-.;.A..MQ..L.3.S.C.3.X.N.J.0.0.2.2.0.8.9. .V. . . . ........BO..NO........a.G.e.n.e.r.i.c.-.S.D./.M.M.C. .1...0.0....................A................................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.4.6.4.7.6........BO..NO........f.G.e.n.e.r.i.c.-.C.o.m.p.a.c.t. .F.l.a.s.h. .1...0.1....................A.....................................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.4.6.4.7.6........BO..NO........f.G.e.n.e.r.i.c.-.S.M./.x.D.-.P.i.c.t.u.r.e. .1...0.2....................A.....................................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.4.6.4.7.6........BO..NO........f.G.e.n.e.r.i.c.-.M.S./.M.S.-.P.r.o. .1...0.3....................A.....................................Gd-.;.A..MQ..L.0.5.8.F.6.3.6.4.6.4.7.6........BO..NO........o.T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .1. .T.7.T.E.P.H.S.F........BO..NO........o.W.D.C. .W.D.6.4.0.0.B.E.V.T.-.2.2.A.0.R.T.0....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.X.W.1.A.2.A.S.0.2.3.3.4........BO
Boot0003* CD/DVD Drive	BBS(CDROM,,0x0)..GO..NO........o.A.T.A.P.I. . . .D.V.D. .A. . .D.H.1.6.A.6.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . . . . . . . . . ........BO
Boot0004* ubuntu	HD(1,GPT,a05dd597-7947-4ef4-b099-1c28a428ba6c,0x800,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)..BO

Code: Select all

ls -l /etc/grub.d
total 80
-rwxr-xr-x 1 root root 10046 Mar 12 04:57 00_header
-rwxr-xr-x 1 root root  6258 Mar 12 04:57 05_debian_theme
-rwxr-xr-x 1 root root 12693 Mar 12 04:57 10_linux
-rwxr-xr-x 1 root root 11298 Mar 12 04:57 20_linux_xen
-rwxr-xr-x 1 root root   424 May 21 18:32 25_custom
-rwxr-xr-x 1 root root 12059 Mar 12 04:57 30_os-prober
-rwxr-xr-x 1 root root  1418 Mar 12 04:57 30_uefi-firmware
-rwxr-xr-x 1 root root   214 Mar 12 04:57 40_custom
-rwxr-xr-x 1 root root   216 Mar 12 04:57 41_custom
-rw-r--r-- 1 root root   483 Mar 12 04:57 README

Code: Select all

cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>

UUID=20a3f0f5-6a48-4f9d-9977-597bf52335bd	/	ext4	errors=remount-ro	0	1
#UUID=00A5-52E0	/boot/efi	vfat	umask=0077	0	1
/swapfile	none	swap	sw	0	0
/dev/disk/by-uuid/8ECCBA92CCBA73D5 /mnt/8ECCBA92CCBA73D5 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/C450442150441C94 /mnt/C450442150441C94 auto nosuid,nodev,nofail,x-gvfs-show 0 0
#UUID=57F0-35DA  /boot/efi       vfat    defaults      0       1
UUID=57F0-35DA  /boot/efi       vfat    defaults      0       1

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by pbear »

We may have found it. Edit fstab to remove the # in front of the fourth line (the one with umask=0077). Also, delete the last two lines. The line which is commented out is correct and the other two are incorrect. Failure to boot is a natural consequence. Indeed, needs to be fixed even if not the problem. In case you don't know, you edit a config file with either sudo nano /etc/fstab or xed admin:///etc/fstab. Or you can open File Manager as Root, navigate to the file and double-click to open with xed. If you're not familiar with nano, xed probably will be easier, as it's a GUI text editor.

lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Ok, I removed the # in front of "UUID=00A5-52E0 /boot/efi vfat umask=0077 0 1" and edited to UUID=57F0-35DA as this is the UUID of the new EFI partition.
00A5-52E0 was the one I deleted during the removal of windows. I could not boot into linux from grub with it.
Still being brought to grub prompt instead of menu after fstab edit. :(

Code: Select all

cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>

UUID=20a3f0f5-6a48-4f9d-9977-597bf52335bd	/	ext4	errors=remount-ro	0	1
UUID=57F0-35DA	/boot/efi	vfat	umask=0077	0	1
/swapfile	none	swap	sw	0	0
/dev/disk/by-uuid/8ECCBA92CCBA73D5 /mnt/8ECCBA92CCBA73D5 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/C450442150441C94 /mnt/C450442150441C94 auto nosuid,nodev,nofail,x-gvfs-show 0 0

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by pbear »

Only thing I can think of is that maybe there's a problem with the boot loaders themselves. Checking in a virtual machine, I see purging Grub does not remove those, so I doubt reinstalling Grub replaces them. Let's try forcing that manually. Open File Manager; right-click somewhere blank (not a file) and select Open as Root. Go to /boot/efi and delete the EFI sub-folder. Then, reinstall Grub with the same commands I gave before:

Code: Select all

apt install grub-efi-amd64-signed shim-signed
sudo mount /dev/sda4 /mnt
sudo mount /dev/sda1 /mnt/boot/efi 
sudo grub-install /dev/sda --boot-directory=/mnt/boot --uefi-secure-boot
By the way, doubt it's relevant, but is secure boot enabled or disabled? Also, what are those last two lines in fstab for?

lucifertan
Level 1
Level 1
Posts: 6
Joined: Thu May 21, 2020 7:50 am

Re: Boot-repair failed after deleting windows and remaking new efi partition

Post by lucifertan »

Turns out the problem is because fonts and themes for the menu were missing in /boot/grub. Which I think Boot Repair was the culprit as it renamed the original grub folder to grub.bak and reinstalled grub but did not install fonts and themes. I copied those files from grub.bak into the grub folder and ran sudo update-grub to fix it.
Thanks pbear for your kind help!! :D

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: <SOLVED>Boot-repair failed after deleting windows and remaking new efi partition

Post by pbear »

You're welcome, though of course you solved the problem yourself.

Quite annoying about Boot Repair. Thanks for the tip.

Post Reply

Return to “Installation & Boot”