1SWITCH_ROOT(8)              System Manager's Manual             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 and /sys to  newroot  and
16       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
21

OPTIONS

23       -h, --help
24              show help and exit
25
26       -V, --version
27              show version number and exit
28
29

RETURN VALUE

31       switch_root returns 0 on success and 1 on failure.
32
33

NOTES

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

SEE ALSO

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

AUTHORS

47       Peter Jones <pjones@redhat.com>
48       Jeremy Katz <katzj@redhat.com>
49       Karel Zak <kzak@redhat.com>
50

AVAILABILITY

52       The  switch_root  command  is  part of the util-linux-ng package and is
53       available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
54
55
56
57Linux                              June 2009                    SWITCH_ROOT(8)
Impressum