systemd: pre-pivot hooks runs after /sysroot is mounted
[platform/upstream/dracut.git] / dracut.8.asc
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 -----------
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
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
31 For a complete list of kernel command line options see *dracut.cmdline*(7).
32
33 If you are dropped to an emergency shell, while booting your initramfs,
34 the file _/run/initramfs/rdsosreport.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/rdsosreport.txt_ contains all logs and the output of some tools.
38 It should be attached to any report about dracut problems.
39
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 --hostonly 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 --hostonly 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
87
88 OPTIONS
89 -------
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
97 **-f, --force**::
98     overwrite existing initramfs file.
99
100 **-m, --modules** _<list of dracut modules>_::
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.
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>_::
115     omit a space-separated list of dracut modules. This parameter can be
116     specified multiple times.
117 +
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.
201 +
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
218 **--kernel-cmdline <parameters>**::
219     specify default kernel command line parameters
220
221
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 **--early-microcode**::
229     Combine early microcode with ramdisk
230
231 **--no-early-microcode**::
232     Do not combine early microcode with ramdisk
233
234 **--print-cmdline**::
235     print the kernel command line for the current disk layout
236
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 ===============================
256 If [LIST] has multiple arguments, then you have to put these in quotes. For
257 example:
258 ----
259 # dracut --fscks "fsck.foo barfsck"  ...
260 ----
261 ===============================
262
263 **--nofscks**::
264     inhibit installation of any fsck tools
265
266 **--strip**::
267     strip binaries in the initramfs (default)
268
269 **--nostrip**::
270     do not strip binaries in the initramfs
271
272 **--hardlink**::
273     hardlink files in the initramfs (default)
274
275 **--nohardlink**::
276     do not hardlink files in the initramfs
277
278 **--prefix** _<dir>_::
279     prefix initramfs files with the specified directory
280
281 **--noprefix**::
282     do not prefix initramfs files (default)
283
284 **-h, --help**::
285     display help text and exit.
286
287 **--debug**::
288     output debug information of the build process
289
290 **-v, --verbose**::
291     increase verbosity level (default is info(4))
292
293 **-q, --quiet**:: decrease verbosity level (default is info(4))
294
295 **-c, --conf** _<dracut configuration file>_::
296     specify configuration file to use.
297 +
298 Default:
299    _/etc/dracut.conf_
300
301 **--confdir** _<configuration directory>_::
302     specify configuration directory to use.
303 +
304 Default:
305    _/etc/dracut.conf.d_
306
307 **--tmpdir** _<temporary directory>_::
308     specify temporary directory to use.
309 +
310 Default:
311    _/var/tmp_
312
313 **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
314
315 **-l, --local**::
316     activates the local mode. dracut will use modules from the current working
317     directory instead of the system-wide installed modules in
318     _/usr/lib/dracut/modules.d_.
319     This is useful when running dracut from a git checkout.
320
321 **-H, --hostonly**::
322     Host-Only mode: Install only what is needed for booting the local host
323     instead of a generic host and generate host-specific configuration.
324 +
325 [WARNING]
326 ====
327 If chrooted to another root other than the real root device, use "--fstab" and
328 provide a valid _/etc/fstab_.
329 ====
330
331 **-N, --no-hostonly**::
332     Disable Host-Only mode
333
334 **--persistent-policy** _<policy>_::
335     Use _<policy>_ to address disks and partitions.
336     _<policy>_ can be any directory name found in /dev/disk.
337     E.g. "by-uuid", "by-label"
338
339 **--fstab**::
340     Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
341
342 **--add-fstab** _<filename>_ ::
343     Add entries of _<filename>_ to the initramfs /etc/fstab.
344
345 **--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
346     Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
347     options>_ in the initramfs
348
349 **--add-device** _<device>_ ::
350     Bring up _<device>_ in initramfs, _<device>_ should be the device name.
351     This can be useful in hostonly mode for resume support when your swap is on
352     LVM or an encrypted partition.
353     [NB --device can be used for compatibility with earlier releases]
354
355 **-i, --include** _<SOURCE>_ _<TARGET>_::
356     include the files in the SOURCE directory into the
357     TARGET directory in the final initramfs. If SOURCE is a file, it will be
358     installed to TARGET in the final initramfs. This parameter can be specified
359     multiple times.
360
361 **-I, --install** _<file list>_::
362     install the space separated list of files into the initramfs.
363 +
364 [NOTE]
365 ===============================
366 If [LIST] has multiple arguments, then you have to put these in quotes. For
367 example:
368 ----
369 # dracut --install "/bin/foo /sbin/bar"  ...
370 ----
371 ===============================
372
373 **--gzip**::
374     Compress the generated initramfs using gzip. This will be done by default,
375     unless another compression option or --no-compress is passed. Equivalent to
376     "--compress=gzip -9"
377
378 **--bzip2**::
379     Compress the generated initramfs using bzip2.
380 +
381 [WARNING]
382 ====
383 Make sure your kernel has bzip2 decompression support compiled in, otherwise you
384 will not be able to boot. Equivalent to "--compress=bzip2"
385 ====
386
387 **--lzma**::
388     Compress the generated initramfs using lzma.
389 +
390 [WARNING]
391 ====
392 Make sure your kernel has lzma decompression support compiled in, otherwise you
393 will not be able to boot. Equivalent to "lzma --compress=lzma -9"
394 ====
395
396 **--xz**::
397     Compress the generated initramfs using xz.
398 +
399 [WARNING]
400 ====
401 Make sure your kernel has xz decompression support compiled in, otherwise you
402 will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
403 ====
404
405 **--compress** _<compressor>_::
406     Compress the generated initramfs using the passed compression program. If
407     you pass it just the name of a compression program, it will call that
408     program with known-working arguments. If you pass a quoted string with
409     arguments, it will be called with exactly those arguments. Depending on what
410     you pass, this may result in an initramfs that the kernel cannot decompress.
411
412 **--no-compress**::
413     Do not compress the generated initramfs. This will override any other
414     compression options.
415
416 **--list-modules**::
417     List all available dracut modules.
418
419 **-M, --show-modules**::
420     Print included module's name to standard output during build.
421
422 **--keep**::
423     Keep the initramfs temporary directory for debugging purposes.
424
425 **--printsize**::
426     Print out the module install size
427
428 **--profile**:
429     Output profile information of the build process
430
431 **--ro-mnt**:
432     Mount / and /usr read-only by default.
433
434 **-L, --stdlog** _<level>_::
435     [0-6] Specify logging level (to standard error)
436 ----
437           0 - suppress any messages
438           1 - only fatal errors
439           2 - all errors
440           3 - warnings
441           4 - info
442           5 - debug info (here starts lots of output)
443           6 - trace info (and even more)
444 ----
445
446 **--regenerate-all**::
447     Regenerate all initramfs images at the default location with the kernel versions found on the system.
448     Additional parameters are passed through.
449
450 FILES
451 -----
452 _/var/log/dracut.log_::
453     logfile of initramfs image creation
454
455 _/tmp/dracut.log_::
456     logfile of initramfs image creation, if _/var/log/dracut.log_ is not
457     writable
458
459 _/etc/dracut.conf_::
460     see dracut.conf5
461
462 _/etc/dracut.conf.d/*.conf_::
463     see dracut.conf5
464
465 _/usr/lib/dracut/dracut.conf.d/*.conf_::
466     see dracut.conf5
467
468 Configuration in the initramfs
469 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
470 _/etc/conf.d/_::
471     Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
472     set initial values. Command line options will override these values
473     set in the configuration files.
474
475 _/etc/cmdline_::
476     Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
477
478 _/etc/cmdline.d/*.conf::
479     Can contain additional command line options.
480
481 AVAILABILITY
482 ------------
483 The dracut command is part of the dracut package and is available from
484 link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
485
486 AUTHORS
487 -------
488 Harald Hoyer
489
490 Victor Lowther
491
492 Philippe Seewer
493
494 Warren Togami
495
496 Amadeusz Żołnowski
497
498 Jeremy Katz
499
500 David Dillow
501
502 Will Woods
503
504 SEE ALSO
505 --------
506 *dracut.cmdline*(7) *dracut.conf*(5)