chroot /mnt/rootfs /bin/bash

Category: Administration

chroot /mnt/rootfs /bin/bash

Start a shell inside a different root

Runs /bin/bash with /mnt/rootfs as its root directory, so the shell sees that directory tree as the root filesystem. This is the standard way to repair a system from a live environment, since you can run its tools and edit its files. The chroot needs its libraries and binaries present inside the target root.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.