2009-06-09 14:11:53 -05:00
|
|
|
.\" Karel Zak <kzak@redhat.com>
|
2011-08-18 15:18:34 -05:00
|
|
|
.TH SWITCH_ROOT 8 "June 2009" "util-linux" "System Administration"
|
2009-06-09 14:11:53 -05:00
|
|
|
.SH NAME
|
2011-08-18 15:18:34 -05:00
|
|
|
switch_root \- switch to another filesystem as the root of the mount tree
|
2009-06-09 14:11:53 -05:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B switch_root
|
2009-07-22 04:29:04 -05:00
|
|
|
.RB [ \-hV ]
|
2009-06-09 14:11:53 -05:00
|
|
|
.LP
|
|
|
|
.B switch_root
|
|
|
|
.I newroot
|
|
|
|
.I init
|
2009-07-22 04:29:04 -05:00
|
|
|
.RI [ arg ...]
|
2009-06-09 14:11:53 -05:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B switch_root
|
2015-01-26 04:45:43 -06:00
|
|
|
moves already mounted /proc, /dev, /sys and /run to
|
2009-06-09 14:11:53 -05:00
|
|
|
.I newroot
|
|
|
|
and makes
|
|
|
|
.I newroot
|
|
|
|
the new root filesystem and starts
|
|
|
|
.I init
|
|
|
|
process.
|
|
|
|
|
|
|
|
.B WARNING: switch_root removes recursively all files and directories on the current root filesystem.
|
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
.IP "\fB\-h, \-\-help\fP"
|
2013-10-14 14:34:39 -05:00
|
|
|
Display help text and exit.
|
2009-06-09 14:11:53 -05:00
|
|
|
.IP "\fB\-V, \-\-version\fP"
|
2013-10-14 14:34:39 -05:00
|
|
|
Display version information and exit.
|
2009-06-09 14:11:53 -05:00
|
|
|
|
|
|
|
.SH RETURN VALUE
|
|
|
|
.B switch_root
|
|
|
|
returns 0 on success and 1 on failure.
|
|
|
|
|
2009-11-20 08:18:51 -06:00
|
|
|
.SH NOTES
|
|
|
|
switch_root will fail to function if
|
|
|
|
.B newroot
|
|
|
|
is not the root of a mount. If you want to switch root into a directory that
|
|
|
|
does not meet this requirement then you can first use a bind-mounting trick to
|
|
|
|
turn any directory into a mount point:
|
|
|
|
.sp
|
|
|
|
.nf
|
|
|
|
.RS
|
|
|
|
mount --bind $DIR $DIR
|
|
|
|
.RE
|
|
|
|
.fi
|
|
|
|
|
2009-06-09 14:11:53 -05:00
|
|
|
.SH "SEE ALSO"
|
2013-05-08 17:12:04 -05:00
|
|
|
.BR chroot (2),
|
|
|
|
.BR init (8),
|
2016-11-10 04:59:27 -06:00
|
|
|
.BR mkinitrd (8),
|
|
|
|
.BR mount (8)
|
2009-06-09 14:11:53 -05:00
|
|
|
.SH AUTHORS
|
|
|
|
.nf
|
|
|
|
Peter Jones <pjones@redhat.com>
|
|
|
|
Jeremy Katz <katzj@redhat.com>
|
|
|
|
Karel Zak <kzak@redhat.com>
|
|
|
|
.fi
|
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The switch_root command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|