.\"
.TH PIVOT_ROOT 2 2012-07-13 "Linux" "Linux Programmer's Manual"
.SH NAME
-pivot_root \- change the root filesystem
+pivot_root \- change the root file system
.SH SYNOPSIS
.BI "int pivot_root(const char *" new_root ", const char *" put_old );
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.BR pivot_root ()
-moves the root filesystem of the calling process to the
-directory \fIput_old\fP and makes \fInew_root\fP the new root filesystem
+moves the root file system of the calling process to the
+directory \fIput_old\fP and makes \fInew_root\fP the new root file system
of the calling process.
.\"
.\" The
The typical use of
.BR pivot_root ()
is during system startup, when the
-system mounts a temporary root filesystem (e.g., an \fBinitrd\fP), then
-mounts the real root filesystem, and eventually turns the latter into
+system mounts a temporary root file system (e.g., an \fBinitrd\fP), then
+mounts the real root file system, and eventually turns the latter into
the current root of all relevant processes or threads.
.BR pivot_root ()
is necessary in order to prevent kernel threads from keeping the old
root directory busy with their root and current working directory,
even if they never access
-the filesystem in any way.
+the file system in any way.
In the future, there may be a mechanism for
-kernel threads to explicitly relinquish any access to the filesystem,
+kernel threads to explicitly relinquish any access to the file system,
such that this fairly intrusive mechanism can be removed from
.BR pivot_root ().
.IP \- 3
They must be directories.
.IP \- 3
-\fInew_root\fP and \fIput_old\fP must not be on the same filesystem as
+\fInew_root\fP and \fIput_old\fP must not be on the same file system as
the current root.
.IP \- 3
\fIput_old\fP must be underneath \fInew_root\fP, that is, adding a nonzero
number of \fI/..\fP to the string pointed to by \fIput_old\fP must yield
the same directory as \fInew_root\fP.
.IP \- 3
-No other filesystem may be mounted on \fIput_old\fP.
+No other file system may be mounted on \fIput_old\fP.
.PP
See also
.BR pivot_root (8)
or
.BR pivot_root (),
see also below), not the old root directory, but the
-mount point of that filesystem is mounted on \fIput_old\fP.
+mount point of that file system is mounted on \fIput_old\fP.
\fInew_root\fP does not have to be a mount point.
In this case,
-\fI/proc/mounts\fP will show the mount point of the filesystem containing
+\fI/proc/mounts\fP will show the mount point of the file system containing
\fInew_root\fP as root (\fI/\fP).
.SH RETURN VALUE
On success, zero is returned.
Additionally, it may return:
.TP
.B EBUSY
-\fInew_root\fP or \fIput_old\fP are on the current root filesystem,
-or a filesystem is already mounted on \fIput_old\fP.
+\fInew_root\fP or \fIput_old\fP are on the current root file system,
+or a file system is already mounted on \fIput_old\fP.
.TP
.B EINVAL
\fIput_old\fP is not underneath \fInew_root\fP.