Score:1

How to fix broken /boot/efi Partition?

jp flag

My computer originally came with Windows 10 installed on it, but then I dualbooted Kubuntu, and then removed Windows 10 from my computer entirely. When I installed different distros, I noticed that they failed to install GRUB2 a lot, but the Boot Repair app fixed those problems, but I know something is wrong with the /boot/efi partition and I'm not sure how to fix it. Maybe I could try and remake it, but I'm not sure how to do it. I need to reinstall Windows, and this problem still effects any operating system I try to install.

"findmnt /boot/efi" output:

darkbrave_@kubuntu:~$ findmnt /boot/efi
TARGET    SOURCE    FSTYPE OPTIONS
/boot/efi /dev/sda2 vfat   rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859
darkbrave_@kubuntu:~$ 

"sudo fdisk -l /dev/sda" output:

darkbrave_@kubuntu:~$ sudo fdisk -l /dev/sda
[sudo] password for darkbrave_: 
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: WDC WDS240G2G0A-
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DD13C831-F5D0-48B1-A747-DF7233C3E57A

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1087487   1085440  530M Windows recovery environment
/dev/sda2    1087488   1292287    204800  100M EFI System
/dev/sda5  364007424 468860927 104853504   50G Linux filesystem
darkbrave_@kubuntu:~$ 

"sudo fdisk -l /dev/sda2" output:

darkbrave_@kubuntu:~$ sudo fdisk -l /dev/sda2
Disk /dev/sda2: 100 MiB, 104857600 bytes, 204800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x500a0dff

Device      Boot      Start        End    Sectors   Size Id Type
/dev/sda2p1      1948285285 3650263507 1701978223 811.6G 6e unknown
/dev/sda2p2               0          0          0     0B 74 unknown
/dev/sda2p4        28049408   28049848        441 220.5K  0 Empty

Partition table entries are not in disk order.
darkbrave_@kubuntu:~$ 
Organic Marble avatar
us flag
Are you having an issue installing Windows? That doesn't sound like a question for this stack.
DarkBrave_ avatar
jp flag
@OrganicMarble I'm asking how to fix the broken partition, as it effects any operating system or distribution I install.
mook765 avatar
cn flag
@DarkBrave_ Please add the out of the command `findmnt /boot/efi` via [edit](https://askubuntu.com/posts/1355186/edit) to your question.
DarkBrave_ avatar
jp flag
@mook765 I got this an output
mook765 avatar
cn flag
@DarkBrave_ Did you run the command in a live session or from your installed system?
DarkBrave_ avatar
jp flag
@mook765 I ran it on my installed system.
mook765 avatar
cn flag
The mount looks ok, no idea what your problem is. Do you use `GTP`or `dos` partition table. Is boot-flag set? `sudo fdisk -l /dev/sda` may show something useful. Since you are able to boot, your EFI Sytem partition should be ok.
DarkBrave_ avatar
jp flag
@mook765 I added the fdisk -l outputs to the post, so that should give you some info.
mook765 avatar
cn flag
I can't see anything strange in your output. One point you can check is how much free space you have on this partition with `sudo df -h /boot/efi`. Avoid trying to install other distros in legacy mode, that would fail to install the bootloader. Maybe disable legacy boot (CSM) in your firmware settings is a good idea.
DarkBrave_ avatar
jp flag
@mook765 it was the CSM setting ‍♂️
Score:2
cn flag

Your output shows nothing strange and you can succesfully boot into your system. This indicates that your EFI System Partition is ok.

A common mistake is mixing up boot-modes (legacy vs. UEFI). Before you install an operating system, you should examine your partition tables and if you multi-boot, you should check in which boot-mode other operating systems are installed.

All OS should be installed in the same boot-mode to achieve a proper multi-boot.

The symptom you describe mostly appears, when you try to install in legacy mode on a disk with GPT partition table. In such a case an extra bios_grub-partition would be needed to install grub properly, if this partition doesn't exist, the installation fails. There is no installer which creates this partition for you, you would have to do it manually.

You can disable legacy boot (CSM) in your firmware settings to avoid such a confusion.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.