chroot

Change the root directory for a process and its children.

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
findmnt -R /mntVerify the mounts of the target tree before chrooting.
What it does

chroot changes the apparent root directory for a process, isolating it from the rest of the filesystem. Used for system rescue (booting into a broken system's filesystem), building packages in clean environments, and as the foundation for containers.

Examples
mount /dev/sda1 /mnt && chroot /mnt /bin/bashChroot into a mounted system for rescue · explain & risk-check →
chroot /mnt /usr/bin/passwd rootReset root password on mounted system · explain & risk-check →
mount --bind /dev /mnt/dev && mount --bind /proc /mnt/proc && chroot /mntFull rescue chroot with devices and proc · explain & risk-check →
Pro tip

For a full rescue chroot, always bind-mount /dev, /proc, /sys, and /run before chrooting — without them, systemd, udev, and many tools will fail with cryptic errors.

Related
mount nsenter unshare
Open the full explainer →More in System & Processes

Reference text is hand-written and may be incomplete — check man chroot for your version. Test destructive commands on a non-production system first.