I am trying to reset my root password for my dedicated CentOS 7 server and keep getting the error below
chroot: failed to run command ‘/bin/bash’: No such file or directory
I am logged in through "rescue mode" which allows me to reset to password if I forgot it or make any other necessary changes.
I mounted the partition with:
# mount /dev/md127 /mnt/
But when I try to chroot I get the error that bash does not exist even though it does exist as you can see here:
root@rescue:~# chroot /mnt/
chroot: failed to run command ‘/bin/bash’: No such file or directory
root@rescue:~# ls /bin/bash
/bin/bash
root@Rescue:~#
chroot? – Time4Tea Apr 30 '20 at 13:13mount -o remount,rw /sysrootand thenchroot /sysrootit should work. – binarysta Apr 30 '20 at 13:17/sysrootwith read/write option. exactly as I have written. – binarysta Apr 30 '20 at 13:29/bin/bashis the path tobashin the chroot, not outside of the chroot. If the chroot is/mnt, then this means/mnt/bin/bash. – Kusalananda Apr 30 '20 at 14:17ls /mnt. Since you've said that/mnt/bin/bashis missing I'm not at all convinced you've mounted the root filesystem there. – Chris Davies Apr 30 '20 at 14:21