No bootable device (I made a big mistake)

Hi everyone,

So today I made a big fool of myself.

I was trying to solve this problem : How to make Proton work on my external drive?

Which, on Reddit, ended up with the solution to make my secondary drive an ext4 instead of a ntfs3.
So I tried using Gparted to formate the disk, thinking it would be fine since this was a secondary drive. I had two partition, the one in which I assumed the distro was installed and the secondary one which I formated.

When I restarted my computer, I was met with the fatal message “no bootable device”. So it seems I fucked up big time.

Is there any way I can clean the stupid mess I made ? Or should I simply install a fresh installation ?

Thank you guys

Edit : So I notice I can still access every file from booting from the USB I used to install, is there any information I can add from there ?

To begin with, the output of the following commands will give some info about your setup:

sudo parted -l
efibootmgr
1 Like

Ok ! Thank you !

[liveuser@eos-2022.12.17 ~]$ sudo parted -l
Model: ATA HFS256G39TND-N21 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name         Flags
 1      2097kB  1051MB  1049MB  ext4                      boot, esp
 2      1051MB  256GB   255GB   ext4         endeavouros


Model: ATA ST1000LM035-1RK1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  1000GB  1000GB  ntfs         Basic data partition  msftdata


Model:   (scsi)
Disk /dev/sdc: 15.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.5GB  15.5GB  primary  fat32        boot, lba


Model: Seagate Expansion (scsi)
Disk /dev/sdd: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.8kB  1000GB  1000GB  primary  ntfs         boot
[liveuser@eos-2022.12.17 ~]$ efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0000* USB HDD: Generic USB Storage	PciRoot(0x0)/Pci(0x14,0x0)/USB(21,0)/HD(1,MBR,0x9d98e8,0x800,0x1ce7800)RC
Boot0002* Network Boot-IPV6: 30-65-EC-BB-0C-33	PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(3065ecbb0c33,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0004* Linux Boot Manager	HD(1,GPT,a2a386f9-bc54-5f42-9be4-dfd78f4a9f87,0x1000,0x1f4000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC
1 Like

doesn’t show up in:

So perhaps you could set a new bootorder:

sudo efibootmgr --bootorder 0004,2001,2002,2003

Reboot and see if you could boot into your system.

There is however some confusing info in:

While your ESP has the right size and right flags for systemd-boot, it doesn’t have the right format. It should be FAT32. Not sure if this could also be part of the issue.

1 Like

Thank you again !

And yes, I think it is a problem indeed since your first solution didn’t solve the problem.

Could I resize the partition and make a partition just for the purpose of booting ? (I’m really not aware if that’s a stupid question or not, I’m so sorry).

Here’s what gparted is showing me


If I understand well, I formatted sda1 from nfts to ext4 (because I needed that space in ext4 due to a Proton issue). Not realizing (even if it was right before my eyes) that it was used for booting.

Given the rest of your system is intact, we could try to rebuild your ESP from scratch and see if it would resolve the issue.

You could try the following steps:

  1. in the live session, launch Gparted and format your current ESP (/dev/sda1) as FAT32 and set boot,esp flags on it.

  2. then in a terminal run the following commands:

    sudo mount /dev/sda2 /mnt
    sudo mount /dev/sda1 /mnt/efi
  1. sudo mv /mnt/etc/fstab /mnt/etc/fstab.old

  2. sudo genfstab -U /mnt >> /mnt/etc/fstab

  3. sudo arch-chroot /mnt

  4. bootctl install

  5. reinstall-kernels

If you get any error message at any of the steps above, please stop and post the whole output of the terminal.

If everything has been fine, then type exit followed by enter to quit chroot.

Reboot and test.

1 Like

Again thank you so much for your answers !

Everything is fine until step 4 where I get a denied permission.


[liveuser@eos-2022.12.17 ~]$ sudo genfstab -U /mnt >> /mnt/etc/fstab
bash: /mnt/etc/fstab: Permission denied


Now, since I booted from the USB, this is not my normal password. Is there a generic password when you use a temporary session like this ?
Nevermind, I simply used “sudo -i”

There is just this thing that frigthen me a bit


`sudo arch-chroot /mnt
[root@EndeavourOS /]# 

bootctl install
Created "/efi/EFI".
Created "/efi/EFI/systemd".
Created "/efi/EFI/BOOT".
Created "/efi/loader".
Created "/efi/loader/entries".
Created "/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
⚠️ Mount point '/efi' which backs the random seed file is world accessible, which is a security hole! ⚠️
⚠️ Random seed file '/efi/loader/.#bootctlrandom-seed32f862dc39ef4e35' is world accessible, which is a security hole! ⚠️
Random seed file /efi/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".
[root@EndeavourOS /]#

`

Not sure why it is not working.

We could work around it. Go ahead with the step 5.

While in chroot, before step 6, rename fstab.old to fstab again:

mv /etc/fstab.old /etc/fstab

Now find out the UUID for your new ESP. You could use lsblk -f for that.

Edit /etc/fstab and change the UUID for ESP to match the new one:

nano /etc/fstab

When you are done editing, press Ctrl-o, enter and Ctrl-x to save the file and quit nano.

Now go ahead with the step 6 and 7 above.

If anything is unclear, please ask.

You don’t need a password in the live session.

1 Like

It worked like a charm !

Again thank you so much, your instructions were very precise and clear. :pray:

1 Like

That’s Great!
I am glad that I could be of any help and that you got your system back up and running!

2 Likes

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