chroot: cannot execute /bin/sh: Exec format error
I took a dd image of a machine, restored it to a similar machine (the first was a Dell SC1425, the second a Dell PE1950), and am trying to get it to boot. I believe I need a new initrd But I cannot chroot into /mnt/sysimage from a 'linux rescue'... I get:
chroot: cannot execute /bin/sh: Exec format error I get this if I allow the rescue image to find and mount the volume, or if I do it myself. I tried: lvm vgchange -a y mkdir /mnt/sysimage mount /dev/mapper/VolGroup00-LogVol00 /mnt/sysimage mount /dev/sda1 /mnt/sysimage/boot mount -o bind /proc /mnt/sysimage/proc mount -o bind /dev /mnt/sysimage/dev mount -o bind /sys /mnt/sysimage/sys chroot /mnt/sysimage /bin/bash And I get the exec error again. On both systems, uname reports i686 How can I chroot in to fix the initrd? |
Before chroot'ing does /mnt/sysimage/bin exist? What are the permissions? Try running "chroot /mnt/sysimage" and then "/bin/bash -l".
|
Quote:
And "chroot /mnt/sysimage" gives me the Exec format error. And, yes, /bin/sh exists... it's a symlink to /usr/bin/sh which is a symlink to /usr/bin/bash |
Look at the permissions of the target /mnt/sysimage/bin/bash instead of the link itself. Also check the permissions of the /mnt/sysimage/ mounted directory and that it isn't mounted with the noexec option. Look at "ls -ld /mnt/sysimage/" and "mount". Try using the rescue disk for that version of Linux. An older kernel may not have full support for the ext3 version you boot with disabling some features. Also, check if tty on [ALT][F12] has the kernel messages displayed. They may provide more information on what when wrong from the kernel's perspective.
|
This may be helpful:
link |
first poster and perhaps still a newbie here,
just wanted to say thanks for this post. it helped me rescue my slackware install |
Exec format error
from Gentoo-wiki Forums: en.gentoo-wiki.com/wiki/Chroot_from_a_livecd
Quote:
|
Excelent. Thats exact my problem. Solved with proper 64 bits DVD.
Thanks |
Solved with 64-bit DVD.
Solved with 64-bit DVD.
thanks DaPh00z |
All times are GMT -5. The time now is 10:18 PM. |