whatis chroot

chroot

Also known as: change root, chroot jail

A command that runs a process with a different directory treated as /, used for system rescue and as an early form of isolation.

What Is chroot in Linux?

chroot /mnt bash starts a shell that sees /mnt as the root of the filesystem. The classic use is repairing an unbootable system from a live USB: mount the broken install, bind-mount /dev, /proc, and /sys, chroot in, and reinstall the bootloader or fix packages.

chroot only changes the filesystem view. It is not a security boundary on its own; namespaces and containers provide real isolation.

Example

sudo mount /dev/sda2 /mnt
sudo arch-chroot /mnt