Chroot: cannot execute /bin/sh: No such file or directory

Hi Expert,

I'm having grub problem here:

grub> root
(hd0,0): Filesystem type is ext2

grub> setup
Error 11 : Unrecognized Device String

I try install boot loader follow the instruction from 26.2. Booting into Rescue Mode

It says : select Continue, it attempts to mount your file system under the directory /mnt/sysimage/

But i got error :

sh-3.2# chroot /mnt/sysimage/
chroot: cannot execute /bin/sh: No such file or directory

sh-3.2# chroot /mnt/sysimage/ /bin/bash
chroot: cannot execute /bin/sh: No such file or directory

Anyone can help?
i attach some file result of

# fdisk -l
# fstab

Thanks

Hi,

If you check once your filesystem is mounted, does the binary /mnt/sysimage/bin/sh actually exist ? Or if it's a link, does it point to something else that exists ? If it does exist, then it could be that it actually depends on libraries that are missing. Either way, it may well be that you have more than Grub problems to worry about on this system, if /bin/sh or its dependencies are genuinely missing.

Hi drysdalk,

The filesystem mounted successfully. Seems like

is not exist :

sh-3.2# ls -ltr /mnt/sysimage/bin/sh
ls: /mnt/sysimage/bin/sh: No such file or directory

Hi,

That's not so good, then - if your shell is missing from /bin you'll have to fix that before you can do your chroot . Just be sure that it really is your root filesystem that's mounted - it looks like it is from your screenshot, certainly. Have a look manually at the contents of /mnt/sysimage/bin and /mnt/sysimage/lib at a minimum in case anything else important is missing.

Either way, if Bash (assuming Bash is your shell) is truly missing, you'll have to get any missing binaries and libraries from your OS installation media, and copy them in to place using the Live CD/USB environment you're using. Then, you might be able to do your chroot , if you're lucky.

What actually went wrong, out of interest ? What was it that happened to this system that left it in the state it's now in, do you know ?

Hi,

Thanks for the recommendation, i have no idea what cause the file missing could be accidentally deleted. But now the problem solved after reinstall the Linux

Thanks all..