3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
[unleashed.git] / usr / src / man / man1m / chroot.1m
blob85f46d15a7acb92850e88d4a016d7f0d18ee8bc2
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH CHROOT 1M "Dec 15, 2003"
8 .SH NAME
9 chroot \- change root directory for a command
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/chroot\fR \fInewroot\fR \fIcommand\fR
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 The \fBchroot\fR utility causes \fIcommand\fR to be executed relative to
20 \fInewroot\fR. The meaning of any initial slashes (\fB\|/\|\fR) in the path
21 names is changed to \fInewroot\fR for \fIcommand\fR and any of its child
22 processes. Upon execution, the initial working directory is \fInewroot\fR.
23 .sp
24 .LP
25 Notice that redirecting the output of \fIcommand\fR to a file,
26 .sp
27 .in +2
28 .nf
29 chroot\fI newroot \|command\fR >\fBx\fR
30 .fi
31 .in -2
32 .sp
34 .sp
35 .LP
36 will create the file \fBx\fR relative to the original root of \fIcommand\fR,
37 not the new one.
38 .sp
39 .LP
40 The new root path name is always relative to the current root. Even if a
41 \fBchroot\fR is currently in effect, the \fInewroot\fR argument is relative to
42 the current root of the running process.
43 .sp
44 .LP
45 This command can be run only by the super-user.
46 .SH RETURN VALUES
47 .sp
48 .LP
49 The exit status of \fBchroot\fR is the return value of \fIcommand\fR.
50 .SH EXAMPLES
51 .LP
52 \fBExample 1 \fRUsing the \fBchroot\fR Utility
53 .sp
54 .LP
55 The \fBchroot\fR utility provides an easy way to extract \fBtar\fR files (see
56 \fBtar\fR(1)) written with absolute filenames to a different location. It is
57 necessary to copy the shared libraries used by \fBtar\fR (see \fBldd\fR(1)) to
58 the \fInewroot\fR filesystem.
60 .sp
61 .in +2
62 .nf
63 example# mkdir /tmp/lib; cd /lib
64 example# cp ld.so.1 libc.so.1 libcmd.so.1 libdl.so.1 \e
65          libsec.so.1 /tmp/lib
66 example# cp /usr/bin/tar /tmp
67 example# dd if=/dev/rmt/0 | chroot /tmp tar xvf -
68 .fi
69 .in -2
70 .sp
72 .SH SEE ALSO
73 .sp
74 .LP
75 \fBcd\fR(1), \fBtar\fR(1), \fBchroot\fR(2), \fBttyname\fR(3C),
76 \fBattributes\fR(5)
77 .SH NOTES
78 .sp
79 .LP
80 Exercise extreme caution when referencing device files in the new root file
81 system.
82 .sp
83 .LP
84 References by routines such as \fBttyname\fR(3C) to stdin, stdout, and stderr
85 will find that the device associated with the file descriptor is unknown after
86 \fBchroot\fR is run.