recreation of corrupted EFI system partition

utku

New Member
Joined
Jun 23, 2022
Messages
3
Reaction score
0
Credits
36
Hello mates,

For those who can help, I will add detailed information below, but in summary, I have unfortunately corrupted the EFI System Partition of my laptop. What are my chances of fixing it?

Here I am attaching the picture of the score layout that is still available at the moment:
The 100MB area in this picture above seems to be flagged as bios_grub, but this is not true. I tried to format that part by doing Flag like this, it didn't accept. Normally, the Flag part is blank.

Windows 10 is installed on C Drive. The linux installed in the last partition (#6) was unusable. Because a long time ago, the boot selection screen turned into grub2win and linux was removed from the options, in a way that I did not understand how. Now I wanted to re-install AntiX and ubuntu linux. I wanted to install AntiX on partition 6 by formatting EFI System partition. At this stage, after the EFI is formatted, the linux installation is left unfinished. Now neither windows opens nor linux is opened/installed.

At the moment I am sharing the picture of the current splash screen of the computer:

None of these options above lead anywhere and when I try, the computer restarts and returns to the same screen.

As I understand it, there are normally two options available:
BIOS-MB + MBR or
EFI-MB + GPT

I think my hd has gpt and when I tried to change it to mbr, there was an incompatibility.

In short, how do I open my current windows and how can I install my new AntiX and ubuntu? Is there a way to do this? I would be glad if you help.

Respects,

utku.
 


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,381
Reaction score
1,008
Credits
8,458
GPT runs under Legacy BIOS and DOS runs UEFI just fine. Not sure how that myth got started.
But if you think about it, most Windows systems with UEFI, have DOS type partitions. (Maybe windows 10 and 11 are different).
If you are installing this all on a single hard drive, then everything will have to be EFI. The reason you will need GPT, is the
size of the drive or the number of partitions you need.

Rebuilding your grub and initramfs are fairly easy, but if your directory structure is hosed, then a rebuild might be easier.

You can try...
sudo update-initramfs

The second command is slightly trickier.
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg.

Almost every distro has a slightly different path.
I assume Ubuntu is /boot/efi/EFI/ubuntu/grub.cfg
 

Fanboi

Well-Known Member
Joined
Apr 16, 2021
Messages
440
Reaction score
351
Credits
5,376
[...] in summary, I have unfortunately corrupted the EFI System Partition of my laptop. What are my chances of fixing it?
[...]
In short, how do I open my current windows and how can I install my new AntiX and ubuntu? Is there a way to do this?
If you are going to (re)install Ubuntu and AntiX, then you don't need to fix anything. The installers will sort it all out, including Windows, so just run the installs (I suggest installing AntiX last coz it has a great default GRUB menu pre-configured) and when you reboot, it'll magically be fixed.

That said, for edicational purppses, if I were you and had the time, I'd still try to repair it as a learning exercise. It will better your understanding of the system, not just Linux (I learned of a firmware bug in Dell Inspiron 3k-series this way, for example). Anyway, there's my 2cents.
 
OP
U

utku

New Member
Joined
Jun 23, 2022
Messages
3
Reaction score
0
Credits
36
If you are going to (re)install Ubuntu and AntiX, then you don't need to fix anything. The installers will sort it all out, including Windows, so just run the installs (I suggest installing AntiX last coz it has a great default GRUB menu pre-configured) and when you reboot, it'll magically be fixed.

That said, for edicational purppses, if I were you and had the time, I'd still try to repair it as a learning exercise. It will better your understanding of the system, not just Linux (I learned of a firmware bug in Dell Inspiron 3k-series this way, for example). Anyway, there's my 2cents.
well I again installed ubuntu with creating new partitions as below:


Looks like everythin is perfect. After installation, it still opens with that screen and non of the options arrive anywhere:

:(
Any idea?
 

Fanboi

Well-Known Member
Joined
Apr 16, 2021
Messages
440
Reaction score
351
Credits
5,376
Okay, I see multiple problems here. Aside from your BIOS nvRAM having "stale entries, your SSD has no visible boot partition. There's 600MB unallocated which I assume was meant to be just that. Here's a quick tutorial...

Phase 1
First thing we need to do is boot using the AntiX liveUSB...
***Backup any data you have on this drive***
***Be careful if this is not the latest image of your drive***

Phase 2
Now, we're gonna wipe the redundant options and restore your BIOS boot defaults...
Code:
// Install boot manager
# apt-get install efibootmgr
# efibootmgr

// The above will list your entries. I'm going by the boot menu screen photo, so adjust where needed...
// Note the numbers "Boot0001    Something" etc. will be written as "0x0001" etc.
# efibootmgr --delete-bootnum -b 0x0001
# efibootmgr --delete-bootnum -b 0x0002
# efibootmgr --delete-bootnum -b 0x0003
# efibootmgr --delete-bootorder

Phase 3
I'm not too sure about this last image you posted. I see no signs of anything installed. So I'm assuming you're waiting. Fire up Gparted (still in AntiX live). I'm attaching you image with indicators.
6SNN8SL-mod.png

- Delete the partitions marked in red
- Now create 2 partitions of 45GB each: 1 is for AntiX, 1 is for Ubuntu. I will call these nvme-antix and nvme-ubuntu respectively.
- Now you can optionally create an 8GB swap partition (you shouldn't need it and it will shorten your SSD's life, but it's a safety net). nvme-swap.
- Now allocate the remaining partition: You will use this as your /home/ partition. You'll be sharing this with both distros. You can use a different username for either distro (example: utku-antix, utku-ubuntu) to prevent conflict of config files. nvme-home
- Optionally format the area in green FAT32 (the installer will do it. nvme-boot.

Phase 4 - Ubuntu
- Boot up in Ubuntu, do the install, select "manual partition"
- Now select nvme-ubuntu and choose to "use as ext4 filesystem" and "select mountpoint" as "/"
- Now select nvme-home and use as ext4 and set mountpoint to "/home"
- Optionally seyup swap
- Select nvme-boot and "use as EFI"
- Okay, done and confirm.
- Create your user account for Ubuntu
- Reboot and check that it works. If so, proceed. If not, fire up Antix LiveUSB and use its grub loader to boot into Ubuntu. Confirm it is installed right. It does not need to be bootable coz you're installing AntiX anyway.

Phase 5 - AntiX
- Boot up in AntiX, do install with manual partition
- Use nvme-antix as ext4 and set the mountpoint as /
- Use nvme-home as ext4 and set mountpoint as /home/. Select not to format this partition
- Optionally setup swap (UUID will change so you'll have to update Ubuntu -- separate question)
- Select nvme-boot and use as EFI partition
- Confirm.
- Create a user account with a different name from your Ubuntu install just now.
- Reboot and check everything is in order.

Phase 6 - Cleanup
So, if you followed my instructions and everything went well, you'll have 2 boot options from your BIOS: Ubuntu and AntiX. Obviously, you only need AntiX so you can use efibootmgr to delete the ubuntu entry from your BIOS's nvRAM and reset the boot order (you must reset the boot order) as you did in Phase #2. Okay, you're done. Reboot cold.

You should now have just one bootloader listed by your BIOS. It should boot automatically, though. The AntiX version of GRUB should boot up with options to boot into AntiX, Windows, or Ubuntu along with some advanced and diagnostic options. Congrats.

- J
 

Attachments

  • 6SNN8SL-mod.png
    6SNN8SL-mod.png
    621.2 KB · Views: 5
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top