]>
Commit | Line | Data |
---|---|---|
295b3979 | 1 | //po4a: entry man manual |
b9d2ddfb MB |
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 | ||
2b2d3172 | 27 | include::man-common/help-version.adoc[] |
b9d2ddfb MB |
28 | |
29 | == EXIT STATUS | |
30 | ||
b334c5c9 | 31 | *switch_root* returns 1 on failure, it never returns on success. |
b9d2ddfb MB |
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 | ||
4eab78d3 MB |
43 | mailto:pjones@redhat.com[Peter Jones], |
44 | mailto:katzj@redhat.com[Jeremy Katz], | |
b9d2ddfb MB |
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 | ||
625e9c61 | 54 | include::man-common/bugreports.adoc[] |
b9d2ddfb | 55 | |
625e9c61 | 56 | include::man-common/footer.adoc[] |
b9d2ddfb MB |
57 | |
58 | ifdef::translation[] | |
625e9c61 | 59 | include::man-common/translation.adoc[] |
b9d2ddfb | 60 | endif::[] |