Monday 18 March 2013

WTF : invalid arch independent ELF magic ?

As I booted my laptop today I got into grub rescue with this nasty error message : "invalid arch independent ELF magic". Everything was working fine so far so I assume 1 update blew up my grub :-(


Trying to fix that issue, I put Ubuntu Secure Remix on s USB stick so that I could use boot-repair (https://help.ubuntu.com/community/Boot-Repair) to repair grub.

When executing the commands recommended by boot-repair to remove grub, I then came into that issue : "files list file for package libdrm-intel1:amd64 is missing final newline". I could fix it using the python script here :

http://ubuntuforums.org/showthread.php?t=1319791

Then I hit another similar issue : "files list file for package `tango-icon-theme' contains empty filename"

Thanks to this thread http://ubuntuforums.org/showthread.php?t=2045017 I figured out that just apt-get install tango-icon-theme will do the trick.

Now I can effectively use boot-repair !
Take a deep breath, the fun is just about to start.

1) At my 1st attempt using boot-repair, it failed because of this error :
Reinstall the grub-efi linux of mapper/isw_bicccigiih_RAID0SYS6
mkdir: cannot create directory `/boot/efi/EFI/ubuntu': Input/output error
grub-install --efi-directory=/boot/efi --target=x86_64-efi : exit code of grub-install :1
 
BootInfo summary : http://paste.ubuntu.com/5621193/

2) At my 2nd attempt (I rebooted and forgot to add-apt-repository ppa:yannubuntu/boot-repair), I could successfully repair grub (!) :

BootInfo summary : http://paste.ubuntu.com/5621275/

But when I rebooted I ran into "file '/boot/grub/x86_64-efi/normal.mod' not found". I could then figure out that it was because I was not using the latest version of boot-repair thanks to this thread http://forum.ubuntu-fr.org/viewtopic.php?id=1148581 (in French)

3) After that I ran boot-repair another time and I'm still stuck with the same issue I had at step 1 ! :
mkdir: cannot create directory `/boot/efi/EFI/ubuntu': Input/output error

BootInfo summary : http://paste.ubuntu.com/5621363/

At this stage I figured out that I was just another one affected by this issue : https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1090829

4) Decided to run e2fsck -f -y -v /dev/mapper/isw_bicccigiih_RAID0SYS6 and after that boot-repair ended up by successfully reinstalling grub ! :

BootInfo summary : http://paste.ubuntu.com/5623554/ 

5) After reboot, I know have another issue in grub (come on...!):

error:invalid magic number
error:you need to load the kernel first

6) Ran boot-repair one more time. In the advanced options I checked "Reinstall latest kernel". At some point I had to manually remove /boot/mykernel with rm -rf or dpkg will complain that it cannot remove the directory or something similar.

Then boot-repair completed successfully ! (sigh)

BootInfo summary : http://paste.ubuntu.com/5624239/

Special thanks to YannBuntu for this great tool !

3 comments:

  1. Wow, this exact same thing happened to me on my UX51VZ with Ubuntu last week. I wonder if there is a bug with regards to the RAID? I just ended up reinstalling to avoid any lingering corruption.

    ReplyDelete
  2. Woke up to this issue once again today :( Definitely suspecting something funky with the softRAID interaction.

    It happened after the laptop self-powered off in Windows due to being low on battery. The last time this occurred, the laptop self-powered off in Linux due to low battery. Perhaps there is something occurring on the softraid side during low power events that the kernel raid driver isn't catching?

    I'm considering on breaking up the RAID for now :/

    ReplyDelete
  3. I think I noticed that also when it happened to me but didn't think it was related... since then it didn't happened to me again since I make sure to never run out of battery ;-)

    ReplyDelete