You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI: chroot command failed with error “chroot: failed to run command ‘/bin/bash’: No such file

edited Apr 1, 2023 6:29AM in Linux

Goal

When attempting to perform chroot the following error is shown

[root@test ]$ chroot /mnt/ /bin/bash
chroot: failed to run command ‘/bin/bash’: No such file or directory.
[root@test ]$ 

Cause

/bin/bash and required libraries are missing.

Solution

1) Confirm the bin and lib64 directories and basic files are available

[root@test ]$  ls -l /bin/bash                                                                                         
-rwxr-xr-x. 2 root root 964536 Nov 23  2021 /bin/bash                                                                            
[root@test ]$ ldd /bin/bash
 linux-vdso.so.1 => (0x00007ffe81f24000)
 libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f8145489000)
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f8145285000)
 libc.so.6 => /lib64/libc.so.6 (0x00007f8144eb7000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f81456b3000)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!