I screwed up my hard drive and I need help

I’ve been working with manjaro for a good period of time untill yesterday where I had a rush of confidence so I opened Kde partition manager and started deleting windows partions ( and with all the cursed little partitions windows create ) I didn’t thought about it until efi partition is gone and an ugly bios windows ask where to boot: pci lan, manjaro, windows bootmanager, ata HDD, and weirdly enough Ubuntu (which I deleted a while ago, but that’s for another thread ). all of them make a black screen for 2 sec and return to the ugly bios window. Ok, I took my flash drive downloaded manjaro iso and an android app to burn the image, plugged it in laptop, open kde partioner in the live session created a 260mb partiton, and added the boot flag, and the bios flag, but I noticed they’re conflicting and I can only choose one, tested with both of them but no response. So I open terminal in the live sess. mounted the partition in /mnt and typed ‘parted’ then ‘(parted) set 1 esp on’, reboot still nothing.

can you guys help me with this ?

For the efi partition you need the boot flag and it is advisable also to set the esp flag, nothing else. The partition should be formatted in FAT32.

Then restore the bootloader:
https://wiki.manjaro.org/index.php?title=GRUB/Restore_the_GRUB_Bootloader

If everything is fixed you still need to identify the new efi partition as the one to be booted from by entering your UEFI firmware. There you can set it as primary boot partition.

boot on USB iso manjaro
open a terminal

inxi -Mxa
sudo parted -l
sudo efibootmgr -v
sudo lsblk -fs
test -d /sys/firmware/efi && echo efi || echo bios

fisrt chroot to check /etc/fstab

sudo manjaro-chroot -a ( type 1 if olnt one line 0 appears )
nano /etc/fstab ( check UUID for /boot/efi , save Ctrl+x )
exit ( quit chroot )

then 2nd chroot ( you need /boot/efi ok this time )

sudo manjaro-chroot -a ( type 1 if only one line 0 appears )
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose 
efibootmgr -v
exit ( quit chroot )

Amazing but :smiley: reading over this solution, as a Win user who has just switched to Linux I am now running out of this World and I do not even dare to look back! :smiley: :smiley:
I think I would rather just boot up a LIVE Linux installer and use its built in recovery opption (if there is) or as I did last week I would just run some “install grub” command from a LIVE Linux usb.

I also deleted the EFI boot partition and a few others on my dual boot Win+Linux drive last week, same as the poster and all I did was boot a LIVE USB and grub install command or so. Worked. My OS booted again.

well, the fat32 partition was already there with boot flag and esp flag set up using parted tool. So I went over the link you gave, everything was good (except the pacman -syyu that failed because systemd-resolved wasn’t active, and could get it to work webause of chroot :man_shrugging:t4: ) so I skipped it because I just did a -syu anyway.

after finishing I did a shutdown now, and I got :

[***]a stop job is running for CUPS scheduer (3s/1min36s)

after it finished a million line of errors was thrown to me with :

squashfs error failed to read block …

…aaand I got a tty screen

should I redo all of this ?

It would be very nice if you could explain what you did here exactly. General recommendation is to note or remember the steps you are doing to see where it went in the wrong direction as your result is a bit weird. Thanks! :wink:

One point is indeed missing which is the adjustment of your /boot/efi entry in your /etc/fstab file. As you created a new partition the new UUID must be used in the corresponding etc/fstab entry for the /boot/efi partition. Best done when in chroot.

I did everything in the link you shared, with no error or anything wrong. I only skipped the database update part, there was some dns resolving issue, and I thought it’s fine because I did refresh pacman’s DB just lately.

but it seems the partition isn’t working like it have to, I’ll redo the work.
can you recommend a good way to set the flags ( boot and esp), I do the first in gui and the second in parted cli

Only the boot flag is really needed.

If you used

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck

to install the boot loader I guess you should be fine with the content of the /boot/efi partition.

Please, use the live iso to boot again, then open a terminal window and enter

sudo blkid

to readout the UUID of your /boot/efi partition and

chroot again using

sudo manjaro-chroot -a

to edit your /etc/fstab by

nano /etc/fstab

There change the UUID-entry for the /boot/efi partition.

Afterwards save the file and exit.

Wait for further advice.

If anything unclear - let us know!

alright I changed the uuid and everything is good now, thank you @wollie and @stephane for your assistance.

1 Like

Glad to hear that! :grin:

1 Like

that why i have give you the soluce with 2 steps

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.