1SWITCH_ROOT(8)               System Administration              SWITCH_ROOT(8)
2
3
4

NAME

6       switch_root - switch to another filesystem as the root of the mount
7       tree
8

SYNOPSIS

10       switch_root [-hV]
11
12       switch_root newroot init [arg...]
13

DESCRIPTION

15       switch_root moves already mounted /proc, /dev, /sys and /run to newroot
16       and makes newroot the new root filesystem and starts init process.
17
18       WARNING: switch_root removes recursively all files and directories on
19       the current root filesystem.
20

OPTIONS

22       -h, --help
23           Display help text and exit.
24
25       -V, --version
26           Print version and exit.
27

EXIT STATUS

29       switch_root returns 1 on failure, it never returns on success.
30

NOTES

32       switch_root will fail to function if newroot is not the root of a
33       mount. If you want to switch root into a directory that does not meet
34       this requirement then you can first use a bind-mounting trick to turn
35       any directory into a mount point:
36
37           mount --bind $DIR $DIR
38

AUTHORS

40       Peter Jones <pjones@redhat.com>, Jeremy Katz <katzj@redhat.com>, Karel
41       Zak <kzak@redhat.com>
42

SEE ALSO

44       chroot(2), init(8), mkinitrd(8), mount(8)
45

REPORTING BUGS

47       For bug reports, use the issue tracker at
48       https://github.com/util-linux/util-linux/issues.
49

AVAILABILITY

51       The switch_root command is part of the util-linux package which can be
52       downloaded from Linux Kernel Archive
53       <https://www.kernel.org/pub/linux/utils/util-linux/>.
54
55
56
57util-linux 2.39.2                 2023-06-14                    SWITCH_ROOT(8)
Impressum