'\" t .\" Title: arch-chroot .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 1.5.8 .\" Date: 2019-01-11 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "ARCH\-CHROOT" "1" "2019-01-11" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" arch\-chroot \- script to mount API filesystems like /proc and make /etc/resolv.conf available in a chroot .SH "SYNOPSIS" .sp \fBarch\-chroot\fP [\fIoption\fP] \fIchroot\-dir\fP [\fIcommand\fP] .SH "OPTIONS" .sp \fB\-h\fP .RS 4 Print the help message .RE .sp \fB\-u\fP \fI[:group]\fP .RS 4 Specify non\-root user and optional group to use .RE .SH "DESCRIPTION" .sp Before \fBarch\-chroot\fP runs \fB/usr/bin/chroot\fP, the script mounts API filesystems like \fI/proc\fP and makes \fI/etc/resolv.conf\fP available in a chroot. .sp The Debian version of this script also sets up \fI/usr/sbin/policy\-rc.d\fP to disable autostart of daemons. .sp If \fIcommand\fP is unspecified, arch\-chroot will launch \fB/bin/bash\fP. .sp Note that when using arch\-chroot, the target chroot directory \fBshould\fP be a mountpoint. This ensures that tools such as findmnt(8) have an accurate hierarchy of the mounted filesystems within the chroot. .sp If your chroot target is not a mountpoint, you can bind mount the directory on itself to make it a mountpoint, i.e. \fImount \-\-bind /your/chroot /your/chroot\fP. .SH "EXAMPLES" .SS "Enter a chroot" .sp Run arch\-chroot with the new root directory as first argument: .sp .if n .RS 4 .nf arch\-chroot /location/of/new/root .fi .if n .RE .sp To exit the chroot simply use: .sp .if n .RS 4 .nf exit .fi .if n .RE .SS "Run a single command and exit" .sp To run a command in the chroot and exit again, append the command to the end of the line: .sp .if n .RS 4 .nf arch\-chroot /location/of/new/root command .fi .if n .RE .sp For example, to run \fBdpkg\-configure \-a\fP for a chroot located at \fI/media/testing\fP do: .sp .if n .RS 4 .nf arch\-chroot /media/testing dpkg\-configure \-a .fi .if n .RE