]>
Commit | Line | Data |
---|---|---|
888d53f2 HH |
1 | DRACUT(8) |
2 | ========= | |
3 | :doctype: manpage | |
4 | :man source: dracut | |
5 | :man manual: dracut | |
6 | ||
7 | NAME | |
8 | ---- | |
9 | dracut - low-level tool for generating an initramfs image | |
10 | ||
11 | SYNOPSIS | |
12 | -------- | |
13 | *dracut* ['OPTION...'] [<image> [_<kernel version>_]] | |
14 | ||
15 | DESCRIPTION | |
16 | ----------- | |
4c3be42c HH |
17 | |
18 | Create an initramfs <image> for the kernel with the version <kernel version>. | |
19 | If <kernel version> is omitted, then the version of the actual running | |
20 | kernel is used. If <image> is omitted or empty, then the default location | |
21 | /boot/initramfs-<kernel version>.img is used. | |
22 | ||
888d53f2 HH |
23 | dracut creates an initial image used by the kernel for preloading the block |
24 | device modules (such as IDE, SCSI or RAID) which are needed to access the root | |
25 | filesystem, mounting the root filesystem and booting into the real system. | |
26 | ||
27 | At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it | |
28 | as initial root file system. All finding of the root device happens in this | |
29 | early userspace. | |
30 | ||
4c3be42c HH |
31 | For a complete list of kernel command line options see *dracut.cmdline*(7). |
32 | ||
64d144ae HH |
33 | If you are dropped to an emergency shell, while booting your initramfs, |
34 | the file _/run/initramfs/sosreport.txt_ is created, which can be safed to a | |
35 | (to be mounted by hand) partition (usually /boot) or a USB stick. | |
36 | Additional debugging info can be produced by adding **rd.debug** to the kernel command line. | |
37 | _/run/initramfs/sosreport.txt_ contains all logs and the output of some tools. | |
38 | It should be attached to any report about dracut problems. | |
39 | ||
4c3be42c HH |
40 | EXAMPLE |
41 | ------- | |
42 | ||
43 | To create a initramfs image, the most simple command is: | |
44 | ---- | |
45 | # dracut | |
46 | ---- | |
47 | ||
48 | This will generate a general purpose initramfs image, with all possible | |
49 | functionality resulting of the combination of the installed dracut modules and | |
50 | system tools. The image is /boot/initramfs-_++<kernel version>++_.img and | |
51 | contains the kernel modules of the currently active kernel with version | |
52 | _++<kernel version>++_. | |
53 | ||
54 | If the initramfs image already exists, dracut will display an error message, and | |
55 | to overwrite the existing image, you have to use the --force option. | |
56 | ---- | |
57 | # dracut --force | |
58 | ---- | |
59 | ||
60 | If you want to specify another filename for the resulting image you would issue | |
61 | a command like: | |
62 | ---- | |
63 | # dracut foobar.img | |
64 | ---- | |
65 | ||
66 | To generate an image for a specific kernel version, the command would be: | |
67 | ---- | |
68 | # dracut foobar.img 2.6.40-1.rc5.f20 | |
69 | ---- | |
70 | ||
71 | A shortcut to generate the image at the default location for a specific kernel | |
72 | version is: | |
73 | ---- | |
74 | # dracut --kver 2.6.40-1.rc5.f20 | |
75 | ---- | |
76 | ||
77 | If you want to create lighter, smaller initramfs images, you may want to specify | |
78 | the --host-only or -H option. Using this option, the resulting image will | |
79 | contain only those dracut modules, kernel modules and filesystems, which are | |
80 | needed to boot this specific machine. This has the drawback, that you can't put | |
81 | the disk on another controller or machine, and that you can't switch to another | |
82 | root filesystem, without recreating the initramfs image. The usage of the | |
83 | --host-only option is only for experts and you will have to keep the broken | |
84 | pieces. At least keep a copy of a general purpose image (and corresponding | |
85 | kernel) as a fallback to rescue your system. | |
86 | ||
888d53f2 HH |
87 | |
88 | OPTIONS | |
89 | ------- | |
e65caf36 HH |
90 | **--kver** _<kernel version>_:: |
91 | set the kernel version. This enables to specify the kernel version, without | |
92 | specifying the location of the initramfs image. For example: | |
93 | ---- | |
94 | # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64 | |
95 | ---- | |
96 | ||
888d53f2 HH |
97 | **-f, --force**:: |
98 | overwrite existing initramfs file. | |
99 | ||
100 | **-m, --modules** _<list of dracut modules>_:: | |
0cec2304 HH |
101 | specify a space-separated list of dracut modules to call when building the |
102 | initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This | |
103 | parameter can be specified multiple times. | |
888d53f2 HH |
104 | + |
105 | [NOTE] | |
106 | =============================== | |
107 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
108 | example: | |
109 | ---- | |
110 | # dracut --modules "module1 module2" ... | |
111 | ---- | |
112 | =============================== | |
113 | ||
114 | **-o, --omit** _<list of dracut modules>_:: | |
0cec2304 HH |
115 | omit a space-separated list of dracut modules. This parameter can be |
116 | specified multiple times. | |
18595ced | 117 | + |
888d53f2 HH |
118 | [NOTE] |
119 | =============================== | |
120 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
121 | example: | |
122 | ---- | |
123 | # dracut --omit "module1 module2" ... | |
124 | ---- | |
125 | =============================== | |
126 | ||
127 | **-a, --add** _<list of dracut modules>_:: | |
128 | add a space-separated list of dracut modules to the default set of modules. | |
129 | This parameter can be specified multiple times. | |
130 | + | |
131 | [NOTE] | |
132 | =============================== | |
133 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
134 | example: | |
135 | ---- | |
136 | # dracut --add "module1 module2" ... | |
137 | ---- | |
138 | =============================== | |
139 | ||
140 | **--force-add** _<list of dracut modules>_:: | |
141 | force to add a space-separated list of dracut modules to the default set of | |
142 | modules, when -H is specified. This parameter can be specified multiple | |
143 | times. | |
144 | + | |
145 | [NOTE] | |
146 | =============================== | |
147 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
148 | example: | |
149 | ---- | |
150 | # dracut --force-add "module1 module2" ... | |
151 | ---- | |
152 | =============================== | |
153 | ||
154 | **-d, --drivers** _<list of kernel modules>_:: | |
155 | specify a space-separated list of kernel modules to exclusively include | |
156 | in the initramfs. The kernel modules have to be specified without the ".ko" | |
157 | suffix. This parameter can be specified multiple times. | |
158 | + | |
159 | [NOTE] | |
160 | =============================== | |
161 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
162 | example: | |
163 | ---- | |
164 | # dracut --drivers "kmodule1 kmodule2" ... | |
165 | ---- | |
166 | =============================== | |
167 | ||
168 | **--add-drivers** _<list of kernel modules>_:: | |
169 | specify a space-separated list of kernel modules to add to the initramfs. | |
170 | The kernel modules have to be specified without the ".ko" suffix. This | |
171 | parameter can be specified multiple times. | |
172 | + | |
173 | [NOTE] | |
174 | =============================== | |
175 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
176 | example: | |
177 | ---- | |
178 | # dracut --add-drivers "kmodule1 kmodule2" ... | |
179 | ---- | |
180 | =============================== | |
181 | ||
182 | **--omit-drivers** _<list of kernel modules>_:: | |
183 | specify a space-separated list of kernel modules not to add to the | |
184 | initramfs. | |
185 | The kernel modules have to be specified without the ".ko" suffix. This | |
186 | parameter can be specified multiple times. | |
187 | + | |
188 | [NOTE] | |
189 | =============================== | |
190 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
191 | example: | |
192 | ---- | |
193 | # dracut --omit-drivers "kmodule1 kmodule2" ... | |
194 | ---- | |
195 | =============================== | |
196 | ||
197 | **--filesystems** _<list of filesystems>_:: | |
198 | specify a space-separated list of kernel filesystem modules to exclusively | |
199 | include in the generic initramfs. This parameter can be specified multiple | |
200 | times. | |
18595ced | 201 | + |
888d53f2 HH |
202 | [NOTE] |
203 | =============================== | |
204 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
205 | example: | |
206 | ---- | |
207 | # dracut --filesystems "filesystem1 filesystem2" ... | |
208 | ---- | |
209 | =============================== | |
210 | ||
211 | **-k, --kmoddir** _<kernel directory>_:: | |
212 | specify the directory, where to look for kernel modules | |
213 | ||
214 | **--fwdir** _<dir>[:<dir>...]++_:: | |
215 | specify additional directories, where to look for firmwares. This parameter | |
216 | can be specified multiple times. | |
217 | ||
d20fb951 HH |
218 | **--kernel-cmdline <parameters>**:: |
219 | specify default kernel command line parameters | |
220 | ||
221 | ||
888d53f2 HH |
222 | **--kernel-only**:: |
223 | only install kernel drivers and firmware files | |
224 | ||
225 | **--no-kernel**:: | |
226 | do not install kernel drivers and firmware files | |
227 | ||
228 | **--mdadmconf**:: | |
229 | include local _/etc/mdadm.conf_ | |
230 | ||
231 | **--nomdadmconf**:: | |
232 | do not include local _/etc/mdadm.conf_ | |
233 | ||
234 | **--lvmconf**:: | |
235 | include local _/etc/lvm/lvm.conf_ | |
236 | ||
237 | **--nolvmconf**:: | |
238 | do not include local _/etc/lvm/lvm.conf_ | |
239 | ||
240 | **--fscks** [LIST]:: | |
241 | add a space-separated list of fsck tools, in addition to _dracut.conf_'s | |
242 | specification; the installation is opportunistic (non-existing tools are | |
243 | ignored) | |
244 | + | |
245 | [NOTE] | |
246 | =============================== | |
247 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
248 | example: | |
249 | ---- | |
250 | # dracut --fscks "fsck.foo barfsck" ... | |
251 | ---- | |
252 | =============================== | |
253 | ||
254 | **--nofscks**:: | |
255 | inhibit installation of any fsck tools | |
256 | ||
257 | **--strip**:: | |
6c128565 | 258 | strip binaries in the initramfs (default) |
888d53f2 HH |
259 | |
260 | **--nostrip**:: | |
6c128565 | 261 | do not strip binaries in the initramfs |
04d18f55 HH |
262 | |
263 | **--hardlink**:: | |
264 | hardlink files in the initramfs (default) | |
265 | ||
266 | **--nohardlink**:: | |
267 | do not hardlink files in the initramfs | |
888d53f2 HH |
268 | |
269 | **--prefix** _<dir>_:: | |
270 | prefix initramfs files with the specified directory | |
271 | ||
272 | **--noprefix**:: | |
273 | do not prefix initramfs files (default) | |
274 | ||
888d53f2 HH |
275 | **-h, --help**:: |
276 | display help text and exit. | |
277 | ||
278 | **--debug**:: | |
279 | output debug information of the build process | |
280 | ||
281 | **-v, --verbose**:: | |
282 | increase verbosity level (default is info(4)) | |
283 | ||
284 | **-q, --quiet**:: decrease verbosity level (default is info(4)) | |
285 | ||
286 | **-c, --conf** _<dracut configuration file>_:: | |
287 | specify configuration file to use. | |
288 | + | |
289 | Default: | |
290 | _/etc/dracut.conf_ | |
291 | ||
292 | **--confdir** _<configuration directory>_:: | |
293 | specify configuration directory to use. | |
294 | + | |
295 | Default: | |
296 | _/etc/dracut.conf.d_ | |
297 | ||
4dd68ca4 AŻ |
298 | **--tmpdir** _<temporary directory>_:: |
299 | specify temporary directory to use. | |
300 | + | |
301 | Default: | |
302 | _/var/tmp_ | |
303 | ||
888d53f2 HH |
304 | **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module. |
305 | ||
306 | **-l, --local**:: | |
307 | activates the local mode. dracut will use modules from the current working | |
308 | directory instead of the system-wide installed modules in | |
309 | _/usr/lib/dracut/modules.d_. | |
310 | This is useful when running dracut from a git checkout. | |
311 | ||
312 | **-H, --hostonly**:: | |
1d97bb8b AŻ |
313 | Host-Only mode: Install only what is needed for booting the local host |
314 | instead of a generic host and generate host-specific configuration. | |
888d53f2 HH |
315 | + |
316 | [WARNING] | |
317 | ==== | |
0cec2304 HH |
318 | If chrooted to another root other than the real root device, use "--fstab" and |
319 | provide a valid _/etc/fstab_. | |
888d53f2 HH |
320 | ==== |
321 | ||
472189da | 322 | **-N, --no-hostonly**:: |
cb74b382 HH |
323 | Disable Host-Only mode |
324 | ||
888d53f2 HH |
325 | **--fstab**:: |
326 | Use _/etc/fstab_ instead of _/proc/self/mountinfo_. | |
327 | ||
bd66d2b5 | 328 | **--add-fstab** _<filename>_ :: |
888d53f2 HH |
329 | Add entries of _<filename>_ to the initramfs /etc/fstab. |
330 | ||
331 | **--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_":: | |
f0690513 HH |
332 | Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem |
333 | options>_ in the initramfs | |
888d53f2 | 334 | |
c586b033 CG |
335 | **--add-device** _<device>_ :: |
336 | Bring up _<device>_ in initramfs, _<device>_ should be the device name. | |
337 | This can be useful in hostonly mode for resume support when your swap is on | |
338 | LVM or an encrypted partition. | |
339 | [NB --device can be used for compatibility with earlier releases] | |
52f1b041 | 340 | |
888d53f2 HH |
341 | **-i, --include** _<SOURCE>_ _<TARGET>_:: |
342 | include the files in the SOURCE directory into the | |
343 | TARGET directory in the final initramfs. If SOURCE is a file, it will be | |
344 | installed to TARGET in the final initramfs. This parameter can be specified | |
345 | multiple times. | |
346 | ||
347 | **-I, --install** _<file list>_:: | |
348 | install the space separated list of files into the initramfs. | |
349 | + | |
350 | [NOTE] | |
351 | =============================== | |
352 | If [LIST] has multiple arguments, then you have to put these in quotes. For | |
353 | example: | |
888d53f2 HH |
354 | ---- |
355 | # dracut --install "/bin/foo /sbin/bar" ... | |
356 | ---- | |
357 | =============================== | |
358 | ||
359 | **--gzip**:: | |
360 | Compress the generated initramfs using gzip. This will be done by default, | |
361 | unless another compression option or --no-compress is passed. Equivalent to | |
362 | "--compress=gzip -9" | |
363 | ||
364 | **--bzip2**:: | |
365 | Compress the generated initramfs using bzip2. | |
366 | + | |
367 | [WARNING] | |
368 | ==== | |
369 | Make sure your kernel has bzip2 decompression support compiled in, otherwise you | |
370 | will not be able to boot. Equivalent to "--compress=bzip2" | |
371 | ==== | |
372 | ||
373 | **--lzma**:: | |
374 | Compress the generated initramfs using lzma. | |
375 | + | |
376 | [WARNING] | |
377 | ==== | |
378 | Make sure your kernel has lzma decompression support compiled in, otherwise you | |
379 | will not be able to boot. Equivalent to "--compress=lzma -9" | |
380 | ==== | |
381 | ||
382 | **--xz**:: | |
383 | Compress the generated initramfs using xz. | |
384 | + | |
385 | [WARNING] | |
386 | ==== | |
387 | Make sure your kernel has xz decompression support compiled in, otherwise you | |
388 | will not be able to boot. Equivalent to "--compress=xz --check=crc32 | |
389 | --lzma2=dict=1MiB" | |
390 | ==== | |
391 | ||
392 | **--compress** _<compressor>_:: | |
393 | Compress the generated initramfs using the passed compression program. If | |
394 | you pass it just the name of a compression program, it will call that | |
395 | program with known-working arguments. If you pass a quoted string with | |
396 | arguments, it will be called with exactly those arguments. Depending on what | |
397 | you pass, this may result in an initramfs that the kernel cannot decompress. | |
398 | ||
399 | **--no-compress**:: | |
400 | Do not compress the generated initramfs. This will override any other | |
401 | compression options. | |
402 | ||
403 | **--list-modules**:: | |
404 | List all available dracut modules. | |
405 | ||
406 | **-M, --show-modules**:: | |
407 | Print included module's name to standard output during build. | |
408 | ||
409 | **--keep**:: | |
410 | Keep the initramfs temporary directory for debugging purposes. | |
411 | ||
412 | FILES | |
413 | ----- | |
414 | _/var/log/dracut.log_:: | |
415 | logfile of initramfs image creation | |
416 | ||
417 | _/tmp/dracut.log_:: | |
418 | logfile of initramfs image creation, if _/var/log/dracut.log_ is not | |
419 | writable | |
420 | ||
421 | _/etc/dracut.conf_:: | |
422 | see dracut.conf5 | |
423 | ||
424 | _/etc/dracut.conf.d/*.conf_:: | |
425 | see dracut.conf5 | |
426 | ||
c4e098a5 HH |
427 | _/usr/lib/dracut/dracut.conf.d/*.conf_:: |
428 | see dracut.conf5 | |
429 | ||
888d53f2 HH |
430 | Configuration in the initramfs |
431 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
432 | _/etc/conf.d/_:: | |
433 | Any files found in _/etc/conf.d/_ will be sourced in the initramfs to | |
434 | set initial values. Command line options will override these values | |
435 | set in the configuration files. | |
436 | ||
437 | _/etc/cmdline_:: | |
3cff5fb5 HH |
438 | Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf. |
439 | ||
440 | _/etc/cmdline.d/*.conf:: | |
888d53f2 HH |
441 | Can contain additional command line options. |
442 | ||
443 | AVAILABILITY | |
444 | ------------ | |
445 | The dracut command is part of the dracut package and is available from | |
446 | link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org] | |
447 | ||
448 | AUTHORS | |
449 | ------- | |
9f355169 | 450 | Harald Hoyer |
888d53f2 | 451 | |
9f355169 | 452 | Victor Lowther |
888d53f2 | 453 | |
9f355169 | 454 | Philippe Seewer |
888d53f2 | 455 | |
9f355169 | 456 | Warren Togami |
888d53f2 | 457 | |
9f355169 | 458 | Amadeusz Żołnowski |
888d53f2 | 459 | |
9f355169 | 460 | Jeremy Katz |
888d53f2 | 461 | |
9f355169 | 462 | David Dillow |
888d53f2 | 463 | |
9f355169 | 464 | Will Woods |
888d53f2 HH |
465 | |
466 | SEE ALSO | |
467 | -------- | |
468 | *dracut.cmdline*(7) *dracut.conf*(5) |