]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/switch_root.8.adoc
Asciidoc: Import sys-utils man pages, part 3
[thirdparty/util-linux.git] / sys-utils / switch_root.8.adoc
1 = switch_root(8)
2 :doctype: manpage
3 :man manual: System Administration
4 :man source: util-linux {release-version}
5 :page-layout: base
6 :command: switch_root
7
8 == NAME
9
10 switch_root - switch to another filesystem as the root of the mount tree
11
12 == SYNOPSIS
13
14 *switch_root* [*-hV*]
15
16 *switch_root* _newroot init_ [_arg_...]
17
18 == DESCRIPTION
19
20 *switch_root* moves already mounted _/proc_, _/dev_, _/sys_ and _/run_ to _newroot_ and makes _newroot_ the new root filesystem and starts _init_ process.
21
22 *WARNING: switch_root removes recursively all files and directories on the current root filesystem.*
23
24 == OPTIONS
25
26 *-h, --help*::
27 Display help text and exit.
28
29 *-V, --version*::
30 Display version information and exit.
31
32 == EXIT STATUS
33
34 *switch_root* returns 0 on success and 1 on failure.
35
36 == NOTES
37
38 *switch_root* will fail to function if _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:
39
40 ....
41 mount --bind $DIR $DIR
42 ....
43
44 == AUTHORS
45
46 mailto:pjones@redhat.com[Peter Jones] +
47 mailto:katzj@redhat.com[Jeremy Katz] +
48 mailto:kzak@redhat.com[Karel Zak]
49
50 == SEE ALSO
51
52 *chroot*(2),
53 *init*(8),
54 *mkinitrd*(8),
55 *mount*(8)
56
57 include::../man-common/bugreports.adoc[]
58
59 include::../man-common/footer.adoc[]
60
61 ifdef::translation[]
62 include::../man-common/translation.adoc[]
63 endif::[]