Installation Failed: Bootloader could not be installed

Hey there, I’m want to make the transition to the Archlinux experience. But still kind of new to Linux. I’m having trouble with the installation process, specifically on the bootloader installation (grub). I was wondering if someone could shed me some light on my problem, because I really want to try arch and EOS.

These are some commands that are usually asked for when posting on this forum :slight_smile:
inxi -Fxxc0z --no-host | eos-sendlog

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3471    0    24  100  3447     38   5577 --:--:-- --:--:-- --:--:--  5616
https://clbin.com/4GTUr

A copy paste I made on the install log where I think the error could be:

Starting job "bootloader" ( 34 / 39 ) 
10:44:26 [6]: virtual Calamares::JobResult Calamares::PythonJob::exec()
    Job file "/usr/lib/calamares/modules/bootloader/main.py" 
10:44:26 [6]: boost::python::api::object CalamaresPython::gettext_path()
    Determining gettext path from ("/root", "/usr/bin", "/usr/share/locale") 
    ..  Found "en_US" in "/usr/share/locale/en_US" 
    ..  Job description from pretty_name "bootloader" = "Install bootloader." 
[PYTHON JOB]: "Bootloader: grub (efi)" 
10:44:26 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
    Running "chroot" ("/tmp/calamares-root-ao8sybip", "grub-install", "--target=x86_64-efi", "--efi-directory=/boot/efi", "--bootloader-id=EndeavourOS", "--force") 
10:44:30 [6]: QML Component (default slideshow) Next slide
    ..  Target cmd: ("grub-install", "--target=x86_64-efi", "--efi-directory=/boot/efi", "--bootloader-id=EndeavourOS", "--force") Exit code: 1 output:
 Installing for x86_64-efi platform.
Could not prepare Boot variable: Input/output error
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
WARNING: [PYTHON JOB]: "Command 'grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --force' returned non-zero exit status 1." 
[PYTHON JOB]: "stdout:Installing for x86_64-efi platform.\nCould not prepare Boot variable: Input/output error\ngrub-install: error: efibootmgr failed to register the boot entry: Input/output error." 
[PYTHON JOB]: "stderr:None" 

I hope this has a solution. If any extra information is needed please let me know and I’ll try to answer ASAP.

How did you set up the partitions? Manually or erase disk?

I had a partition with Kubuntu 18.04 and another with Manjaro. I installed EOS alongside Kubuntu replacing Manjaro install.

Please post the output of the following commands:

test -d /sys/firmware/efi && echo UEFI || echo BIOS

sudo parted -l

efibootmgr -v

Sure, here is the output of the commands ran on the EOS live usb

test -d /sys/firmware/efi && echo UEFI || echo BIOS

UEFI

sudo parted -l

Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  538MB  537MB  fat32        EFI System Partition  boot, esp
 2      538MB   250GB  250GB  ext4         Kubuntu
 3      250GB   360GB  110GB  ext4         root


Model: Generic Flash Disk (scsi)
Disk /dev/sdb: 7990MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name       Flags
 1      32.8kB  1963MB  1963MB               ISO9660    hidden
 2      1963MB  2066MB  103MB   fat16        Appended2  boot, esp
 3      2066MB  2066MB  307kB                Gap1       hidden, msftdata

efibootmgr -v

BootCurrent: 0005
Timeout: 2 seconds
BootOrder: 2003,2001
Boot0000* ubuntu	HD(1,GPT,5bd5d652-b9af-46ec-97f3-0b4b8f104979,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* UEFI: IP6 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0002* UEFI: IP4 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0004* UEFI: IP4 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005* UEFI: Generic Flash Disk 8.07	PciRoot(0x0)/Pci(0x14,0x0)/USB(2,0)/USB(2,0)/HD(2,GPT,31323032-3830-4632-b232-303331313431,0x3a80bc,0x31000)..BO
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

I cannot see anything “off” in the output you have posted. Since the boot loader gets installed at the last stage of the installation, I would assume that the system is already installed correctly. If my assumption is correct, you could try arch-chrooting into the system and try to (re-)install the bootloader.

In the Live USB, open a terminal:

sudo su

mount /dev/sda3 /mnt      ## /dev/sda3 is where you installed EnOS, right? 

mount /dev/sda1 /mnt/boot/efi  

arch-chroot /mnt

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --force

Edit- correction of some typo

Almost there I guess.

The first command above ran without problems. But for “mount dev/sda1 /mnt/boot/efi.” the output is the following

mount: /mnt/boot/efi: special device dev/sda1 does not exist.

Would try to run the other commands but I’d rather wait to see if there is a solution.

Btw these are is the output for the “lsblk” command

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0   1.7G  1 loop /run/archiso/airootfs
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part 
├─sda2   8:2    0 232.6G  0 part 
└─sda3   8:3    0 102.4G  0 part /mnt
sdb      8:16   1   7.4G  0 disk 
├─sdb1   8:17   1   1.8G  0 part /run/archiso/bootmnt
├─sdb2   8:18   1    98M  0 part 
└─sdb3   8:19   1   300K  0 part 
sr0     11:0    1  1024M  0 rom  

Should be /dev/sda1. You dropped the first /.

No space left on device

?

1 Like

my bad :sweat_smile: That was the error, but not quite there yet.

The last command grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --force

Had this output. The one from the installation log posted earlier

Installing for x86_64-efi platform.
Could not prepare Boot variable: Input/output error
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.

Could you please ellaborate more on that? I still have around 100gb of unallocated space in a third partition.

Follow @joekamprad lead.

Already in chroot, navigate to /boot/efi and remove everything except your (k)ubuntu folder.

Execute the grub-install command again. If that won’t work, try the following:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --no-nvram --force

Or:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --no-nvram --removable --force

it can not write the boot files because it could be the ESP (fat32 efi partition) is full … or it is not writable cause of another reason

Deleted several folders (“BOOT”, “EndeavourOS”, and “Manjaro” ) but not Ubuntu.

Then grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS --no-nvram --force

and output was

Installing for x86_64-efi platform.
Installation finished. No error reported.

What is next? Should I reboot now?

1 Like

Sounds promising!

Check efibootmgr -v again.

If you have an entry for EndeavourOS then:

Type exit to get out of the chroot and reboot.

Won’t need to update grub first?

1 Like

Did ls on that same boot/efi directory and EOS appeared alongside Ubuntu.

Checking efibootmgr -v:

[root@EndeavourOS EFI]# efibootmgr -v
BootCurrent: 0005
Timeout: 2 seconds
BootOrder: 2003,2001
Boot0000* ubuntu	HD(1,GPT,5bd5d652-b9af-46ec-97f3-0b4b8f104979,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* UEFI: IP6 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0002* UEFI: IP4 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0004* UEFI: IP4 Realtek PCIe FE Family Controller	PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)/MAC(d897ba884061,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005* UEFI: Generic Flash Disk 8.07	PciRoot(0x0)/Pci(0x14,0x0)/USB(2,0)/USB(2,0)/HD(2,GPT,31323032-3830-4632-b232-303331313431,0x3a80bc,0x31000)..BO
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

will do. Good idea.

This doesn’t look as it should. No efi boot entry for EndeavourOS :thinking:

Your boot order is bootting network and then usb. EndeavourOS isn’t listed. Yet! :wink:

Edit: Did you try

sudo grub-mkconfig -o /boot/grub/grub.cfg