2

I'm trying to repair my GRUB after Windows 7 installation.

I have 64bit and 32bit live Ubuntu CDs + Super Grub Disk (Rescatux) + Boot-Repair-Disk . I'm following this answer's steps . But in 6th step I'm getting

/usr/sbin/grub-probe: error while loading shared libraries: libdevmapper.so.1.02.1: wrong ELF class: ELFCLASS32 after executing update-grubcommand.

And then I tried to use Boot-Repair . Firstly tried Recommended repair and it's finished successfully but when I restart there isn't boot menu. And then next time I hold Left Shift while booting. Still it's booting Windows automatically.

And then I tried to use Advanced repair . Same results. This is my Boot-Repair logs : http://paste.ubuntu.com/936178/

I need specific answers for my system. Thank you.

Note :

My installed Ubuntu system is 64 bit and I have 64bit and 32 bit Live CDs

Note 2

(after booting with a 32bit Live CD) (look at Note 3 for 64bit Live CD results)

file /lib/libdevmapper.so.1.02.1 -> /lib/libdevmapper.so.1.02.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

file /usr/sbin/grub-probe -> /usr/sbin/grub-probe: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

ubuntu@ubuntu:~$ sudo mkdir /mnt/ubusda3
ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sda3 /mnt/ubusda3
ubuntu@ubuntu:~$ file /mnt/ubusda3/sbin/init
/mnt/ubusda3/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

Note 3

(after booting with a 64bit Live CD)

file /lib/libdevmapper.so.1.02.1 -> /lib/libdevmapper.so.1.02.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

file /usr/sbin/grub-probe -> /usr/sbin/grub-probe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# mkdir /mnt/ubusda3
root@ubuntu:/home/ubuntu# mount -t ext4 /dev/sda3 /mnt/ubusda3
root@ubuntu:/home/ubuntu# file /mnt/ubusda3/sbin/init
/mnt/ubusda3/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
root@ubuntu:/home/ubuntu# file /mnt/ubusda3/lib/libdevmapper.so.1.02.1
/mnt/ubusda3/lib/libdevmapper.so.1.02.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
Eray
  • 1,820

2 Answers2

2

Drat!

I finally got a multi-boot of versions of Ubuntu and a Windows 7 install working in a VirtualBox Virtual Machine so I could experiment with the repair tools. It turns out my original suggestion was wrong and did not work as I thought it would. :-(

So ... starting over ...

While I intend to experiment more with a VM to learn more about the various tools such as the Boot-Repair tool or using a Live CD and chroot and to reinstall GRUB, I figured the most expedient thing I could offer now would be to sketch out one way to allow booting from Windows into the GRUB menu.

I am not suggesting this as "the" final solution. But it should at least enable booting up the Ubuntu partition again which also, I think, opens up other repair options.

Also, having tried it on the VM, I have some confidence that this should work. (Mentally crossing fingers here ...)

Using EasyBCD 2.1.2 to Boot to GRUB from Windows Boot Menu

  1. Start up Windows. Then open the EasyBCD 2.1.2 page in a browser and use the Download free for limited, non-commercial use link to download and install EasyBCD.
    Note: This link is underneath the Buy Now button towards the bottom of the page.
    While they prompt for a name & email, you are not required to enter them to do the download.
  2. Open the EasyBCD program and select Add New Entry from the sidebar on the left.
  3. Select the rightmost tab, NeoGrub, under "Operating Systems" and click the Install button.
    Note: This adds the NeoGrub bootloader code to your C:\ directory.
    You should see the file NeoGrub and the directory NST in C:\ if the install worked correctly.
  4. Select the Linux/BSD tab. Choose the type of GRUB your install uses (e.g. GRUB 2) and, optionally, edit the name of the entry you are about to add to the Windows Boot menu.
  5. Click the Add Entry button to add an entry to boot Linux (GRUB menu) to the Windows boot menu.
  6. Select Edit Boot Menu from the sidebar to review your changes.
    Note: You can delete the entry for NeoGrub Bootloader if you wish.
    It was added when you installed the NeoGrub Bootloader in step (3). You need the bootloader but you do not need a boot menu entry for it. You only need the entry added in step (5).
  7. Save your changes and reboot. When the Windows boot menu appears, select the entry you added to boot Linux. After a slight delay the GNU GRUB boot menu should appear.
  • thanks for your answer ! What do you mean with Boot-Repair-Disk? Is it this : http://ubuntuforums.org/showthread.php?t=1831869 ? – Eray Apr 19 '12 at 04:17
  • i just tried http://www.supergrubdisk.org/ but in Order Hard Disks screen there is no harddisk. So i got errors. I will try Boot-Repair-Disk now. – Eray Apr 19 '12 at 04:41
  • i tried it. But after choosing Ubuntu, when i restart my PC i got Operation System Not Found error . – Eray Apr 19 '12 at 11:27
  • just tried it. It booting Windows 7 automatically. There is no boot menu, again. http://paste.ubuntu.com/936782/ – Eray Apr 19 '12 at 11:47
  • for your update : i'm getting this error : /usr/sbin/grub-probe: error while loading shared libraries: libdevmapper.so.1.02.1: wrong ELF class: ELFCLASS32 after update-grub – Eray Apr 19 '12 at 17:52
  • i tried with internet connection. Nothing changed. – Eray Apr 19 '12 at 18:15
  • i'm getting this error while booting Boot-Repair-Cd . What's it's mean ? http://www.iimmgg.com/image/f228dbc5fff20a797d45c30983c9eb3d – Eray Apr 19 '12 at 22:29
1

Boot into the live CD and try these commands (only if you already have Ubuntu installed). This is for Grub2.

You will need to find your partition with ubuntu on it and replace /dev/sdAX. This can be done with the following command sudo fdisk -l - and then choose the partition 'Linux'

sudo su
mkdir /mnt/root
mount -t ext4 /dev/sdAX /mnt/root
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
mount -o bind /sys /mnt/root/sys
chroot /mnt/root /bin/bash
sudo grub-install /dev/sda
sudo update-grub
wjandrea
  • 14,236
  • 4
  • 48
  • 98
A. Hayes
  • 63
  • 3
  • Hayes, i'm getting command not found for install-grub and install_device not specified for grub-install. – Eray Apr 19 '12 at 00:19
  • Sorry, definitely use grub-install. I don't know which of the following it is exactly but you can try 'hd0', '/dev/sda' or some other name of your hard drive. I would start with hd0 - I think that's what I've done on my machine. That would make final syntax 'sudo grub-install hd0'. Easy. – A. Hayes Apr 19 '12 at 23:47