Debian GRUB rescue - "invalid arch independent ELF magic" -


i have dual-booted windows pc debian wheezy. installation went fine no errors, when boot debian greeted grub rescue:

welcome grub!  error: unknown filesystem. entering rescue mode... 

after examining further using set command notice booting wrong partition:

grub rescue> set prefix=(hd0,gpt4)/boot/grub root=hd0,gpt4 

here pointing (hd0,gpt4) when location debian installed (hd0,gpt5). so, did quick fix using set change variables should be:

grub rescue> set prefix=(hd0,gpt5)/boot/grub grub rescue> set root=gd0,gpt5 

after doing this, did remembered should boot os , ran:

grub rescue> insmod normal 

this things start go wrong error:

error: invalid arch independent elf magic. 

i did research on problem , seemed common solution reinstall grub live cd. so, booted live cd of debian , ran following:

sudo mount /dev/sda5 /mnt sudo grub-install --root-directory=/mnt /dev/sda 

where given error:

the file /mnt/boot/grub/stage1 not read correctly. 

although can assure file exist , editable edit

sudo nano /mnt/boot/grub/stage1 

so problem?

whilst installing grub-efi fixed things on system (because supports both traditional bios boot process, efi booting), if wanted fix original grub install, answer possibly:

apt-get install --reinstall grub-pc-bin grub-pc

followed by:

grub-install /dev/sdx

where /dev/sdx should replaced boot drive (or drives).

... replace looks corrupted versions of grub binaries (which "invalid arch independent elf magic" means) on boot drive.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -