]> git.ipfire.org Git - thirdparty/mdadm.git/blame - mdctl.8
mdctl-0.5
[thirdparty/mdadm.git] / mdctl.8
CommitLineData
52826846
NB
1.\" -*- nroff -*-
2.TH mdctl 8
3.SH NAME
4mdctl \- a single program that can be used to control Linux md devices
5.SH SYNOPSIS
6
7.BI mdctl
8[mode] <raiddevice> [options]
9
10.SH DESCRIPTION
11RAID devices are virtual devices created from two or more
12real block devices. This allows multiple disks to be combined into a single
13filesystem, possibly with integrated redundancy to survive drive failure.. Linux RAID devices
14are implemented through the md device driver.
15
16If you're using the
17.B /proc
18filesystem,
19.B /proc/mdstat
20gives you informations about md devices status.
21
22Currently, Linux supports linear md devices, RAID0 (striping), RAID1
23(mirrroring), RAID4 and RAID5. For information on the various levels of
24RAID, check out:
25
26 http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
27
28for new releases of the RAID driver check out:
29
30 ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
31
32.B mdctl
33is a single program that can be used to control Linux md devices. It
34is intended to provide all the functionality (and more) of the mdtools
35and raidtools but with a very different interface.
36
37mdctl can perform all functions without a configuration file. There is the
38option of using a configuration file, but not in the same way that raidtools
39uses one. raidtools uses a configuration file to describe how to create a
40RAID array, and also uses this file partially to start a previously created
41RAID array. Further, raidtools requires the configuration file for such
42things as stopping a raid array which needs to know nothing about the array.
43
44The configuration file that can be used by mdctl lists two different things:
45
46.IP "\fB\-\fP"
47a list of md devices and information about how to identify each. The
48identity can consist of a UUID, and minor-number as recorded on the
49superblock, or a list of devices.
50
51.IP "\fB\-\fP"
52a list of devices that should be scanned for md sub-devices.
53
54.SH MODES
55mdctl has 4 major modes of operation:
56.IP "\fBCreate\fP"
57This mode is used to create a new array with a superblock. It can progress
58in several step create-add-add-run or it can all happen with one command.
59
60.IP "\fBAssemble\fP"
61This mode is used to assemble the parts of a previously created
62array into an active array. Components can be explicitly given
63or can be searched for.
64.B mdctl
65(optionally) checks that the components
66do form a bonafide array, and can, on request, fiddle superblock
67version numbers so as to assemble a faulty array.
68
69.IP "\fBBuild\fP"
70This is for building legacy arrays without superblocks.
71
72.IP "\fBManage\fP"
73This is for odd bits an pieces like hotadd, hotremove, setfaulty, stop,
74readonly,readwrite If an array is only partially setup by the
75Create/Assemble/Build command, subsequent Manage commands can finish the
76job.
77
78.SH OPTIONS
79
80Available options are:
81
82.IP "\fB\-C\fP, \fB\-\-create\fP"
83Create a new array
84
85.IP "\fB-A\fP, \fB\-\-assemble\fP"
86Assemble an existing array
87
88.IP "\fB\-B\fP, \fB\-\-build\fP"
89Build a legacy array without superblock
90
91.IP "\fB\-D\fP, \fB\-\-detail\fP"
92Print detail of a given md array
93
94.IP "\fB\-E\fP, \fB\-\-examine\fP"
95Print content of md superblock on device
96
97.IP "\fB\-h\fP, \fB\-\-help\fP"
98This help message or, after above option, mode specific help message
99
100.IP "\fB\-V\fP, \fB\-\-version\fP"
101Print version information for mdctl
102
103.IP "\fB\-v\fP, \fB\-\-verbose\fP"
104Be more verbose about what is happening
105
106.SH For create or build:
107
108.IP "\fB\-c\fP, \fB\-\-chunk=\fP"
109chunk size of kibibytes
110
111.IP "\fB\-\-rounding=\fP"
112rounding factor for linear array (==chunk size)
113
114.IP "\fB\-l\fP, \fB\-\-level=\fP"
115raid level: 0,1,4,5,linear. 0 or linear for build
116
117.IP "\fB\-p\fP, \fB\-\-parity=\fP"
118raid5 parity algorithm: {left,right}-{,a}symmetric
119
120.IP "\fB\-\-layout=\fP"
121same as --parity
122
123.IP "\fB\-n\fP, \fB\-\-raid-disks=\fP"
124number of active devices in array
125
126.IP "\fB\-x\fP, \fB\-\-spare-disks=\fP"
127number of spares (eXtras) to allow space for
128
129.IP "\fB\-z\fP, \fB\-\-size=\fP"
130Size (in K) of each drive in RAID1/4/5 - optional
131
132.SH For assemble:
133
134.IP "\fB\-u\fP, \fB\-\-uuid=\fP"
135uuid of array to assemble. Devices which don't have this uuid are excluded
136
137.IP "\fB\-c\fP, \fB\-\-config=\fP"
138config file
139
140.IP "\fB\-s\fP, \fB\-\-scan\fP"
141scan config file for missing information
142
143.IP "\fB\-f\fP, \fB\-\-force\fP"
144Assemble the array even if some superblocks appear out-of-date
145
146.SH General management
147
148.IP "\fB\-a\fP, \fB\-\-add\fP"
149add, or hotadd subsequent devices
150
151.IP "\fB\-r\fP, \fB\-\-remove\fP"
152remove subsequent devices
153
154.IP "\fB\-f\fP, \fB\-\-fail\fP"
155mark subsequent devices a faulty
156
157.IP "\fB\-\-set-faulty\fP"
158same as --fail
159
160.IP "\fB\-R\fP, \fB\-\-run\fP"
161start a partially built array
162
163.IP "\fB\-S\fP, \fB\-\-stop\fP"
164deactivate array, releasing all resources
165
166.IP "\fB\-o\fP, \fB\-\-readonly\fP"
167mark array as readonly
168
169.IP "\fB\-w\fP, \fB\-\-readwrite\fP"
170mark array as readwrite
171
172.SH CREATE MODE
173
174Usage:
175
176.B mdctl
177--create device --chunk=X --level=Y --raid-disks=Z devices
178
179This usage will initialise a new md array and possibly associate some
180devices with it. If enough devices are given to complete the array, the
181array will be activated. Otherwise it will be left inactive to be completed
182and activated by subsequent management commands.
183
184As devices are added, they are checked to see if they contain raid
185superblocks or filesystems. They are also check to see if the variance in
186device size exceeds 1%.
187
188If any discrepancy is found, the array will not automatically be run, though
189the presence of a
190.B --run
191can override this caution.
192
193If the
194.B --size
195option is given, it is not necessary to list any subdevices in this command.
196They can be added later, before a
197.B --run.
198If no
199.B --size
200is given, the apparent size of the smallest drive given is used.
201
202The General management options that are valid with --create are:
203.IP "\fB\-\-run\fP"
204insist of running the array even if not all devices are present or some look
205odd.
206
207.IP "\fB\-\-readonly\fP"
208start the array readonly - not supported yet.
209
210.SH ASSEMBLY MODE
211
212Usage:
213
214.B mdctl
215--assemble device options...
216
217.B mdctl
218--assemble --scan options...
219
220This usage assembles one or more raid arrays from pre-existing components.
221For each array, mdctl needs to know the md device, the uuid, and a number of
222sub devices. These can be found in a number of ways.
223
224The md device is either given before
225.B --scan
226or is found from the config file. In the latter case, multiple md devices
227can be started with a single mdctl command.
228
229The uuid can be given with the
230.B --uuid
231option, or can be found in in the config file, or will be taken from the
232super block on the first subdevice listed on the command line or in a
233subsequent
234.B --add
235command.
236
237Devices can be given on the
238.B --assemble
239command line, on subsequent
240.B 'mdctl --add'
241command lines, or from the config file. Only devices which have an md
242superblock which contains the right uuid will be considered for any device.
243
244The config file is only used if explicitly named with
245.B --config
246or requested with
247.B --scan.
248In the later case,
249.B /etc/md.conf
250is used.
251
252If
253.B --scan
254is not given, then the config file will only be used to find uuids for md
255arrays.
256
257The format of the config file is:
258 not yet documented
259
260.SH BUILD MDOE
261
262Usage:
263
264.B mdctl
265--build device -chunk=X --level=Y --raid-disks=Z devices
266
267This usage is similar to
268.B --create.
269The difference is that it creates a legacy array without a superblock. With
270these arrays there is no different between initially creating the array and
271subsequently assembling the array, except that hopefully there is useful
272data there in the second case.
273
274The level may only be 0 or linear. All devices must be listed and the array
275will be started once complete.
276
277.SH BUGS
278no known bugs.
279
280.SH TODO
281
282
283.SH SEE ALSO
284.IR raidtab (5),
285.IR raid0run (8),
286.IR raidstop (8),
287.IR mkraid (8)