]> git.ipfire.org Git - thirdparty/dracut.git/blame - dracut.8.asc
Add option to turn on/off prelinking
[thirdparty/dracut.git] / dracut.8.asc
CommitLineData
888d53f2
HH
1DRACUT(8)
2=========
3:doctype: manpage
4:man source: dracut
5:man manual: dracut
6
7NAME
8----
9dracut - low-level tool for generating an initramfs image
10
11SYNOPSIS
12--------
13*dracut* ['OPTION...'] [<image> [_<kernel version>_]]
14
15DESCRIPTION
16-----------
4c3be42c
HH
17
18Create an initramfs <image> for the kernel with the version <kernel version>.
19If <kernel version> is omitted, then the version of the actual running
20kernel is used. If <image> is omitted or empty, then the default location
21/boot/initramfs-<kernel version>.img is used.
22
888d53f2
HH
23dracut creates an initial image used by the kernel for preloading the block
24device modules (such as IDE, SCSI or RAID) which are needed to access the root
25filesystem, mounting the root filesystem and booting into the real system.
26
27At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
28as initial root file system. All finding of the root device happens in this
29early userspace.
30
4c3be42c
HH
31For a complete list of kernel command line options see *dracut.cmdline*(7).
32
64d144ae 33If you are dropped to an emergency shell, while booting your initramfs,
c33488fe 34the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
64d144ae
HH
35(to be mounted by hand) partition (usually /boot) or a USB stick.
36Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
c33488fe 37_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
64d144ae
HH
38It should be attached to any report about dracut problems.
39
4c3be42c
HH
40EXAMPLE
41-------
42
43To create a initramfs image, the most simple command is:
44----
45# dracut
46----
47
48This will generate a general purpose initramfs image, with all possible
49functionality resulting of the combination of the installed dracut modules and
50system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
51contains the kernel modules of the currently active kernel with version
52_++<kernel version>++_.
53
54If the initramfs image already exists, dracut will display an error message, and
55to overwrite the existing image, you have to use the --force option.
56----
57# dracut --force
58----
59
60If you want to specify another filename for the resulting image you would issue
61a command like:
62----
63# dracut foobar.img
64----
65
66To 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
71A shortcut to generate the image at the default location for a specific kernel
72version is:
73----
74# dracut --kver 2.6.40-1.rc5.f20
75----
76
77If you want to create lighter, smaller initramfs images, you may want to specify
ea3c4e82 78the --hostonly or -H option. Using this option, the resulting image will
4c3be42c
HH
79contain only those dracut modules, kernel modules and filesystems, which are
80needed to boot this specific machine. This has the drawback, that you can't put
81the disk on another controller or machine, and that you can't switch to another
82root filesystem, without recreating the initramfs image. The usage of the
ea3c4e82 83--hostonly option is only for experts and you will have to keep the broken
4c3be42c
HH
84pieces. At least keep a copy of a general purpose image (and corresponding
85kernel) as a fallback to rescue your system.
86
888d53f2
HH
87
88OPTIONS
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===============================
107If [LIST] has multiple arguments, then you have to put these in quotes. For
108example:
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===============================
120If [LIST] has multiple arguments, then you have to put these in quotes. For
121example:
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===============================
133If [LIST] has multiple arguments, then you have to put these in quotes. For
134example:
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===============================
147If [LIST] has multiple arguments, then you have to put these in quotes. For
148example:
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===============================
161If [LIST] has multiple arguments, then you have to put these in quotes. For
162example:
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===============================
175If [LIST] has multiple arguments, then you have to put these in quotes. For
176example:
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===============================
190If [LIST] has multiple arguments, then you have to put these in quotes. For
191example:
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===============================
204If [LIST] has multiple arguments, then you have to put these in quotes. For
205example:
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
b7c770e1
DS
228**--early-microcode**::
229 Combine early microcode with ramdisk
230
231**--no-early-microcode**::
232 Do not combine early microcode with ramdisk
233
1743473b
HH
234**--print-cmdline**::
235 print the kernel command line for the current disk layout
236
888d53f2
HH
237**--mdadmconf**::
238 include local _/etc/mdadm.conf_
239
240**--nomdadmconf**::
241 do not include local _/etc/mdadm.conf_
242
243**--lvmconf**::
244 include local _/etc/lvm/lvm.conf_
245
246**--nolvmconf**::
247 do not include local _/etc/lvm/lvm.conf_
248
249**--fscks** [LIST]::
250 add a space-separated list of fsck tools, in addition to _dracut.conf_'s
251 specification; the installation is opportunistic (non-existing tools are
252 ignored)
253+
254[NOTE]
255===============================
256If [LIST] has multiple arguments, then you have to put these in quotes. For
257example:
258----
259# dracut --fscks "fsck.foo barfsck" ...
260----
261===============================
262
263**--nofscks**::
264 inhibit installation of any fsck tools
265
266**--strip**::
6c128565 267 strip binaries in the initramfs (default)
888d53f2
HH
268
269**--nostrip**::
6c128565 270 do not strip binaries in the initramfs
04d18f55 271
f4a94278
HH
272**--prelink**::
273 prelink binaries in the initramfs (default)
274
275**--noprelink**::
276 do not prelink binaries in the initramfs
277
04d18f55
HH
278**--hardlink**::
279 hardlink files in the initramfs (default)
280
281**--nohardlink**::
282 do not hardlink files in the initramfs
888d53f2
HH
283
284**--prefix** _<dir>_::
285 prefix initramfs files with the specified directory
286
287**--noprefix**::
288 do not prefix initramfs files (default)
289
888d53f2
HH
290**-h, --help**::
291 display help text and exit.
292
293**--debug**::
294 output debug information of the build process
295
296**-v, --verbose**::
297 increase verbosity level (default is info(4))
298
299**-q, --quiet**:: decrease verbosity level (default is info(4))
300
301**-c, --conf** _<dracut configuration file>_::
302 specify configuration file to use.
303+
304Default:
305 _/etc/dracut.conf_
306
307**--confdir** _<configuration directory>_::
308 specify configuration directory to use.
309+
310Default:
311 _/etc/dracut.conf.d_
312
4dd68ca4
313**--tmpdir** _<temporary directory>_::
314 specify temporary directory to use.
315+
316Default:
317 _/var/tmp_
318
888d53f2
HH
319**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
320
321**-l, --local**::
322 activates the local mode. dracut will use modules from the current working
323 directory instead of the system-wide installed modules in
324 _/usr/lib/dracut/modules.d_.
325 This is useful when running dracut from a git checkout.
326
327**-H, --hostonly**::
1d97bb8b
328 Host-Only mode: Install only what is needed for booting the local host
329 instead of a generic host and generate host-specific configuration.
888d53f2
HH
330+
331[WARNING]
332====
0cec2304
HH
333If chrooted to another root other than the real root device, use "--fstab" and
334provide a valid _/etc/fstab_.
888d53f2
HH
335====
336
472189da 337**-N, --no-hostonly**::
cb74b382
HH
338 Disable Host-Only mode
339
324ea606
HH
340**--persistent-policy** _<policy>_::
341 Use _<policy>_ to address disks and partitions.
342 _<policy>_ can be any directory name found in /dev/disk.
343 E.g. "by-uuid", "by-label"
344
888d53f2
HH
345**--fstab**::
346 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
347
bd66d2b5 348**--add-fstab** _<filename>_ ::
888d53f2
HH
349 Add entries of _<filename>_ to the initramfs /etc/fstab.
350
351**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
f0690513
HH
352 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
353 options>_ in the initramfs
888d53f2 354
c586b033
CG
355**--add-device** _<device>_ ::
356 Bring up _<device>_ in initramfs, _<device>_ should be the device name.
357 This can be useful in hostonly mode for resume support when your swap is on
358 LVM or an encrypted partition.
359 [NB --device can be used for compatibility with earlier releases]
52f1b041 360
888d53f2
HH
361**-i, --include** _<SOURCE>_ _<TARGET>_::
362 include the files in the SOURCE directory into the
363 TARGET directory in the final initramfs. If SOURCE is a file, it will be
364 installed to TARGET in the final initramfs. This parameter can be specified
365 multiple times.
366
367**-I, --install** _<file list>_::
368 install the space separated list of files into the initramfs.
369+
370[NOTE]
371===============================
372If [LIST] has multiple arguments, then you have to put these in quotes. For
373example:
888d53f2
HH
374----
375# dracut --install "/bin/foo /sbin/bar" ...
376----
377===============================
378
379**--gzip**::
380 Compress the generated initramfs using gzip. This will be done by default,
381 unless another compression option or --no-compress is passed. Equivalent to
382 "--compress=gzip -9"
383
384**--bzip2**::
385 Compress the generated initramfs using bzip2.
386+
387[WARNING]
388====
389Make sure your kernel has bzip2 decompression support compiled in, otherwise you
390will not be able to boot. Equivalent to "--compress=bzip2"
391====
392
393**--lzma**::
394 Compress the generated initramfs using lzma.
395+
396[WARNING]
397====
398Make sure your kernel has lzma decompression support compiled in, otherwise you
ea3c4e82 399will not be able to boot. Equivalent to "lzma --compress=lzma -9"
888d53f2
HH
400====
401
402**--xz**::
403 Compress the generated initramfs using xz.
404+
405[WARNING]
406====
407Make sure your kernel has xz decompression support compiled in, otherwise you
ea3c4e82 408will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
888d53f2
HH
409====
410
411**--compress** _<compressor>_::
412 Compress the generated initramfs using the passed compression program. If
413 you pass it just the name of a compression program, it will call that
414 program with known-working arguments. If you pass a quoted string with
415 arguments, it will be called with exactly those arguments. Depending on what
416 you pass, this may result in an initramfs that the kernel cannot decompress.
417
418**--no-compress**::
419 Do not compress the generated initramfs. This will override any other
420 compression options.
421
422**--list-modules**::
423 List all available dracut modules.
424
425**-M, --show-modules**::
426 Print included module's name to standard output during build.
427
428**--keep**::
429 Keep the initramfs temporary directory for debugging purposes.
430
ea3c4e82
HH
431**--printsize**::
432 Print out the module install size
433
434**--profile**:
435 Output profile information of the build process
436
437**--ro-mnt**:
438 Mount / and /usr read-only by default.
439
440**-L, --stdlog** _<level>_::
441 [0-6] Specify logging level (to standard error)
442----
443 0 - suppress any messages
444 1 - only fatal errors
445 2 - all errors
446 3 - warnings
447 4 - info
448 5 - debug info (here starts lots of output)
449 6 - trace info (and even more)
450----
451
7d848c55
HH
452**--regenerate-all**::
453 Regenerate all initramfs images at the default location with the kernel versions found on the system.
454 Additional parameters are passed through.
455
888d53f2
HH
456FILES
457-----
458_/var/log/dracut.log_::
459 logfile of initramfs image creation
460
461_/tmp/dracut.log_::
462 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
463 writable
464
465_/etc/dracut.conf_::
466 see dracut.conf5
467
468_/etc/dracut.conf.d/*.conf_::
469 see dracut.conf5
470
c4e098a5
HH
471_/usr/lib/dracut/dracut.conf.d/*.conf_::
472 see dracut.conf5
473
888d53f2
HH
474Configuration in the initramfs
475~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
476_/etc/conf.d/_::
477 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
478 set initial values. Command line options will override these values
479 set in the configuration files.
480
481_/etc/cmdline_::
3cff5fb5
HH
482 Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
483
484_/etc/cmdline.d/*.conf::
888d53f2
HH
485 Can contain additional command line options.
486
487AVAILABILITY
488------------
489The dracut command is part of the dracut package and is available from
490link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
491
492AUTHORS
493-------
9f355169 494Harald Hoyer
888d53f2 495
9f355169 496Victor Lowther
888d53f2 497
9f355169 498Philippe Seewer
888d53f2 499
9f355169 500Warren Togami
888d53f2 501
9f355169 502Amadeusz Żołnowski
888d53f2 503
9f355169 504Jeremy Katz
888d53f2 505
9f355169 506David Dillow
888d53f2 507
9f355169 508Will Woods
888d53f2
HH
509
510SEE ALSO
511--------
512*dracut.cmdline*(7) *dracut.conf*(5)