LinuxCommandLibrary

arch-chroot

Enhanced `chroot` command to help in the Arch Linux installation process.

TLDR

Start an interactive shell (bash, by default) in a new root directory

$ arch-chroot [path/to/new/root]
copy


Specify the user (other than the current user) to run the shell as
$ arch-chroot -u [user] [path/to/new/root]
copy


Run a custom command (instead of the default bash) in the new root directory
$ arch-chroot [path/to/new/root] [command] [command_arguments]
copy


Specify the shell, other than the default bash (in this case, the zsh package should have been installed in the target system)
$ arch-chroot [path/to/new/root] [zsh]
copy

SYNOPSIS

arch-chroot [options] chroot-dir [command]

DESCRIPTION

arch-chroot wraps the chroot(1) command while ensuring that important functionality is available, e.g. mounting /dev/, /proc and other API filesystems, or exposing resolv.conf(5) to the chroot.

If command is unspecified, arch-chroot will launch /bin/bash.


Note


The target chroot-dir should be a mountpoint. This ensures that tools such as pacman(8) or findmnt(8) have an accurate hierarchy of the mounted filesystems within the chroot. If your chroot target is not a mountpoint, you can bind mount the directory on itself to make it a mountpoint, i.e.:

mount --bind /your/chroot /your/chroot

OPTIONS

-u <user>[:group]

Specify non-root user and optional group to use.

-h

Output syntax and command line options.

BUGS

Bugs can be reported on the bug tracker https://bugs.archlinux.org in the Arch Linux category and title prefixed with [arch-install-scripts] or via arch-projects@archlinux.org.

AUTHORS

Maintainers:

·

Dave Reisner <dreisner@archlinux.org>

·

Eli Schwartz <eschwartz@archlinux.org>

For additional contributors, use git shortlog -s on the arch-install-scripts.git repository.

SEE ALSO

pacman(1)

Copied to clipboard