[SOLVED] invalid arch-independent ELF magic

celsoannes

New Member
Nov 27, 2023
3
1
1
After a power outage, Proxmox no longer boots up, it only displays this message:

Code:
error: invalid arch-independent ELF magic
grub rescue>

It's not a problem with the date and time
I've already checked, and it's correct. I'm running it on an HP ML310e Gen8, and this version doesn't support UEFI. Nevertheless, I double-checked the BIOS just to be sure.


I had Proxmox 8 installed. I tried using the image in the advanced options to recover the boot, but at the moment it starts the process, it freezes.
I tried using a live CD with Ubuntu to use boot-repair, but during the process, it says that I'm using a compatible BIOS and that I should enable UEFI for it to work.

I would be happy if someone knew what to do or had any tips on what to do.
 
I don't think I'll be able to get Proxmox up and running again, so I'm considering the option of reinstalling it.

If I install Proxmox on another hard drive, can I retrieve the VMs and Docker instances that were running on the non-starting hard drive?

Can someone point me to a tutorial on how to do this?
Or even guide me on how to retrieve the files that were running in that VM.
 
I managed to get the server up and running again.
I tried several things until I found the solution that made my machine work again.
Some of the commands came from the Proxmox wiki: Recover From Grub Failure

Boot Proxmox VE in debug mode, or the Ubuntu/Debian off the ISO. We do not want to install Ubuntu/Debian, just run it live off the ISO/DVD.

I used Debian 12 live.

First We need to activate LVM and mount the the root partition that is inside the LVM container.

  • sudo vgscan
  • sudo vgchange -ay
Mount all the filesystems that are already there so we can upgrade/install grub. Your paths may vary depending on your drive configuration.

  • sudo mkdir /media/RESCUE
  • sudo mount /dev/pve/root /media/RESCUE/
  • sudo mount /dev/sda1 /media/RESCUE/boot (This part gives an error. Ignore it)

Code:
user@debian:~$ sudo mount /dev/sda1 /media/RESCUE/boot
mount: /media/RESCUE/boot: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
  • sudo mount -t proc proc /media/RESCUE/proc
  • sudo mount -t sysfs sys /media/RESCUE/sys
  • sudo mount -o bind /dev /media/RESCUE/dev
  • sudo mount -o bind /run /media/RESCUE/run
Chroot into your proxmox install.

  • chroot /media/RESCUE
Then update grub and install it.
  • update-grub
  • grub-install /dev/sda
I am using an old second-hand machine, an HP ProLiant ML310e Gen8, which does not support UEFI, and that seems to be the entire reason for the problem. So, initially, I removed the scripts related to EFI.

Code:
sudo mv /etc/kernel/postinst.d/zz-proxmox-boot /etc/kernel/postinst.d/zz-proxmox-boot.backup

So, I ran the following commands:
  • update-initramfs -t -u (This one may trigger an alert, but you can proceed with the other commands.)
  • grub-mkdevicemap
  • grub-mkconfig
  • update-grub
  • grub-install /dev/sda

If there are no error messages, you should be able to reboot now.
 
  • Like
Reactions: Nebucade