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