Deleted EFI Folder , how to recover it or make a new one?

Hello Everyone

Yesterday , I had plugged a USB into my system , it was a Live USB(Bootable one), but it didn’t get recognized ,seeing this , i had an EFI Partition in my system , whose folder i first deleted and then later on formatted it , thinking this was the EFI of Live USB , still when nothing happened , I checked from disk management and realized , i had formatted the wrong partition, at first , I didn’t realize it , until i had to restart my system and the grub had changed on loading Manjaro it failed to load and displayed error , on some research , I found out that it can be made working if we have that storage unused , which is in my case , also I don’t want to ruin the system anymore so i didn’t try for any solutions.
I have also found something similar on Manjaro forum , but don’t want to risk doing more thing ,

I’ll post my system details in five mins , sorry to make you wait

Use a live USB to re-create the partition, using either gparted or KDE partition manager. The filesystem should be FAT32, and it should have the boot and esp flags.

Then follow this guide:

EDIT:

Before you chroot and fix grub, edit manjaro’s /etc/fstab to account for the new UUID.

2 Likes

@dmt , i have endeavouros installed , can i try from there rather than booting from a live usb ?? and from then i have to reinstall grub ?
on running

sudo fdisk -l /dev/sdb

[parasetu@pasec ~]$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 1.82 TiB, 2000365289472 bytes, 3906963456 sectors
Disk model: Elements 2621   
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: F464602D-0DA6-B94A-A80E-FD97385506AB

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048   25167871   25165824    12G Linux swap
/dev/sdb2   150382592  653699071  503316480   240G Linux filesystem
/dev/sdb3   653699072  653903871     204800   100M Microsoft basic data
/dev/sdb4    25167872  150382591  125214720  59.7G Linux filesystem
dev/sdb5  3082731520 3292446719  209715200   100G Linux filesystem
/dev/sdb7   654952448  864667647  209715200   100G Linux filesystem
/dev/sdb8   864667648 1177143295  312475648   149G Linux filesystem
/dev/sdb9  1386858496 1407830015   20971520    10G Linux swap
dev/sdb10  653903872  654952447    1048576   512M Microsoft basic data
/dev/sdb11 3292446720 3317612543   25165824    12G Linux swap
/dev/sdb12 1407830016 1409927167    2097152     1G EFI System
/dev/sdb13 1409927168 3082727423 1672800256 797.7G Linux filesystem

Also , I’m confused which disk partition it was as sdb6 is missing and sdb10 seems to be the one with enough space for efi

The partitioning is no problem, you can use any distro for that.

The chroot and fixing (installing and updating) grub may (or may not) work. I can’t think of any reason it wouldn’t, but I don’t use endeavour.

You should be able to use arch-chroot instead of manjaro-chroot.

Well only you know your system, we can only guess. How many EFI partitions did you have?

Based on what you say, I’d guess that sdb10 is an EFI for windows, sdb12 is an EFI for endeavour, and you deleted sdb6. :man_shrugging:

There should be some unused space where you deleted the partition. Look using a partition editor such as gparted or kde partition manager.

Not sure if endeavour can boot manjaro, but being arch based it may well be able to. If so you could make sure os-prober is enabled in /etc/default/grub and update grub from there, then endeavour’s grub could boot manjaro.

2 Likes

If you just deleted the folder (the directory) - then create it again
on the right partition
Which one it is/was is difficult (aka: impossible) to say from your fdisk output

You could look up /etc/fstab - the info should be there.

The /boot directory is already there - in the / (root) of the file system
the EFI partition is mounted to it -
all you would have likely done is to delete the efi directory inside it.

2 Likes

The small box is the one i think it was, i had deleted in windows explorer , there its mentioned as disk ‘l’ , but if i look at the first image i have shared , the failed for system check on … , do not match with any i see here

and what is media items , i have tried posting a ss but it doesn’t allow it.

?
… “the small box” does not compute …
and:
I really do not know Windows well - but well enough to know that it (by default) can’t see Linux partitions
But the EFI is different - the file system is FAT.
A Windows native file system.

1 Like

yes sir , could be , if i can make a direct directory , that would be so easy to do , please guide me further

as I said:
cat /etc/fstab
using a USB booted system to access that file
look at what is in there - how and where it is mounted

it was about the ss , wait i try to re upload it

again , its saying

An error occurred: Sorry, you can’t embed media items in a post.

</> # /etc/fstab: static file system information.

</> # Use 'blkid' to print the universally unique identifier for a device; this may
</> # be used with UUID= as a more robust way to name devices that works even if
</> # disks are added and removed. See fstab(5).

# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=3B51-861D                            /boot/efi      vfat    umask=0077 0 2
UUID=c4596ece-df47-4850-b449-a3d299717e9c /              ext4    defaults,noatime 0 1
UUID=965006b0-1683-4dd3-8e93-fd482161729d /home          ext4    defaults,noatime 0 2
UUID=94829c5d-b261-4d3d-87c5-0f25511c93e2 swap           swap    defaults,noatime 0 0

sorry , don’t know why half of it came in caps

You’re not really meant to post pictures, takes up too much space and isn’t searchable etc.

As a live USB seems to out of the question it’s probably best to update grub from endeavour and see if it can boot manjaro.

That doesn’t match the one in your picture, so I’m guessing it’s from endeavour.

1 Like

now you just need to find that partition.
lsblk -f
should help

Then you’d know where the efi directory was and will need to be again
in order to be able to restore Grub.

because you didn’t highlight it all
and then had it formatted as </>

so it looks like terminal output - just as you saw it

three backticks should also work
before and after …

Please at least try to format it properly.

sudo grub-mkconfig -o /boot/grub/grub.cfg
[sudo] password for parasetu: 
Generating grub configuration file ...
Found theme: /boot/grub/themes/EndeavourOS/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Found Ubuntu 20.04.1 LTS (20.04) on /dev/nvme0n1p5
Found Garuda Linux (Soaring) on /dev/sdb4
****Found Manjaro Linux (21.3.2) on /dev/sdb7****
Adding boot menu entry for UEFI Firmware Settings ...
done

it found manjaro , and sorry i know , my system looks trash with so many distros , i have thought of fixing it , but have some data on every distro :((

I think its sdb10 , since the one i had deleted or formatted was of 500mb as well

lsblk -f

NAME        FSTYPE FSVER LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                          
├─sda1                                                                                       
├─sda2      ntfs         Basic Softwares 0A241F40241F2E67                                    
├─sda3      ntfs         New Volume      A47C0DD47C0DA262                                    
└─sda4      ntfs         WD Recovered    9C30E37D30E35CB0                                    
sdb                                                                                          
├─sdb1      swap   1                     4ddeeafa-1e01-40b5-9acd-1964b5d7d904                
├─sdb2      ext4   1.0                   deaf8b37-bb62-4476-b25b-01cfa045338e                
├─sdb3      vfat   FAT32                 97D4-30D3                                           
├─sdb4      ext4   1.0                   427984c1-6f4d-4c2c-84da-d8455e70fd15                
├─sdb5      ext4   1.0                   965006b0-1683-4dd3-8e93-fd482161729d     46G    48% /home
├─sdb7      ext4   1.0                   411dc37c-e651-4220-b380-d3306c59e042                
├─sdb8      ext4   1.0                   30fde1a2-8594-4a14-86fa-6cdad59bc450                
├─sdb9      swap   1                     8eb80e10-0b17-4e68-8d79-e1c69a792054                
├─sdb10     vfat   FAT16                 E62F-7A17                                           
├─sdb11     swap   1                     94829c5d-b261-4d3d-87c5-0f25511c93e2                [SWAP]
├─sdb12     vfat   FAT32 NO_LABEL        3B51-861D                             987.5M     3% /boot/efi
└─sdb13     ext4   1.0                   c4596ece-df47-4850-b449-a3d299717e9c    256G    62% /
sdc                                                                                          
└─sdc1      ntfs         My Passport     8AB462C7B462B57B                                    
nvme0n1                                                                                      
├─nvme0n1p1 vfat   FAT32 ESP             ECD2-9948                                           
├─nvme0n1p2                                                                                  
├─nvme0n1p3 ntfs                         7442456342452B66                                    
├─nvme0n1p4 swap   1                     d324bf6e-b84b-4f82-8fa4-a90b4a84dd40                
├─nvme0n1p5 ext4   1.0                   3c057d72-e5fa-4534-a2b4-ff716922382e                
├─nvme0n1p6 ext4   1.0                   6b63debb-f5de-4218-8e24-27b1f0072975                
└─nvme0n1p7 ntfs         DELLSUPPORT     522074D82074C50F

there is no UUID

so:
it looks like you remover the whole partition - along with the efi directory

Try to remember what you did …

There is, but it’s for endeavour.

The UUID in the picture at the top doesn’t exist though.

man , it was a blunder , i don’t know how could i be so careless , i usually format from disk manager , this way i always get to know if i formatting the right device or not , but last night , idk what made me do it from file explorer

can it be repaired ? , because i miss the manjaro bootloader , all the other one’s are too flashy

yeah that’s what i was saying the UUID doesn’t match with any that’s getting listed :((

i tried to boot into manjaro , its stuck on the first image i shared

Ahh - 25E1-96DF

right …

perhaps deleted and recreated - and therefore now different … who knows :man_shrugging: