Hello
I'm trying to install grub to a broken mbr. This is the part of my learning and the linux distro is CentOS 7 minimal running in virtualbox.
I want to try this in various ways.
First I booted from CentOS DVD's Rescue mode and installed mbr successfully by grub2-install command.
Then, I tried through SystemRescueCD. Installed GRUB perfectly. Following are the steps:
Code:
% mkdir linux
% vgchange -a y VolGroup
% mount /dev/mapper/VolGroup-root linux
% mount /dev/sda1 linux/boot
% mount -o bind /proc linux/proc
% mount -o bind /dev linux/dev
% mount -o bind /sys linux/sys
% chroot linux /bin/bash
# grub2-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported
However, when I tried this in Knoppix Rescue DVD, even though every step is exactly same, I'm getting error at chroot
Code:
# mkdir linux
# vgchange -a y VolGroup
# mount /dev/mapper/VolGroup-root linux
# mount /dev/sda1 linux/boot
# mount -o bind /proc linux/proc
# mount -o bind /dev linux/dev
# mount -o bind /sys linux/sys
# chroot linux /bin/bash
chroot: failed to run command `/bin/bash': Exec format error
# chroot linux /bin/sh
chroot: failed to run command `/bin/sh': Exec format error
# chroot linux
chroot: failed to run command `/bin/bash': Exec format error
What I'm doing wrong? Please help.
Thanks