Change root

From NixOS Wiki
Revision as of 11:40, 5 April 2018 by imported>Mic92 (example for nixos-enter)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Chroot is an operation that changes the apparent root directory for the current running process and their children. A program that is run in such a modified environment cannot access files and commands outside that environmental directory tree. This modified environment is called a chroot jail.

Usage

nixos-enter allows to access a nixos installation from a rescue system.

Using nixos-enter

The nixos-enter program is part of nixos. Before it runs provides a shell, the script mounts api filesystems like /proc and setups the profile and /etc of the target system. To use it, setup /mnt as described in the installation manual.

Then run nixos-enter:

$ nixos-enter