Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / lvm2 / dist / scripts / lvm2create_initrd / lvm2create_initrd.8
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "lvm2create_initrd 8"
132 .TH lvm2create_initrd 8 "2004-06-05" "lvm2create_initrd" "create LVM2 initrd"
133 .SH "NAME"
134 lvm2create_initrd \- create initrd image for booting to root\e\-on\e\-LVM2
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 \&\fBlvm2create_initrd\fR [ \fB\-h|\-\-help\fR ] [ \fB\-v|\-\-verbose\fR ] [ \fB\-c|\-\-lvmconf\fR \fI/path/to/lvm.conf\fR ] [ \fB\-m|\-\-modules\fR "\fImodule1 module2 ...\fR" ] [ \fB\-e|\-\-extra\fR "\fIfile1 file2 ...\fR" ] [ \fB\-r|\-\-raid\fR "\fI/dev/md1 /dev/md2 ...\fR" ]
138 [ \fB\-R|\-\-raidconf\fR \fI/path/to/mdadm.conf\fR ] [ \fB\-M|\-\-makedev\fR \fIstyle\fR ]
139 .SH "DESCRIPTION"
140 .IX Header "DESCRIPTION"
141 lvm2create_initrd creates an initial ramdisk (initrd) image suitable for booting to system that has an \s-1LVM2\s0 volume as its root filesystem.
142 .PP
143 To boot to such a setup, you'll
144 either need a bootloader that understands \s-1LVM2\s0 volumes, or you'll need a
145 filesystem on a regular volume to act as a boot partition (typically mounted
146 on /boot).
147 .PP
148 The resulting initrd image is fairly full\-featured. It can harbor and load
149 kernel modules, start \s-1MD\s0 devices, and boot to a shell to perform rescue
150 operations.
151 .Sh "Booting to your initrd Image:"
152 .IX Subsection "Booting to your initrd Image:"
153 The filesystem image created is an ext2fs filesystem, hence your kernel must have
154 ext2fs built into it statically in order to boot to the image.
155 .PP
156 Once you create your initrd image, you must pass the correct options to the kernel when
157 you boot using it. Your kernel command line should look something like this:
158 .PP
159 \&\fBroot=/dev/ram0 lvm2root=/dev/rootvg/root [ lvm2rescue ]\fR
160 .PP
161 of course there may be other options.
162 .IP "\fBroot=/dev/ram0\fR" 4
163 .IX Item "root=/dev/ram0"
164 This option is required. It tells the kernel that the root filesystem should initially
165 be set to the ramdisk (/dev/ram0).
166 .IP "\fBlvm2root=/dev/rootvg/root\fR" 4
167 .IX Item "lvm2root=/dev/rootvg/root"
168 This option is also required. It tells the initrd image which \s-1LVM2\s0 device the root filesystem is located on.
169 .IP "\fBlvm2rescue\fR" 4
170 .IX Item "lvm2rescue"
171 Causes the initrd image to run a shell prior to mounting the root filesystem. This is
172 helpful in disaster situations where your initrd image is accessable, but there is
173 a problem with the root filesystem (corrupted image, incorrect device setup, etc.). This
174 option is (of course) optional.
175 .SH "OPTIONS"
176 .IX Header "OPTIONS"
177 Most of parameters that can be set via command-line options can also be set
178 via environment variables. Options specified on the command-line always take
179 precedence.
180 .IP "\fB\-h|\-\-help\fR" 4
181 .IX Item "-h|--help"
182 Display short help text and exit. If used, other options are ignored.
183 .IP "\fB\-v|\-\-verbose\fR" 4
184 .IX Item "-v|--verbose"
185 Turn on extra verbosity for debugging, etc.
186 .IP "\fB\-c|\-\-lvmconf\fR \fI/path/to/lvm.conf\fR" 4
187 .IX Item "-c|--lvmconf /path/to/lvm.conf"
188 Specify an lvm.conf file to include in the image. This is useful if you have
189 special device filters or other options you wish to use during the initrd
190 stage. If this option is not
191 included, then a lvm.conf file is created that contains only the current
192 device filter from an \fBlvm dumpconfig\fR. This can also be set via the \fB$LVMCONF\fR
193 environment variable.
194 .ie n .IP "\fB\-m|\-\-modules\fR ""\fI/path/to/module1.ko /path/to/module2.ko ...\fR""" 4
195 .el .IP "\fB\-m|\-\-modules\fR ``\fI/path/to/module1.ko /path/to/module2.ko ...\fR''" 4
196 .IX Item "-m|--modules ""/path/to/module1.ko /path/to/module2.ko ..."""
197 Specify modules to include and plug in during the initrd phase. This option
198 takes a quoted, space-separated list of modules. Full pathnames are required.
199 These modules are loaded into the kernel early in the initrd phase of the boot
200 process. The current modprobe.conf file is also copied to the initrd image
201 as well. This can also be specified via the \fB$MODULES\fR environment variable.
202 .ie n .IP "\fB\-e|\-\-extra\fR ""\fI/path/to/file1 /path/to/file2 ...\fR""" 4
203 .el .IP "\fB\-e|\-\-extra\fR ``\fI/path/to/file1 /path/to/file2 ...\fR''" 4
204 .IX Item "-e|--extra ""/path/to/file1 /path/to/file2 ..."""
205 Extra files that should be included in the initrd image. These files will be
206 copied to the same location in the initrd image that they are in the current
207 filesystem. Again full pathnames are required. This can also be specified via
208 the \fB$EXTRAFILES\fR environment variable.
209 .ie n .IP "\fB\-r|\-\-raid\fR ""\fI/dev/md1 /dev/md2...\fR""" 4
210 .el .IP "\fB\-r|\-\-raid\fR ``\fI/dev/md1 /dev/md2...\fR''" 4
211 .IX Item "-r|--raid ""/dev/md1 /dev/md2..."""
212 \&\s-1RAID\s0 devices to be started prior to scanning for \s-1LVM2\s0 volume groups. If this
213 option is used then then \fBmdadm\fR program must be installed. This can also be
214 specified via the \fB$RAID\fR environment variable.
215 .ie n .IP "\fB\-R|\-\-raidconf\fR ""\fI/path/to/mdadm.conf\fR""" 4
216 .el .IP "\fB\-R|\-\-raidconf\fR ``\fI/path/to/mdadm.conf\fR''" 4
217 .IX Item "-R|--raidconf ""/path/to/mdadm.conf"""
218 Location of a mdadm.conf file to include. If this is not specified, then no
219 files are included, and any devices specified with the \fB\-r\fR option above
220 must have minor numbers that match their superblock values. This can also be
221 specified via the \fB$RAIDCONF\fR environment variable.
222 .IP "\fB\-M|\-\-makedev\fR \fIstyle\fR" 4
223 .IX Item "-M|--makedev style"
224 Set \s-1MAKEDEV\s0 invocation style. The script currently supports 2 styles of
225 \&\s-1MAKEDEV\s0 programs \fIdebian\fR and \fIredhat\fR. The default is \fIdebian\fR. Set
226 to \fIredhat\fR if using the RedHat/Fedora binary \s-1MAKEDEV\s0 program. Please send
227 a bug report to maintainer if your distrib doesn't work with any of the
228 current options.
229 .SH "ENVIRONMENT VARIABLES"
230 .IX Header "ENVIRONMENT VARIABLES"
231 Most of the options to this script can be set via environment variables. In
232 situations where both are set, then the command-line options take precedence.
233 .IP "\fB$LVMCONF\fR" 4
234 .IX Item "$LVMCONF"
235 Same as \-c option.
236 .IP "\fB$MODULES\fR" 4
237 .IX Item "$MODULES"
238 Same as \-m option.
239 .IP "\fB$EXTRAFILES\fR" 4
240 .IX Item "$EXTRAFILES"
241 Same as \-e option.
242 .IP "\fB$RAID\fR" 4
243 .IX Item "$RAID"
244 Same as \-r option.
245 .IP "\fB$RAIDCONF\fR" 4
246 .IX Item "$RAIDCONF"
247 Same as \-R option.
248 .IP "\fB$MAKEDEV\fR" 4
249 .IX Item "$MAKEDEV"
250 Same as \-M option.
251 .IP "\fB$BASICDEVICES\fR" 4
252 .IX Item "$BASICDEVICES"
253 Overrides the default value of \f(CW$BASICDEVICES\fR in the script (which is \*(L"std consoleonly fd\*(R"). These values are passed to the \fB\s-1MAKEDEV\s0\fR program to create device
254 entries in the initrd image.
255 .IP "\fB$BLOCKDEVICES\fR" 4
256 .IX Item "$BLOCKDEVICES"
257 Overrides the default value of \f(CW$BLOCKDEVICES\fR in the script (which is \*(L"md hda hdb hdc hdd sda sdb sdc sdd\*(R"). This value is passed to the \fB\s-1MAKEDEV\s0\fR program to
258 create device entries in the initrd image.
259 .IP "\fB$BINFILES\fR" 4
260 .IX Item "$BINFILES"
261 Overrides the default value of \f(CW$BINFILES\fR (which is \*(L"/lib/lvm\-200/lvm /bin/bash /bin/busybox /sbin/pivot_root\*(R"). The difference between using this and adding
262 a file to the \f(CW$EXTRAFILES\fR list above is that libraries that these depend upon are also included. You can still use \f(CW$EXTRAFILES\fR to achieve the same effect, but
263 you must resolve library dependencies youself.
264 .IP "\fB$INITRDSIZE\fR" 4
265 .IX Item "$INITRDSIZE"
266 Force a particular size for your initrd image. The default is to total up the size of
267 the included files and to add 512K as a buffer.
268 .SH "BUGS"
269 .IX Header "BUGS"
270 I don't like having to specify a \-M option to set the \s-1MAKEDEV\s0 style, but I know
271 of no way to reliably detect what type of \s-1MAKEDEV\s0 is being used. We'll probably
272 have to add other \s-1MAKEDEV\s0 styles in the future as this script is tested on
273 other distributions.
274 .SH "AUTHORS"
275 .IX Header "AUTHORS"
276 The script was originally written by Miguel Cabeca, with significant
277 improvements by Jeffrey Layton. Comments, bug reports and patches should be
278 sent to Jeffrey Layton at \fBjtlayton@poochiereds.net\fR.
279 .SH "SEE ALSO"
280 .IX Header "SEE ALSO"
281 \&\fB\s-1MAKEDEV\s0\fR(8), \fBmdadm\fR(8), \fBbusybox\fR(8), \fBlvm.conf\fR(5)