xref: /dflybsd-src/share/man/man7/initrd.7 (revision 2cfd98c8e7ec3b482fae9e58398a28a362806b17)
1*2cfd98c8SAaron LI.\"
2*2cfd98c8SAaron LI.\" Copyright (c) 2018
3*2cfd98c8SAaron LI.\"	The DragonFly Project.  All rights reserved.
4*2cfd98c8SAaron LI.\"
5*2cfd98c8SAaron LI.\" Redistribution and use in source and binary forms, with or without
6*2cfd98c8SAaron LI.\" modification, are permitted provided that the following conditions
7*2cfd98c8SAaron LI.\" are met:
8*2cfd98c8SAaron LI.\"
9*2cfd98c8SAaron LI.\" 1. Redistributions of source code must retain the above copyright
10*2cfd98c8SAaron LI.\"    notice, this list of conditions and the following disclaimer.
11*2cfd98c8SAaron LI.\" 2. Redistributions in binary form must reproduce the above copyright
12*2cfd98c8SAaron LI.\"    notice, this list of conditions and the following disclaimer in
13*2cfd98c8SAaron LI.\"    the documentation and/or other materials provided with the
14*2cfd98c8SAaron LI.\"    distribution.
15*2cfd98c8SAaron LI.\" 3. Neither the name of The DragonFly Project nor the names of its
16*2cfd98c8SAaron LI.\"    contributors may be used to endorse or promote products derived
17*2cfd98c8SAaron LI.\"    from this software without specific, prior written permission.
18*2cfd98c8SAaron LI.\"
19*2cfd98c8SAaron LI.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20*2cfd98c8SAaron LI.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21*2cfd98c8SAaron LI.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22*2cfd98c8SAaron LI.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23*2cfd98c8SAaron LI.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24*2cfd98c8SAaron LI.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25*2cfd98c8SAaron LI.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26*2cfd98c8SAaron LI.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27*2cfd98c8SAaron LI.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28*2cfd98c8SAaron LI.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29*2cfd98c8SAaron LI.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*2cfd98c8SAaron LI.\" SUCH DAMAGE.
31*2cfd98c8SAaron LI.\"
32*2cfd98c8SAaron LI.Dd June 2, 2018
33*2cfd98c8SAaron LI.Dt INITRD 7
34*2cfd98c8SAaron LI.Os
35*2cfd98c8SAaron LI.Sh NAME
36*2cfd98c8SAaron LI.Nm initrd
37*2cfd98c8SAaron LI.Nd initial ramdisk image as early userland
38*2cfd98c8SAaron LI.Sh DESCRIPTION
39*2cfd98c8SAaron LIThe
40*2cfd98c8SAaron LI.Nm
41*2cfd98c8SAaron LIis a small initial ramdisk image that packs a minimal
42*2cfd98c8SAaron LI.Xr init 8 ,
43*2cfd98c8SAaron LIbasic
44*2cfd98c8SAaron LI.Xr rc 8
45*2cfd98c8SAaron LIscripts, and many other statically linked tools, such as various
46*2cfd98c8SAaron LI.Xr mount 8
47*2cfd98c8SAaron LIutilities,
48*2cfd98c8SAaron LI.Xr lvm 8 ,
49*2cfd98c8SAaron LI.Xr cryptsetup 8 ,
50*2cfd98c8SAaron LI.Xr tcplay 8 ,
51*2cfd98c8SAaron LIas well as some networking tools.
52*2cfd98c8SAaron LIThe
53*2cfd98c8SAaron LI.Nm
54*2cfd98c8SAaron LIis a nice early userland and is required to help mount the root
55*2cfd98c8SAaron LIpartition residing on an encrypted device or LVM.
56*2cfd98c8SAaron LI.Pp
57*2cfd98c8SAaron LIThe statically linked tools are known as the
58*2cfd98c8SAaron LI.Dq rescue tools
59*2cfd98c8SAaron LIand shipped at
60*2cfd98c8SAaron LI.Pa /rescue .
61*2cfd98c8SAaron LIThe inclusion of such rescue tools makes
62*2cfd98c8SAaron LI.Nm
63*2cfd98c8SAaron LIcan provide with a powerful rescue environment to fix severe problems,
64*2cfd98c8SAaron LIe.g., the root partition cannot be mounted.
65*2cfd98c8SAaron LIUsers can also choose to boot into the rescue mode from the bootloader
66*2cfd98c8SAaron LImenu.
67*2cfd98c8SAaron LI.Pp
68*2cfd98c8SAaron LIThe
69*2cfd98c8SAaron LI.Nm
70*2cfd98c8SAaron LIis a
71*2cfd98c8SAaron LI.Xr md 4
72*2cfd98c8SAaron LIimage formatted with the
73*2cfd98c8SAaron LI.Xr UFS 5
74*2cfd98c8SAaron LIfilesystem.
75*2cfd98c8SAaron LIIt is created by the
76*2cfd98c8SAaron LI.Dq initrd
77*2cfd98c8SAaron LItarget of the
78*2cfd98c8SAaron LI.Xr build 7
79*2cfd98c8SAaron LIframework, and is compressed and installed at
80*2cfd98c8SAaron LI.Pa /boot/kernel/initrd.img.gz .
81*2cfd98c8SAaron LIThe following configurations should be added to
82*2cfd98c8SAaron LI.Pa /boot/loader.conf
83*2cfd98c8SAaron LIto make use of the
84*2cfd98c8SAaron LI.Nm
85*2cfd98c8SAaron LIimage:
86*2cfd98c8SAaron LI.Bd -literal -offset indent
87*2cfd98c8SAaron LIinitrd.img_load="YES"
88*2cfd98c8SAaron LIinitrd.img_type="md_image"
89*2cfd98c8SAaron LIvfs.root.mountfrom="ufs:md0s0"
90*2cfd98c8SAaron LI.Ed
91*2cfd98c8SAaron LI.Pp
92*2cfd98c8SAaron LIThen, the
93*2cfd98c8SAaron LI.Dq vfs.root.realroot
94*2cfd98c8SAaron LIkernel environment variable can be configured to specify how to
95*2cfd98c8SAaron LImount the real root partition.
96*2cfd98c8SAaron LIIts general syntax is:
97*2cfd98c8SAaron LI.Bd -literal -offset indent
98*2cfd98c8SAaron LIvfs.root.realroot="<type>:[arg1[:arg2[:...]]]"
99*2cfd98c8SAaron LI.Ed
100*2cfd98c8SAaron LI.Pp
101*2cfd98c8SAaron LICurrently, the supported types of real root partition are:
102*2cfd98c8SAaron LI.Pa local ,
103*2cfd98c8SAaron LI.Pa crypt ,
104*2cfd98c8SAaron LIand
105*2cfd98c8SAaron LI.Pa tcplay .
106*2cfd98c8SAaron LIThe
107*2cfd98c8SAaron LI.Pa local
108*2cfd98c8SAaron LItype allows to mount any local filesystem that does not require any
109*2cfd98c8SAaron LIspecial setup apart from the initial discovery and calling the
110*2cfd98c8SAaron LI.Xr mount 8
111*2cfd98c8SAaron LIprogram.
112*2cfd98c8SAaron LIThe general format is as follows:
113*2cfd98c8SAaron LI.Bd -literal -offset indent
114*2cfd98c8SAaron LIvfs.root.realroot="local:<FS-TYPE>:<DEVICE-PATH>[:<OPTIONS>]"
115*2cfd98c8SAaron LI.Ed
116*2cfd98c8SAaron LI.Pp
117*2cfd98c8SAaron LIThe
118*2cfd98c8SAaron LI.Pa crypt
119*2cfd98c8SAaron LIand
120*2cfd98c8SAaron LI.Pa tcplay
121*2cfd98c8SAaron LItypes allow to mount volumes supported by
122*2cfd98c8SAaron LI.Xr cryptsetup 8
123*2cfd98c8SAaron LIand
124*2cfd98c8SAaron LI.Xr tcplay 8 ,
125*2cfd98c8SAaron LIrespectively.
126*2cfd98c8SAaron LIThe device will be set up after asking the user for the key,
127*2cfd98c8SAaron LIand this volume will then be mounted as the root.
128*2cfd98c8SAaron LIThe general formats are as follows:
129*2cfd98c8SAaron LI.Bd -literal -offset indent
130*2cfd98c8SAaron LIvfs.root.realroot="crypt:<FS-TYPE>:<DEVICE-PATH>:<MAPPING-NAME>[:<OPTIONS>]"
131*2cfd98c8SAaron LI
132*2cfd98c8SAaron LIvfs.root.realroot="tcplay:<FS-TYPE>:<DEVICE-PATH>:<MAPPING-NAME>[:<OPTIONS>]"
133*2cfd98c8SAaron LI.Ed
134*2cfd98c8SAaron LI.Sh FILES
135*2cfd98c8SAaron LI.Bl -tag -width "/boot/kernel/initrd.img.gz"
136*2cfd98c8SAaron LI.It Pa /boot/kernel/initrd.img.gz
137*2cfd98c8SAaron LILocation of the compressed
138*2cfd98c8SAaron LI.Nm
139*2cfd98c8SAaron LIimage.
140*2cfd98c8SAaron LI.El
141*2cfd98c8SAaron LI.Sh EXAMPLES
142*2cfd98c8SAaron LI.Bd -literal -offset indent
143*2cfd98c8SAaron LIvfs.root.realroot="local:ufs:/dev/vg00/lv0[:OPTIONS]"
144*2cfd98c8SAaron LI
145*2cfd98c8SAaron LIvfs.root.realroot="crypt:ufs:/dev/ad0s0a:secvolume[:OPTIONS]"
146*2cfd98c8SAaron LI
147*2cfd98c8SAaron LIvfs.root.realroot="crypt:hammer2:/dev/serno/XXXXXX.s1d:root[:OPTIONS]"
148*2cfd98c8SAaron LI.Ed
149*2cfd98c8SAaron LI.Sh SEE ALSO
150*2cfd98c8SAaron LI.Xr md 4 ,
151*2cfd98c8SAaron LI.Xr loader.conf 5 ,
152*2cfd98c8SAaron LI.Xr build 7 ,
153*2cfd98c8SAaron LI.Xr cryptsetup 8 ,
154*2cfd98c8SAaron LI.Xr lvm 8 ,
155*2cfd98c8SAaron LI.Xr tcplay 8
156*2cfd98c8SAaron LI.Sh HISTORY
157*2cfd98c8SAaron LIThe
158*2cfd98c8SAaron LI.Nm
159*2cfd98c8SAaron LImanual page first appeared in
160*2cfd98c8SAaron LI.Dx 5.3 .
161*2cfd98c8SAaron LI.Sh AUTHORS
162*2cfd98c8SAaron LIThe
163*2cfd98c8SAaron LI.Nm
164*2cfd98c8SAaron LImanual page was written by
165*2cfd98c8SAaron LI.An Aaron LI Aq Mt aly@aaronly.me .
166*2cfd98c8SAaron LI.Sh BUGS
167*2cfd98c8SAaron LIThe
168*2cfd98c8SAaron LI.Nm
169*2cfd98c8SAaron LIimage occupies about 10-15 MB wired memory and cannot be freed after
170*2cfd98c8SAaron LIchrooting to the real root partition.
171