New installation on new drive fails to create grub2 boot.

I have just completed a new installation of Leap 15.3 using network installation of full system with KDE desktop. The drive has been created on an hardware RAID array using 4 disks and set up as one drive.

At the end of the installation and just before the installation has been completed I get the following error, which I have had to type in because I cannot access the new system:-

Execution of command ""/usr/sbin/shim-install","--config-file=/boot/grub2/grub.cfg"]]" failed
Exit code 5
Error output: Installing for X86_64-efi platform
Installation finished No error reported
Could not prepare Boot variable: No space left on device

I thought this error had been the fault of earlier old rubbish on the drive which gave me the same error installing TW. It appears that the old rubbish was not the problem but something else. Since everything else is installed I think I should just rebuild grub but grateful for more help please before I mess up.

When the installation of Pop!_OS failed with boot loader errors, I booted the machine into USB Tumbleweed, chrooted to Pop!_OS and installed again grub. This procedure resulted in bootable Pop!_OS. The same procedure should work with Tumbleweed too.

It has nothing to do with HDD. efibootmgr fails to create/change EFI variable.

You may try to power off system, and actually unplug external power. It may result in firmware performing garbage collection and freeing space. For a long time I only could update grub immediately after boot - otherwise I got errors. Somehow it went away, I am not sure whether it is BIOS update or newer kernel.

If anything else fails you may try to boot with efi_no_storage_paranoia kernel option. It disables sanity checks Linux kernel does and just relies on firmware to perform correctly. Make sure you understand implications.

Garbage collection works fine most of the time. But even the extremely solid ASRock Z170 Pro4S exhibited shaky behavior since a few weeks. Deleting unused boots didn’t help either. However ‘loading optimized defaults’ fixed the problem. UEFI automatically created the boots from scratch:

**erlangen:~ #** efibootmgr -v|cut -c 1-120  
BootCurrent: 0006 
Timeout: 1 seconds 
BootOrder: 0006,0003,0007,0005,0004,0000,0001,0002,0017,0018 
Boot0000* manjaro       HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\MANJARO\GRUBX64.EFI) 
Boot0001* Windows Boot Manager  HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\MICROSOFT\BOOT\BOO 
Boot0002* arch  HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\ARCH\GRUBX64.EFI) 
Boot0003* tumbleweed-sdc7       HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\TUMBLEWEED-SDC7\GRUBX64 
Boot0004* sled  HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\SLED\GRUBX64.EFI) 
Boot0005* Fedora        HD(1,GPT,0497bfdf-73d7-47a8-9d8e-6b911574f774,0x800,0x32000)/File(\EFI\FEDORA\SHIMX64.EFI) 
Boot0006* tumbleweed-nvme0n1p3  HD(1,GPT,0497bfdf-73d7-47a8-9d8e-6b911574f774,0x800,0x32000)/File(\EFI\TUMBLEWEED-NVME0N1 
Boot0007* leap-15.3     HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\LEAP-15.3\GRUBX64.EFI) 
Boot0017* UEFI OS       HD(1,GPT,0497bfdf-73d7-47a8-9d8e-6b911574f774,0x800,0x32000)/File(\EFI\BOOT\BOOTX64.EFI)..BO 
Boot0018* ubuntu        HD(1,GPT,2fe6b58a-379a-4f6e-899b-8be22ef6e885,0x800,0x32800)/File(\EFI\UBUNTU\GRUBX64.EFI)..BO 
**erlangen:~ #**

Hi and thanks for the suggestions. The machine is a server so if I wish to do anything serious I must disconnect as the system manager keeps running and power supplies running.

I shall use a live distro and find out what I have on the drive.

BTW I understood the installation defaults would give me /boot, /home and swap. In fact all it gives me is a 500MB dos uefi-boot partition, one big partition and a swap partition. There are a handful of sub-partitons? but don’t know how these appear on live distro.

Will report back.

OK, I have a x86_64 distro of Antix base on CD which I can boot. What commands should I use to obtain the details of partitions etc.? Not familiar with using live distros and wish to get to installed system on CLI.

Meanwhile I already have a download of Leap 15.3 full iso on my laptop. Can I use USB stick to make a live distribution or installation USB? Must be a link somewhere will search.

In the end I tried Antix 19 and Rescatux to try and fix the boot process. Antix was able to detect that the boot/uefi partition was present but rebuilding the grub configuration was too much for me. Rescatux achieved part of the process but also failed on creating the grub files. In passing I noticed some security locking file in /sbin which didn’t mean much to me but after re ordering the boot order I then tried to boot from my hard drive. Not much happened for a bit and then the IBM server IMM system kicked in volunteering to restore something. All went very quickly but then up came the Leap 15.3 starting screen so I have solved my problem without really knowing what was going on. All I can think is that the firmware holds the key for the UEFI and this is what was restored into my system. I guess it is all there in the Red Book if you know where to look and have time to read 50,000 pages.

Obviously UEFI automatically cleaned up boot entries and created consistent ones.