]> git.proxmox.com Git - systemd.git/blob - man/bootup.7
Imported Upstream version 217
[systemd.git] / man / bootup.7
1 '\" t
2 .TH "BOOTUP" "7" "" "systemd 217" "bootup"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 bootup \- System bootup process
24 .SH "DESCRIPTION"
25 .PP
26 A number of different components are involved in the system boot\&. Immediately after power\-up, the system BIOS will do minimal hardware initialization, and hand control over to a boot loader stored on a persistent storage device\&. This boot loader will then invoke an OS kernel from disk (or the network)\&. In the Linux case, this kernel (optionally) extracts and executes an initial RAM disk image (initrd), such as generated by
27 \fBdracut\fR(8), which looks for the root file system (possibly using
28 \fBsystemd\fR(1)
29 for this)\&. After the root file system is found and mounted, the initrd hands over control to the host\*(Aqs system manager (such as
30 \fBsystemd\fR(1)) stored on the OS image, which is then responsible for probing all remaining hardware, mounting all necessary file systems and spawning all configured services\&.
31 .PP
32 On shutdown, the system manager stops all services, unmounts all file systems (detaching the storage technologies backing them), and then (optionally) jumps back into the initrd code which unmounts/detaches the root file system and the storage it resides on\&. As a last step, the system is powered down\&.
33 .PP
34 Additional information about the system boot process may be found in
35 \fBboot\fR(7)\&.
36 .SH "SYSTEM MANAGER BOOTUP"
37 .PP
38 At boot, the system manager on the OS image is responsible for initializing the required file systems, services and drivers that are necessary for operation of the system\&. On
39 \fBsystemd\fR(1)
40 systems, this process is split up in various discrete steps which are exposed as target units\&. (See
41 \fBsystemd.target\fR(5)
42 for detailed information about target units\&.) The boot\-up process is highly parallelized so that the order in which specific target units are reached is not deterministic, but still adheres to a limited amount of ordering structure\&.
43 .PP
44 When systemd starts up the system, it will activate all units that are dependencies of
45 default\&.target
46 (as well as recursively all dependencies of these dependencies)\&. Usually,
47 default\&.target
48 is simply an alias of
49 graphical\&.target
50 or
51 multi\-user\&.target, depending on whether the system is configured for a graphical UI or only for a text console\&. To enforce minimal ordering between the units pulled in, a number of well\-known target units are available, as listed on
52 \fBsystemd.special\fR(7)\&.
53 .PP
54 The following chart is a structural overview of these well\-known units and their position in the boot\-up logic\&. The arrows describe which units are pulled in and ordered before which other units\&. Units near the top are started before units nearer to the bottom of the chart\&.
55 .sp
56 .if n \{\
57 .RS 4
58 .\}
59 .nf
60 local\-fs\-pre\&.target
61 |
62 v
63 (various mounts and (various swap (various cryptsetup
64 fsck services\&.\&.\&.) devices\&.\&.\&.) devices\&.\&.\&.) (various low\-level (various low\-level
65 | | | services: udevd, API VFS mounts:
66 v v v tmpfiles, random mqueue, configfs,
67 local\-fs\&.target swap\&.target cryptsetup\&.target seed, sysctl, \&.\&.\&.) debugfs, \&.\&.\&.)
68 | | | | |
69 \e__________________|_________________ | ___________________|____________________/
70 \e|/
71 v
72 sysinit\&.target
73 |
74 ____________________________________/|\e________________________________________
75 / | | | \e
76 | | | | |
77 v v | v v
78 (various (various | (various rescue\&.service
79 timers\&.\&.\&.) paths\&.\&.\&.) | sockets\&.\&.\&.) |
80 | | | | v
81 v v | v \fIrescue\&.target\fR
82 timers\&.target paths\&.target | sockets\&.target
83 | | | |
84 \e__________________|_________________ | ___________________/
85 \e|/
86 v
87 basic\&.target
88 |
89 ____________________________________/| emergency\&.service
90 / | | |
91 | | | v
92 v v v \fIemergency\&.target\fR
93 display\- (various system (various system
94 manager\&.service services services)
95 | required for |
96 | graphical UIs) v
97 | | \fImulti\-user\&.target\fR
98 | | |
99 \e_________________ | _________________/
100 \e|/
101 v
102 \fIgraphical\&.target\fR
103 .fi
104 .if n \{\
105 .RE
106 .\}
107 .PP
108 Target units that are commonly used as boot targets are
109 \fIemphasized\fR\&. These units are good choices as goal targets, for example by passing them to the
110 \fIsystemd\&.unit=\fR
111 kernel command line option (see
112 \fBsystemd\fR(1)) or by symlinking
113 default\&.target
114 to them\&.
115 .SH "BOOTUP IN THE INITIAL RAM DISK (INITRD)"
116 .PP
117 The initial RAM disk implementation (initrd) can be set up using systemd as well\&. In this case, boot up inside the initrd follows the following structure\&.
118 .PP
119 The default target in the initrd is
120 initrd\&.target\&. The bootup process begins identical to the system manager bootup (see above) until it reaches
121 basic\&.target\&. From there, systemd approaches the special target
122 initrd\&.target\&. If the root device can be mounted at
123 /sysroot, the
124 sysroot\&.mount
125 unit becomes active and
126 initrd\-root\-fs\&.target
127 is reached\&. The service
128 initrd\-parse\-etc\&.service
129 scans
130 /sysroot/etc/fstab
131 for a possible
132 /usr
133 mount point and additional entries marked with the
134 \fIx\-initrd\&.mount\fR
135 option\&. All entries found are mounted below
136 /sysroot, and
137 initrd\-fs\&.target
138 is reached\&. The service
139 initrd\-cleanup\&.service
140 isolates to the
141 initrd\-switch\-root\&.target, where cleanup services can run\&. As the very last step, the
142 initrd\-switch\-root\&.service
143 is activated, which will cause the system to switch its root to
144 /sysroot\&.
145 .sp
146 .if n \{\
147 .RS 4
148 .\}
149 .nf
150 : (beginning identical to above)
151 :
152 v
153 basic\&.target
154 | emergency\&.service
155 ______________________/| |
156 / | v
157 | sysroot\&.mount \fIemergency\&.target\fR
158 | |
159 | v
160 | initrd\-root\-fs\&.target
161 | |
162 | v
163 v initrd\-parse\-etc\&.service
164 (custom initrd |
165 services\&.\&.\&.) v
166 | (sysroot\-usr\&.mount and
167 | various mounts marked
168 | with fstab option
169 | x\-initrd\&.mount\&.\&.\&.)
170 | |
171 | v
172 | initrd\-fs\&.target
173 \e______________________ |
174 \e|
175 v
176 initrd\&.target
177 |
178 v
179 initrd\-cleanup\&.service
180 isolates to
181 initrd\-switch\-root\&.target
182 |
183 v
184 ______________________/|
185 / v
186 | initrd\-udevadm\-cleanup\-db\&.service
187 v |
188 (custom initrd |
189 services\&.\&.\&.) |
190 \e______________________ |
191 \e|
192 v
193 initrd\-switch\-root\&.target
194 |
195 v
196 initrd\-switch\-root\&.service
197 |
198 v
199 Transition to Host OS
200 .fi
201 .if n \{\
202 .RE
203 .\}
204 .SH "SYSTEM MANAGER SHUTDOWN"
205 .PP
206 System shutdown with systemd also consists of various target units with some minimal ordering structure applied:
207 .sp
208 .if n \{\
209 .RS 4
210 .\}
211 .nf
212 (conflicts with (conflicts with
213 all system all file system
214 services) mounts, swaps,
215 | cryptsetup
216 | devices, \&.\&.\&.)
217 | |
218 v v
219 shutdown\&.target umount\&.target
220 | |
221 \e_______ ______/
222 \e /
223 v
224 (various low\-level
225 services)
226 |
227 v
228 final\&.target
229 |
230 _____________________________________/ \e_________________________________
231 / | | \e
232 | | | |
233 v v v v
234 systemd\-reboot\&.service systemd\-poweroff\&.service systemd\-halt\&.service systemd\-kexec\&.service
235 | | | |
236 v v v v
237 \fIreboot\&.target\fR \fIpoweroff\&.target\fR \fIhalt\&.target\fR \fIkexec\&.target\fR
238 .fi
239 .if n \{\
240 .RE
241 .\}
242 .PP
243 Commonly used system shutdown targets are
244 \fIemphasized\fR\&.
245 .SH "SEE ALSO"
246 .PP
247 \fBsystemd\fR(1),
248 \fBboot\fR(7),
249 \fBsystemd.special\fR(7),
250 \fBsystemd.target\fR(5),
251 \fBdracut\fR(8)