If recovering a Linux partition using Acronis software, its UUID changes, which will cause GRUB 2 to fail to boot the OS with an error, for example:
Error: invalid arch independent ELF magic
In such cases, one needs to reinstall GRUB 2:
- Boot the Live CD, for example, Ubuntu Live CD;
- From the Desktop, open a terminal: Applications -> Accessories -> Terminal;
- Determine your normal system partition:
- sudo fdisk -l (That is a lowercase L)
- If you aren't sure, run the following command and look for the correct disk size and ext3 or ext4 format:
- Mount your normal system partition:
- sudo mount /dev/sdXY /mnt
- If you aren't sure if you mounted the correct partition, once it's mounted run the following command to inspect the partition:
- ls /mnt
- If it is the correct partition, you should see the normal Linux folders such as /bin, /boot, /etc, /home, etc
- sudo mount /dev/sda1 /mnt
- Note: the partition to mount is normally the partition on which Linux was installed: sda1, sdb5, etc. If you have a separate /boot partition, use the device on which the /boot partition is located. Grub 2 works best when installed in the MBR of the drive to which BIOS boots. Also remember that you mount the partition (including the number) in this step, but you do not include the partition number when you run the "sudo grub-install" command later. GRUB 2 counts the first drive (X) as "0", but the first partition (Y) as "1".
- Only if you have a separate boot partition:
- sudo mount /dev/sdXY /mnt/boot
- with sdXY being your /boot partition designation.
- Reinstall GRUB 2:
- sudo grub-install --root-directory=/mnt /dev/sdX
- Do NOT include the partition number.
- sudo grub-install --root-directory=/mnt /dev/sda
- Note: Substitute the device on which Ubuntu was installed - sda, sdb, etc. Do not specify a partition number.
- Unmount the partition:
- If you mounted a separate /boot partition, unmount it first: