mdadm-0.7.2
This commit is contained in:
parent
56eb10c0b6
commit
11a3e71da4
34
Assemble.c
34
Assemble.c
|
@ -98,6 +98,7 @@ int Assemble(char *mddev, int mdfd,
|
|||
struct {
|
||||
char *devname;
|
||||
int major, minor;
|
||||
int oldmajor, oldminor;
|
||||
long long events;
|
||||
time_t utime;
|
||||
int uptodate;
|
||||
|
@ -255,6 +256,8 @@ int Assemble(char *mddev, int mdfd,
|
|||
devices[devcnt].devname = devname;
|
||||
devices[devcnt].major = MAJOR(stb.st_rdev);
|
||||
devices[devcnt].minor = MINOR(stb.st_rdev);
|
||||
devices[devcnt].oldmajor = super.this_disk.major;
|
||||
devices[devcnt].oldminor = super.this_disk.minor;
|
||||
devices[devcnt].events = md_event(&super);
|
||||
devices[devcnt].utime = super.utime;
|
||||
devices[devcnt].raid_disk = super.this_disk.raid_disk;
|
||||
|
@ -379,28 +382,43 @@ int Assemble(char *mddev, int mdfd,
|
|||
|
||||
for (i=0; i<MD_SB_DISKS; i++) {
|
||||
int j = best[i];
|
||||
int active_sync = (1<<MD_DISK_ACTIVE) | (1<<MD_DISK_SYNC);
|
||||
int desired_state;
|
||||
|
||||
if (i < super.raid_disks)
|
||||
desired_state = (1<<MD_DISK_ACTIVE) | (1<<MD_DISK_SYNC);
|
||||
else
|
||||
desired_state = 0;
|
||||
|
||||
if (j<0)
|
||||
continue;
|
||||
if (!devices[j].uptodate)
|
||||
continue;
|
||||
if (devices[j].major != super.disks[j].major ||
|
||||
devices[j].minor != super.disks[j].minor) {
|
||||
#if 0
|
||||
This doesnt work yet
|
||||
if (devices[j].major != super.disks[i].major ||
|
||||
devices[j].minor != super.disks[i].minor) {
|
||||
change |= 1;
|
||||
super.disks[j].major = devices[j].major;
|
||||
super.disks[j].minor = devices[j].minor;
|
||||
super.disks[i].major = devices[j].major;
|
||||
super.disks[i].minor = devices[j].minor;
|
||||
}
|
||||
#endif
|
||||
if (devices[j].oldmajor != super.disks[i].major ||
|
||||
devices[j].oldminor != super.disks[i].minor) {
|
||||
change |= 2;
|
||||
super.disks[i].major = devices[i].oldmajor;
|
||||
super.disks[i].minor = devices[i].oldminor;
|
||||
}
|
||||
if (devices[j].uptodate &&
|
||||
(super.disks[i].state != active_sync)) {
|
||||
(super.disks[i].state != desired_state)) {
|
||||
if (force) {
|
||||
fprintf(stderr, Name ": "
|
||||
"clearing FAULTY flag for device %d in %s for %s\n",
|
||||
j, mddev, devices[j].devname);
|
||||
super.disks[i].state = active_sync;
|
||||
super.disks[i].state = desired_state;
|
||||
change |= 2;
|
||||
} else {
|
||||
fprintf(stderr, Name ": "
|
||||
"device %d in %s is marked faulty in superblock, but %s seems ok\n",
|
||||
"device %d in %s has wrong state in superblock, but %s seems ok\n",
|
||||
i, mddev, devices[j].devname);
|
||||
}
|
||||
}
|
||||
|
|
13
ChangeLog
13
ChangeLog
|
@ -1,4 +1,15 @@
|
|||
Changed Prior to 0.8 release
|
||||
Changes Prior to this release
|
||||
- mdadm.spec updates and ifdef BLKGETSIZE64 from Luca Berra -- bluca@comedia.it
|
||||
- more mdadm.spec updates from Gregory Leblanc <gleblanc@linuxweasel.com>
|
||||
- make directory for mdadm.conf configurable in Makefile
|
||||
- Finished mdadm.conf.5. Removed details of conf file from
|
||||
mdadm.8 leaving a reference to mdadm.conf.5.
|
||||
- Fix bug in Assemble.c, thanks to Junaid Rizvi <domdev@sat.net.pk>
|
||||
- Get --assemble --force to make sure old major/minor numbers are
|
||||
consistant, as md.c worries about this :-(
|
||||
|
||||
|
||||
Changes Prior to 0.7.1 release
|
||||
- update mdadm.spec
|
||||
- use BLKGETSIZE64 if available for array size
|
||||
- give human readable as GiB/MiB and GB and MB, with 2 decimal point precision
|
||||
|
|
5
Detail.c
5
Detail.c
|
@ -83,9 +83,12 @@ int Detail(char *dev, int brief)
|
|||
else {
|
||||
long array_size;
|
||||
long long larray_size;
|
||||
#ifdef BLKGETSIZE64
|
||||
if (ioctl(fd, BLKGETSIZE64, &larray_size)==0)
|
||||
;
|
||||
else if (ioctl(fd, BLKGETSIZE, &array_size)==0)
|
||||
else
|
||||
#endif
|
||||
if (ioctl(fd, BLKGETSIZE, &array_size)==0)
|
||||
larray_size = array_size<<9;
|
||||
else larray_size = 0;
|
||||
|
||||
|
|
12
Makefile
12
Makefile
|
@ -28,7 +28,13 @@
|
|||
#
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall,error,strict-prototypes -ggdb
|
||||
SYSCONFDIR = /etc
|
||||
CONFFILE = $(SYSCONFDIR)/mdadm.conf
|
||||
CFLAGS = -Wall,error,strict-prototypes -ggdb -DCONFFILE=\"$(CONFFILE)\"
|
||||
|
||||
# If you want a static binary, you might uncomment these
|
||||
# LDFLAGS = -static
|
||||
# STRIP = -s
|
||||
|
||||
INSTALL = /usr/bin/install
|
||||
DESTDIR = /.
|
||||
|
@ -40,7 +46,7 @@ OBJS = mdadm.o config.o ReadMe.o util.o Manage.o Assemble.o Build.o Create.o D
|
|||
all : mdadm mdadm.man md.man mdadm.conf.man
|
||||
|
||||
mdadm : $(OBJS)
|
||||
$(CC) -o mdadm $^
|
||||
$(CC) $(LDFLAGS) -o mdadm $^
|
||||
|
||||
mdadm.man : mdadm.8
|
||||
nroff -man mdadm.8 > mdadm.man
|
||||
|
@ -54,7 +60,7 @@ mdadm.conf.man : mdadm.conf.5
|
|||
$(OBJS) : mdadm.h
|
||||
|
||||
install : mdadm mdadm.8
|
||||
$(INSTALL) -m 755 mdadm $(DESTDIR)/$(BINDIR)
|
||||
$(INSTALL) $(STRIP) -m 755 mdadm $(DESTDIR)/$(BINDIR)
|
||||
$(INSTALL) -m 644 mdadm.8 $(DESTDIR)/$(MANDIR)
|
||||
|
||||
clean :
|
||||
|
|
2
ReadMe.c
2
ReadMe.c
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "mdadm.h"
|
||||
|
||||
char Version[] = Name " - v0.7.1 - 8 March 2002\n";
|
||||
char Version[] = Name " - v0.7.2 - 21 March 2002\n";
|
||||
/*
|
||||
* File: ReadMe.c
|
||||
*
|
||||
|
|
5
config.c
5
config.c
|
@ -65,7 +65,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
char DefaultConfFile[] = "/etc/mdadm.conf";
|
||||
#ifndef CONFFILE
|
||||
#define CONFFILE "/etc/mdadm.conf"
|
||||
#endif
|
||||
char DefaultConfFile[] = CONFFILE;
|
||||
|
||||
char *keywords[] = { "device", "array", NULL };
|
||||
|
||||
|
|
4
makedist
4
makedist
|
@ -8,9 +8,9 @@ else echo $target is not a directory
|
|||
fi
|
||||
set `grep '^char Version' ReadMe.c `
|
||||
version=`echo $7 | sed 's/v//'`
|
||||
grep "^Version: $version$" mdadm.spec > /dev/null 2>&1 ||
|
||||
grep "^Version: *$version$" mdadm.spec > /dev/null 2>&1 ||
|
||||
{
|
||||
echo mdadm.conf does not mention version $version.
|
||||
echo mdadm.spec does not mention version $version.
|
||||
exit 1
|
||||
}
|
||||
echo version = $version
|
||||
|
|
41
md.4
41
md.4
|
@ -16,7 +16,7 @@ Array of Independant Devices.
|
|||
.B md
|
||||
support RAID levels 1 (mirroring) 4 (striped array with parity device) and 5
|
||||
(striped array with distributed parity information. If a single underlying
|
||||
device fails while using one of these level, they array will continue
|
||||
device fails while using one of these level, the array will continue
|
||||
to function.
|
||||
.PP
|
||||
.B md
|
||||
|
@ -24,36 +24,65 @@ also supports a number of pseudo RAID (non-redundant) configuations
|
|||
including RAID0 (striped array), LINEAR (catenated array) and
|
||||
MULTIPATH (a set of different interfaces to the same device).
|
||||
|
||||
.SS RAID SUPER BLOCK
|
||||
.SS MD SUPER BLOCK
|
||||
With the exception of Legacy Arrays described below, each device that
|
||||
is incorportated into an MD array has a
|
||||
.I super block
|
||||
written towards the end of the device. This superblock records
|
||||
information about the structure and state of the array so that the
|
||||
array an be reliably re-assembled after a shutdown.
|
||||
array can be reliably re-assembled after a shutdown.
|
||||
|
||||
The superblock is 4K long and is written into a 64K aligned block that
|
||||
start at least 64K and less than 128K from the end of the device
|
||||
starts at least 64K and less than 128K from the end of the device
|
||||
(i.e. to get the address of the superblock round the size of the
|
||||
device down to a multiple of 64K and then subtract 64K).
|
||||
The available size of each device is the ammount of space before the
|
||||
The available size of each device is the amount of space before the
|
||||
super block, so between 64K and 128K is lost when a device in
|
||||
incorporated into an MD array.
|
||||
|
||||
The superblock contains, among other things:
|
||||
.TP
|
||||
LEVEL
|
||||
The
|
||||
The manner in which the devices are arranged into the array
|
||||
(linear, raid0, raid1, raid4, raid5, multipath).
|
||||
.TP
|
||||
UUID
|
||||
a 128 bit Universally Unique Identifier that identifies the array that
|
||||
this device is part of.
|
||||
|
||||
.SS LEGACY ARRAYS
|
||||
Early versions of the
|
||||
.B md
|
||||
driver only supported Linear and Raid0 configurations and so
|
||||
did not use an MD superblock (as there is not state that needs to be
|
||||
recorded). While it is strongly recommended that all newly created
|
||||
arrays utilise a superblock to help ensure that they are assembled
|
||||
properly, the
|
||||
.B md
|
||||
driver still supports legacy linear and raid0 md arrays that
|
||||
do not have a superblock.
|
||||
|
||||
.SS LINEAR
|
||||
|
||||
A linear array simply catenates the available space on each
|
||||
drive together to form one large virtual drive.
|
||||
|
||||
One advantage of this arrangement over the more common RAID0
|
||||
arrangement is that the array may be reconfigured at a later time with
|
||||
an extra drive and so the array is made bigger without disturbing the
|
||||
data that is on the array. However this cannot be done on a live
|
||||
array.
|
||||
|
||||
|
||||
|
||||
.SS RAID0
|
||||
|
||||
A RAID0 array (which has zero redundancy) is also known as a
|
||||
striped array.
|
||||
.SS RAID1
|
||||
.SS RAID4
|
||||
.SS RAID5
|
||||
.SS MUTIPATH
|
||||
.SS REBUILD/RESYNC
|
||||
.SH FILES
|
||||
.TP
|
||||
|
|
42
md.man
42
md.man
|
@ -19,8 +19,8 @@ DDEESSCCRRIIPPTTIIOONN
|
|||
mmdd support RAID levels 1 (mirroring) 4 (striped array with
|
||||
parity device) and 5 (striped array with distributed par-
|
||||
ity information. If a single underlying device fails
|
||||
while using one of these level, they array will continue
|
||||
to function.
|
||||
while using one of these level, the array will continue to
|
||||
function.
|
||||
|
||||
mmdd also supports a number of pseudo RAID (non-redundant)
|
||||
configuations including RAID0 (striped array), LINEAR
|
||||
|
@ -28,36 +28,64 @@ DDEESSCCRRIIPPTTIIOONN
|
|||
faces to the same device).
|
||||
|
||||
|
||||
RRAAIIDD SSUUPPEERR BBLLOOCCKK
|
||||
MMDD SSUUPPEERR BBLLOOCCKK
|
||||
With the exception of Legacy Arrays described below, each
|
||||
device that is incorportated into an MD array has a _s_u_p_e_r
|
||||
_b_l_o_c_k written towards the end of the device. This
|
||||
superblock records information about the structure and
|
||||
state of the array so that the array an be reliably re-
|
||||
state of the array so that the array can be reliably re-
|
||||
assembled after a shutdown.
|
||||
|
||||
The superblock is 4K long and is written into a 64K
|
||||
aligned block that start at least 64K and less than 128K
|
||||
aligned block that starts at least 64K and less than 128K
|
||||
from the end of the device (i.e. to get the address of the
|
||||
superblock round the size of the device down to a multiple
|
||||
of 64K and then subtract 64K). The available size of each
|
||||
device is the ammount of space before the super block, so
|
||||
device is the amount of space before the super block, so
|
||||
between 64K and 128K is lost when a device in incorporated
|
||||
into an MD array.
|
||||
|
||||
The superblock contains, among other things:
|
||||
|
||||
LEVEL The
|
||||
LEVEL The manner in which the devices are arranged into
|
||||
the array (linear, raid0, raid1, raid4, raid5, mul-
|
||||
tipath).
|
||||
|
||||
UUID a 128 bit Universally Unique Identifier that iden-
|
||||
tifies the array that this device is part of.
|
||||
|
||||
|
||||
LLEEGGAACCYY AARRRRAAYYSS
|
||||
Early versions of the mmdd driver only supported Linear and
|
||||
Raid0 configurations and so did not use an MD superblock
|
||||
(as there is not state that needs to be recorded). While
|
||||
it is strongly recommended that all newly created arrays
|
||||
utilise a superblock to help ensure that they are assem-
|
||||
bled properly, the mmdd driver still supports legacy linear
|
||||
and raid0 md arrays that do not have a superblock.
|
||||
|
||||
|
||||
LLIINNEEAARR
|
||||
A linear array simply catenates the available space on
|
||||
each drive together to form one large virtual drive.
|
||||
|
||||
One advantage of this arrangement over the more common
|
||||
RAID0 arrangement is that the array may be reconfigured at
|
||||
a later time with an extra drive and so the array is made
|
||||
bigger without disturbing the data that is on the array.
|
||||
However this cannot be done on a live array.
|
||||
|
||||
|
||||
|
||||
|
||||
RRAAIIDD00
|
||||
A RAID0 array (which has zero redundancy) is also known as
|
||||
a striped array.
|
||||
|
||||
RRAAIIDD11
|
||||
RRAAIIDD44
|
||||
RRAAIIDD55
|
||||
MMUUTTIIPPAATTHH
|
||||
RREEBBUUIILLDD//RREESSYYNNCC
|
||||
FFIILLEESS
|
||||
//pprroocc//mmddssttaatt
|
||||
|
|
70
mdadm.8
70
mdadm.8
|
@ -36,7 +36,8 @@ Recent kernels (2002) also support a mode known as
|
|||
does not support MULTIPATH as yet.
|
||||
|
||||
.B mdadm
|
||||
is a program that can be used to create and manage MD devices. As
|
||||
is a program that can be used to create, manage, and monitor
|
||||
MD devices. As
|
||||
such it provides a similar set of functionality to the
|
||||
.B raidtools
|
||||
packages.
|
||||
|
@ -479,69 +480,12 @@ This file is not currently used by
|
|||
|
||||
.SS /etc/mdadm.conf
|
||||
|
||||
The config file is line oriented with, as usual, blank lines and lines
|
||||
beginning with a hash (or pound sign or sharp or number sign,
|
||||
whichever you like to call it) ignored.
|
||||
Lines that start with a blank are treated as continuations of the
|
||||
previous line (I don't like trailing slashes).
|
||||
The config file lists which devices may be scanned to see if
|
||||
they contain MD super block, and gives identifying information
|
||||
(e.g. UUID) about known MD arrays. See
|
||||
.BR mdadm.conf (5)
|
||||
for more details.
|
||||
|
||||
Each line contains a sequence of space-separated words, the first of
|
||||
which identified the type of line. Keywords are case-insensitive, and
|
||||
the first work on a line can be abbreviated to 3 letters.
|
||||
|
||||
There are two types of lines. ARRAY and DEVICE.
|
||||
|
||||
The DEVICE lines usually come first. All remaining words on the line
|
||||
are treated as names of devices, possibly containing wild cards (see
|
||||
.IR glob (7)).
|
||||
These list all the devices that
|
||||
.B mdadm
|
||||
is allowed to scan
|
||||
when looking for devices with RAID superblocks.
|
||||
Each line can contain multiple device names, and there can be multiple
|
||||
DEVICE lines. For example:
|
||||
.IP
|
||||
DEVICE /dev/hda* /dev/hdc*
|
||||
.br
|
||||
DEV /dev/sd*
|
||||
.br
|
||||
DEVICE /dev/discs/disc*/disc
|
||||
.PP
|
||||
The ARRAY lines identify actual arrays. The second word on the line
|
||||
should be the name of the device where the array is normally
|
||||
assembled, such as /dev/md1.
|
||||
Subsequent words identify the array. If multiple identities are given,
|
||||
then the array much match ALL identities to be considered a match.
|
||||
Each identity word has a tag, and equals sign, and some value.
|
||||
The options are:
|
||||
|
||||
.TP
|
||||
.B uuid=
|
||||
The value should be a 128 bit uuid in hexadecimal, with punctuation
|
||||
interspersed if desired. This must match the uuid stored in the
|
||||
superblock.
|
||||
.TP
|
||||
.B super-minor=
|
||||
The value is an integer which indicates the minor number that was
|
||||
stored in the superblock when the array was created. When an array is
|
||||
created as /dev/mdX, then the minor number X is stored.
|
||||
.TP
|
||||
.B devices=
|
||||
The value is a comma separated list of device names. Precisely these
|
||||
devices will be used to assemble the array. Note that the devices
|
||||
listed there must also be listed on a DEVICE line.
|
||||
.TP
|
||||
.B level=
|
||||
The value is a raid level. This is normally used to identify an
|
||||
array, but is supported so that the output of
|
||||
.B "mdadm --examine --scan"
|
||||
can be use directly in the configuration file.
|
||||
.TP
|
||||
.B disks=
|
||||
The value is the number of disks in a complete active array. As with
|
||||
.B level=
|
||||
this is mainly for compatibility with the output of
|
||||
.BR "mdadm --examine --scan" .
|
||||
|
||||
.SH TODO
|
||||
|
||||
|
|
58
mdadm.conf.5
58
mdadm.conf.5
|
@ -6,17 +6,17 @@ mdadm.conf \- configuration for management of Software Raid with mdadm
|
|||
.SH DESCRIPTION
|
||||
.PP
|
||||
.B mdadm
|
||||
is a tools for creating an managing RAID devices using the
|
||||
is a tool for creating, managing, and monitoring RAID devices using the
|
||||
.B md
|
||||
driver in Linux.
|
||||
.PP
|
||||
Some common tasks, such as assembling all arrays, can be simplified
|
||||
by describing the devices and array in this configuations file.
|
||||
by describing the devices and array in this configuation file.
|
||||
|
||||
.SS SYNTAX
|
||||
The file should be seen as a collection of words separated by white
|
||||
space (space, tab, or newline).
|
||||
Any word that being with a hash sign (#) starts a comment and that
|
||||
Any word that beings with a hash sign (#) starts a comment and that
|
||||
word together with the remainder of the line are ignored.
|
||||
|
||||
Any line that start with white space (space or tab) is treated as
|
||||
|
@ -45,10 +45,58 @@ and each device name can contain wild cards as defined by
|
|||
|
||||
Also, there may be several device lines present in the file.
|
||||
|
||||
For example:
|
||||
.IP
|
||||
DEVICE /dev/hda* /dev/hdc*
|
||||
.br
|
||||
DEV /dev/sd*
|
||||
.br
|
||||
DEVICE /dev/discs/disc*/disc
|
||||
|
||||
.TP
|
||||
.B ARRAY
|
||||
The ARRAY lines identify actual arrays. The second word on the line
|
||||
should be the name of the device where the array is normally
|
||||
assembled, such as
|
||||
.BR /dev/md1 .
|
||||
Subsequent words identify the array. If multiple identities are given,
|
||||
then the array must match ALL identities to be considered a match.
|
||||
Each identity word has a tag, and equals sign, and some value.
|
||||
The options are:
|
||||
|
||||
.RS 4
|
||||
.TP
|
||||
.B uuid=
|
||||
The value should be a 128 bit uuid in hexadecimal, with punctuation
|
||||
interspersed if desired. This must match the uuid stored in the
|
||||
superblock.
|
||||
.TP
|
||||
.B super-minor=
|
||||
The value is an integer which indicates the minor number that was
|
||||
stored in the superblock when the array was created. When an array is
|
||||
created as /dev/mdX, then the minor number X is stored.
|
||||
.TP
|
||||
.B devices=
|
||||
The value is a comma separated list of device names. Precisely these
|
||||
devices will be used to assemble the array. Note that the devices
|
||||
listed there must also be listed on a DEVICE line.
|
||||
.TP
|
||||
.B level=
|
||||
The value is a raid level. This is not normally used to
|
||||
identify an array, but is supported so that the output of
|
||||
|
||||
.B "mdadm --examine --scan"
|
||||
|
||||
can be use directly in the configuration file.
|
||||
.TP
|
||||
.B disks=
|
||||
The value is the number of disks in a complete active array. As with
|
||||
.B level=
|
||||
this is mainly for compatibility with the output of
|
||||
|
||||
.BR "mdadm --examine --scan" .
|
||||
.RE
|
||||
.SH SEE ALSO
|
||||
mdadm (8),
|
||||
md (4).
|
||||
.BR mdadm (8),
|
||||
.BR md (4).
|
||||
|
||||
|
|
|
@ -10,18 +10,18 @@ SSYYNNOOPPSSIISS
|
|||
/etc/mdadm.conf
|
||||
|
||||
DDEESSCCRRIIPPTTIIOONN
|
||||
mmddaaddmm is a tools for creating an managing RAID devices
|
||||
using the mmdd driver in Linux.
|
||||
mmddaaddmm is a tool for creating, managing, and monitoring
|
||||
RAID devices using the mmdd driver in Linux.
|
||||
|
||||
Some common tasks, such as assembling all arrays, can be
|
||||
simplified by describing the devices and array in this
|
||||
configuations file.
|
||||
configuation file.
|
||||
|
||||
|
||||
SSYYNNTTAAXX
|
||||
The file should be seen as a collection of words separated
|
||||
by white space (space, tab, or newline). Any word that
|
||||
being with a hash sign (#) starts a comment and that word
|
||||
beings with a hash sign (#) starts a comment and that word
|
||||
together with the remainder of the line are ignored.
|
||||
|
||||
Any line that start with white space (space or tab) is
|
||||
|
@ -47,11 +47,58 @@ DDEESSCCRRIIPPTTIIOONN
|
|||
Also, there may be several device lines present in
|
||||
the file.
|
||||
|
||||
For example:
|
||||
|
||||
AARRRRAAYY
|
||||
DEVICE /dev/hda* /dev/hdc*
|
||||
DEV /dev/sd*
|
||||
DEVICE /dev/discs/disc*/disc
|
||||
|
||||
|
||||
AARRRRAAYY The ARRAY lines identify actual arrays. The second
|
||||
word on the line should be the name of the device
|
||||
where the array is normally assembled, such as
|
||||
//ddeevv//mmdd11. Subsequent words identify the array. If
|
||||
multiple identities are given, then the array must
|
||||
match ALL identities to be considered a match.
|
||||
Each identity word has a tag, and equals sign, and
|
||||
some value. The options are:
|
||||
|
||||
|
||||
uuuuiidd== The value should be a 128 bit uuid in hexadeci-
|
||||
mal, with punctuation interspersed if desired.
|
||||
This must match the uuid stored in the
|
||||
superblock.
|
||||
|
||||
ssuuppeerr--mmiinnoorr==
|
||||
The value is an integer which indicates the
|
||||
minor number that was stored in the superblock
|
||||
when the array was created. When an array is
|
||||
created as /dev/mdX, then the minor number X is
|
||||
stored.
|
||||
|
||||
ddeevviicceess==
|
||||
The value is a comma separated list of device
|
||||
names. Precisely these devices will be used to
|
||||
assemble the array. Note that the devices
|
||||
listed there must also be listed on a DEVICE
|
||||
line.
|
||||
|
||||
lleevveell== The value is a raid level. This is not nor-
|
||||
mally used to identify an array, but is sup-
|
||||
ported so that the output of
|
||||
|
||||
mmddaaddmm ----eexxaammiinnee ----ssccaann
|
||||
|
||||
can be use directly in the configuration file.
|
||||
|
||||
ddiisskkss== The value is the number of disks in a complete
|
||||
active array. As with lleevveell== this is mainly
|
||||
for compatibility with the output of
|
||||
|
||||
mmddaaddmm ----eexxaammiinnee ----ssccaann.
|
||||
|
||||
SSEEEE AALLSSOO
|
||||
mdadm (8), md (4).
|
||||
mmddaaddmm(8), mmdd(4).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,423 @@
|
|||
mdadm(8) mdadm(8)
|
||||
|
||||
|
||||
|
||||
NNAAMMEE
|
||||
mdadm - manage MD devices _a_k_a Linux Software Raid.
|
||||
|
||||
|
||||
SSYYNNOOPPSSIISS
|
||||
mmddaaddmm _[_m_o_d_e_] _<_r_a_i_d_d_e_v_i_c_e_> _[_o_p_t_i_o_n_s_] _<_s_u_b_d_e_v_i_c_e_s_>
|
||||
|
||||
|
||||
DDEESSCCRRIIPPTTIIOONN
|
||||
RAID devices are virtual devices created from two or more
|
||||
real block devices. This allows multiple devices (typi-
|
||||
cally disk drives or partitions there-of) to be combined
|
||||
into a single device to hold (for example) a single
|
||||
filesystem. Some RAID levels included redundancy and so
|
||||
can survive some degree of device failure.
|
||||
|
||||
Linux Software RAID devices are implemented through the md
|
||||
(Multiple Devices) device driver.
|
||||
|
||||
Currently, Linux supports LLIINNEEAARR md devices, RRAAIIDD00 (strip-
|
||||
ing), RRAAIIDD11 (mirroring), RRAAIIDD44 and RRAAIIDD55..
|
||||
|
||||
Recent kernels (2002) also support a mode known as MMUULLTTII--
|
||||
PPAATTHH. mmddaaddmm does not support MULTIPATH as yet.
|
||||
|
||||
mmddaaddmm is a program that can be used to create, manage, and
|
||||
monitor MD devices. As such it provides a similar set of
|
||||
functionality to the rraaiiddttoooollss packages. The key differ-
|
||||
ences between mmddaaddmm and rraaiiddttoooollss are:
|
||||
|
||||
+o mmddaaddmm is a single program and not a collection of pro-
|
||||
grams.
|
||||
|
||||
+o mmddaaddmm can perform (almost) all of its functions with-
|
||||
out having a configuration file. Also mdadm helps
|
||||
with management of the configuration file.
|
||||
|
||||
+o mmddaaddmm can provide information about your arrays
|
||||
(through Detail and Examine) that rraaiiddttoooollss cannot.
|
||||
|
||||
+o rraaiiddttoooollss can manage MULTIPATH devices which mmddaaddmm
|
||||
cannot yet manage.
|
||||
|
||||
|
||||
MMOODDEESS
|
||||
mdadm has 7 major modes of operation:
|
||||
|
||||
AAsssseemmbbllee
|
||||
Assemble the parts of a previously created array
|
||||
into an active array. Components can be explicitly
|
||||
given or can be searched for. mmddaaddmm checks that
|
||||
the components do form a bona fide array, and can,
|
||||
on request, fiddle superblock information so as to
|
||||
assemble a faulty array.
|
||||
|
||||
|
||||
BBuuiilldd Build a legacy array without per-device
|
||||
superblocks.
|
||||
|
||||
|
||||
CCrreeaattee Create a new array with per-device superblocks.
|
||||
|
||||
|
||||
DDeettaaiill Display the details of a given md device. Details
|
||||
include the RAID level, the number of devices,
|
||||
which ones are faulty (if any), and the array UUID.
|
||||
|
||||
|
||||
EExxaammiinnee
|
||||
Examine a device to see if it is part of an md
|
||||
array, and print out the details of that array.
|
||||
This mode can also be used to examine a large num-
|
||||
ber of devices and to print out a summary of the
|
||||
arrays found in a format suitable for the
|
||||
mmddaaddmm..ccoonnff configuration file.
|
||||
|
||||
|
||||
FFoollllooww oorr MMoonniittoorr
|
||||
Monitor one or more md devices and act on any state
|
||||
changes.
|
||||
|
||||
|
||||
MMaannaaggee This is for odd bits an pieces like hotadd,
|
||||
hotremove, setfaulty, stop, readonly, readwrite.
|
||||
|
||||
|
||||
OOPPTTIIOONNSS
|
||||
Available options are:
|
||||
|
||||
|
||||
--AA, ----aasssseemmbbllee
|
||||
Assemble an existing array.
|
||||
|
||||
|
||||
--BB, ----bbuuiilldd
|
||||
Build a legacy array without superblocks.
|
||||
|
||||
|
||||
--CC, ----ccrreeaattee
|
||||
Create a new array.
|
||||
|
||||
|
||||
--DD, ----ddeettaaiill
|
||||
Print detail of one or more md devices.
|
||||
|
||||
|
||||
--EE, ----eexxaammiinnee
|
||||
Print content of md superblock on device(s).
|
||||
|
||||
|
||||
--FF, ----ffoollllooww, ----mmoonniittoorr
|
||||
Select MMoonniittoorr mode.
|
||||
|
||||
|
||||
--hh, ----hheellpp
|
||||
Display help message or, after above option, mode
|
||||
specific help message.
|
||||
|
||||
|
||||
--VV, ----vveerrssiioonn
|
||||
Print version information for mdadm.
|
||||
|
||||
|
||||
--vv, ----vveerrbboossee
|
||||
Be more verbose about what is happening.
|
||||
|
||||
|
||||
--bb, ----bbrriieeff
|
||||
Be less verbose. This is used with ----ddeettaaiill and
|
||||
----eexxaammiinnee.
|
||||
|
||||
|
||||
FFoorr ccrreeaattee oorr bbuuiilldd::
|
||||
--cc, ----cchhuunnkk==
|
||||
Specify chunk size of kibibytes. The default is
|
||||
64.
|
||||
|
||||
|
||||
----rroouunnddiinngg==
|
||||
Specify rounding factor for linear array (==chunk
|
||||
size)
|
||||
|
||||
|
||||
--ll, ----lleevveell==
|
||||
Set raid level. Options are: linear, raid0, 0,
|
||||
stripe, raid1, 1, mirror, raid5, 4, raid5, 5.
|
||||
Obviously some of these are synonymous. Only the
|
||||
first 4 are valid when Building.
|
||||
|
||||
|
||||
--pp, ----ppaarriittyy==
|
||||
Set raid5 parity algorithm. Options are:
|
||||
{left,right}-{,a}symmetric, la, ra, ls, rs. The
|
||||
default is left-symmetric.
|
||||
|
||||
|
||||
----llaayyoouutt==
|
||||
same as --parity
|
||||
|
||||
|
||||
--nn, ----rraaiidd--ddiisskkss==
|
||||
number of active devices in array.
|
||||
|
||||
|
||||
--xx, ----ssppaarree--ddiisskkss==
|
||||
number of spare (eXtra) disks in initial array.
|
||||
Spares can be added and removed later.
|
||||
|
||||
|
||||
--zz, ----ssiizzee==
|
||||
Amount (in Kibibytes) of space to use from each
|
||||
drive in RAID1/4/5. This must be a multiple of the
|
||||
chunk size, and must leave about 128Kb of space at
|
||||
the end of the drive for the RAID superblock. If
|
||||
this is not specified (as it normally is not) the
|
||||
smallest drive (or partition) sets the size, though
|
||||
if there is a variance among the drives of greater
|
||||
than 1%, a warning is issued.
|
||||
|
||||
|
||||
FFoorr aasssseemmbbllee::
|
||||
--uu, ----uuuuiidd==
|
||||
uuid of array to assemble. Devices which don't have
|
||||
this uuid are excluded
|
||||
|
||||
|
||||
--mm, ----ssuuppeerr--mmiinnoorr==
|
||||
Minor number of device that array was created for.
|
||||
Devices which don't have this minor number are
|
||||
excluded. If you create an array as /dev/md1, then
|
||||
all superblock will contain the minor number 1,
|
||||
even if the array is later assembled as /dev/md2.
|
||||
|
||||
|
||||
--cc, ----ccoonnffiigg==
|
||||
config file. Default is //eettcc//mmddaaddmm..ccoonnff.
|
||||
|
||||
|
||||
--ss, ----ssccaann
|
||||
scan config file for missing information
|
||||
|
||||
|
||||
--ff, ----ffoorrccee
|
||||
Assemble the array even if some superblocks appear
|
||||
out-of-date
|
||||
|
||||
|
||||
--RR, ----rruunn
|
||||
Attempt to start the array even if fewer drives
|
||||
were given than are needed for a full array. Nor-
|
||||
mally if not all drives are found and ----ssccaann is not
|
||||
used, then the array will be assembled but not
|
||||
started. With ----rruunn an attempt will be made to
|
||||
start it anyway.
|
||||
|
||||
|
||||
GGeenneerraall mmaannaaggeemmeenntt
|
||||
--aa, ----aadddd
|
||||
hotadd listed devices.
|
||||
|
||||
|
||||
--rr, ----rreemmoovvee
|
||||
remove listed devices. The must not be active.
|
||||
i.e. they should be failed or spare devices.
|
||||
|
||||
|
||||
--ff, ----ffaaiill
|
||||
mark listed devices as faulty.
|
||||
|
||||
|
||||
----sseett--ffaauullttyy
|
||||
same as --fail.
|
||||
|
||||
|
||||
--RR, ----rruunn
|
||||
start a partially built array.
|
||||
|
||||
|
||||
--SS, ----ssttoopp
|
||||
deactivate array, releasing all resources.
|
||||
|
||||
|
||||
--oo, ----rreeaaddoonnllyy
|
||||
mark array as readonly.
|
||||
|
||||
|
||||
--ww, ----rreeaaddwwrriittee
|
||||
mark array as readwrite.
|
||||
|
||||
|
||||
|
||||
AASSSSEEMMBBLLYY MMOODDEE
|
||||
Usage: mmddaaddmm ----aasssseemmbbllee _d_e_v_i_c_e _o_p_t_i_o_n_s_._._.
|
||||
|
||||
Usage: mmddaaddmm ----aasssseemmbbllee ----ssccaann _o_p_t_i_o_n_s_._._.
|
||||
|
||||
|
||||
This usage assembles one or more raid arrays from pre-
|
||||
existing components. For each array, mdadm needs to know
|
||||
the md device, the identity of the array, and a number of
|
||||
sub devices. These can be found in a number of ways.
|
||||
|
||||
The md device is either given before ----ssccaann or is found
|
||||
from the config file. In the latter case, multiple md
|
||||
devices can be started with a single mdadm command.
|
||||
|
||||
The identity can be given with the ----uuuuiidd option, with the
|
||||
----ssuuppeerr--mmiinnoorr option, can be found in in the config file,
|
||||
or will be taken from the super block on the first subde-
|
||||
vice listed on the command line.
|
||||
|
||||
Devices can be given on the ----aasssseemmbbllee command line or
|
||||
from the config file. Only devices which have an md
|
||||
superblock which contains the right identity will be con-
|
||||
sidered for any device.
|
||||
|
||||
The config file is only used if explicitly named with
|
||||
----ccoonnffiigg or requested with ----ssccaann.. In the later case,
|
||||
//eettcc//mmddaaddmm..ccoonnff is used.
|
||||
|
||||
If ----ssccaann is not given, then the config file will only be
|
||||
used to find the identity of md arrays.
|
||||
|
||||
Normally the array will be started after it is assembled.
|
||||
However is ----ssccaann is not given and insufficient drives
|
||||
were lists to start a complete (non-degraded) array, then
|
||||
the array is not started (to guard against usage errors).
|
||||
To insist that the array be started in this case (as may
|
||||
work for RAID1 or RAID5), give the ----rruunn flag.
|
||||
|
||||
|
||||
|
||||
BBUUIILLDD MMOODDEE
|
||||
Usage: mmddaaddmm ----bbuuiilldd _d_e_v_i_c_e ----cchhuunnkk==_X ----lleevveell==_Y ----rraaiidd--
|
||||
ddiisskkss==_Z _d_e_v_i_c_e_s
|
||||
|
||||
|
||||
This usage is similar to ----ccrreeaattee. The difference is that
|
||||
it creates a legacy array without a superblock. With these
|
||||
arrays there is no difference between initially creating
|
||||
the array and subsequently assembling the array, except
|
||||
that hopefully there is useful data there in the second
|
||||
case.
|
||||
|
||||
The level may only be 0, raid0, or linear. All devices
|
||||
must be listed and the array will be started once com-
|
||||
plete.
|
||||
|
||||
|
||||
CCRREEAATTEE MMOODDEE
|
||||
Usage: mmddaaddmm ----ccrreeaattee _d_e_v_i_c_e ----cchhuunnkk==_X ----lleevveell==_Y
|
||||
----rraaiidd--ddiisskkss==_Z _d_e_v_i_c_e_s
|
||||
|
||||
|
||||
This usage will initialise a new md array, associate some
|
||||
devices with it, and activate the array.
|
||||
|
||||
As devices are added, they are checked to see if they con-
|
||||
tain raid superblocks or filesystems. They are also check
|
||||
to see if the variance in device size exceeds 1%.
|
||||
|
||||
If any discrepancy is found, the array will not automati-
|
||||
cally be run, though the presence of a ----rruunn can override
|
||||
this caution.
|
||||
|
||||
|
||||
The General Management options that are valid with --cre-
|
||||
ate are:
|
||||
|
||||
----rruunn insist of running the array even if some devices
|
||||
look like they might be in use.
|
||||
|
||||
|
||||
----rreeaaddoonnllyy
|
||||
start the array readonly - not supported yet.
|
||||
|
||||
|
||||
DDEETTAAIILL MMOODDEE
|
||||
Usage: mmddaaddmm ----ddeettaaiill [----bbrriieeff] _d_e_v_i_c_e _._._.
|
||||
|
||||
|
||||
This usage sill print out the details of the given array
|
||||
including a list of component devices. To determine names
|
||||
for the devices, mmddaaddmm searches //ddeevv for device files with
|
||||
the right major and minor numbers.
|
||||
|
||||
With ----bbrriieeff mmddaaddmm prints a single line that identifies
|
||||
the level, number of disks, and UUID of the array. This
|
||||
line is suitable for inclusion in //eettcc//mmddaaddmm..ccoonnff.
|
||||
|
||||
|
||||
EEXXAAMMIINNEE MMOODDEE
|
||||
Usage: mmddaaddmm ----eexxaammiinnee [----ssccaann] [----bbrriieeff] _d_e_v_i_c_e _._._.
|
||||
|
||||
This usage will examine some block devices to see if that
|
||||
have a valid RAID superblock on them. The information in
|
||||
each valid raid superblock will be printed.
|
||||
|
||||
If ----ssccaann is used, the no devices should be listed, and
|
||||
the complete set of devices identified in the configura-
|
||||
tion file are checked. ----ssccaann implies ----bbrriieeff but this
|
||||
implication can be countered by specifying ----vveerrbboossee.
|
||||
|
||||
With ----bbrriieeff mmddaaddmm will output an config file entry of
|
||||
each distinct array that was found. This entry will list
|
||||
the UUID, the raid level, and a list of the individual
|
||||
devices on which a superblock for that array was found.
|
||||
This output will by syntactically suitable for inclusion
|
||||
in the configuration file, but should NNOOTT be used blindly.
|
||||
Often the array description that you want in the configu-
|
||||
ration file is much less specific than that given by mmddaaddmm
|
||||
--BBss. For example, you normally do not want to list the
|
||||
devices, particularly if they are SCSI devices.
|
||||
|
||||
|
||||
|
||||
FFIILLEESS
|
||||
//pprroocc//mmddssttaatt
|
||||
If you're using the //pprroocc filesystem, //pprroocc//mmddssttaatt gives
|
||||
you informations about md devices status. This file is
|
||||
not currently used by mmddaaddmm.
|
||||
|
||||
|
||||
//eettcc//mmddaaddmm..ccoonnff
|
||||
The config file lists which devices may be scanned to see
|
||||
if they contain MD super block, and gives identifying
|
||||
information (e.g. UUID) about known MD arrays. See
|
||||
mmddaaddmm..ccoonnff(5) for more details.
|
||||
|
||||
|
||||
|
||||
TTOODDOO
|
||||
Finish and document Follow mode.
|
||||
|
||||
|
||||
SSEEEE AALLSSOO
|
||||
For information on the various levels of RAID, check out:
|
||||
|
||||
|
||||
http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
|
||||
|
||||
for new releases of the RAID driver check out:
|
||||
|
||||
|
||||
ftp://ftp.kernel.org/pub/linux/kernel/peo-
|
||||
ple/mingo/raid-patches
|
||||
|
||||
or
|
||||
|
||||
http://www.cse.unsw.edu.au/~neilb/patches/linux-
|
||||
stable/
|
||||
|
||||
mmddaaddmm..ccoonnff(5), mmdd(4).
|
||||
|
||||
_r_a_i_d_t_a_b(5), _r_a_i_d_0_r_u_n(8), _r_a_i_d_s_t_o_p(8), _m_k_r_a_i_d(8)
|
||||
|
||||
|
||||
|
||||
mdadm(8)
|
71
mdadm.spec
71
mdadm.spec
|
@ -1,28 +1,23 @@
|
|||
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
|
||||
Name: mdadm
|
||||
Version: 0.7.1
|
||||
Release: 1
|
||||
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
|
||||
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
|
||||
Copyright: GPL
|
||||
Group: Utilities/System
|
||||
BuildRoot: /var/tmp/%{name}-root
|
||||
Packager: Danilo Godec <danci@agenda.si>
|
||||
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
|
||||
Name: mdadm
|
||||
Version: 0.7.2
|
||||
Release: 1
|
||||
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
|
||||
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
|
||||
License: GPL
|
||||
Group: Utilities/System
|
||||
BuildRoot: ${_tmppath}/%{name}-root
|
||||
Packager: Danilo Godec <danci@agenda.si> (et.al.)
|
||||
Obsoletes: mdctl
|
||||
|
||||
%description
|
||||
mdadm is a single program that can be used to control Linux md devices. It
|
||||
is intended to provide all the functionality of the mdtools and raidtools
|
||||
but with a very different interface.
|
||||
|
||||
mdadm can perform all functions without a configuration file. There is the
|
||||
option of using a configuration file, but not in the same way that raidtools
|
||||
uses one.
|
||||
|
||||
raidtools uses a configuration file to describe how to create a RAID array,
|
||||
and also uses this file partially to start a previously created RAID array.
|
||||
Further, raidtools requires the configuration file for such things as
|
||||
stopping a raid array, which needs to know nothing about the array.
|
||||
|
||||
mdadm is a program that can be used to create, manage, and monitor
|
||||
Linux MD (Software RAID) devices.
|
||||
As such is provides similar functionality to the raidtools packages.
|
||||
The particular differences to raidtools is that mdadm is a single
|
||||
program, and it can perform (almost) all functions without a
|
||||
configuration file (that a config file can be used to help with
|
||||
some common tasks).
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
@ -32,14 +27,14 @@ stopping a raid array, which needs to know nothing about the array.
|
|||
# people who install RPMs (especially given that the default RPM options
|
||||
# will strip the binary) are not going to be running gdb against the
|
||||
# program.
|
||||
make CFLAGS="$RPM_OPT_FLAGS"
|
||||
make CFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}"
|
||||
|
||||
%install
|
||||
#rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||
install -m755 mdadm $RPM_BUILD_ROOT/sbin/
|
||||
mkdir -p $RPM_BUILD_ROOT/etc
|
||||
install -m644 mdadm.conf-example $RPM_BUILD_ROOT/etc/mdadm.conf
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
|
||||
install -m755 mdadm $RPM_BUILD_ROOT/%{_sbindir}
|
||||
mkdir -p $RPM_BUILD_ROOT/${_sysconfdir}
|
||||
install -m644 mdadm.conf-example $RPM_BUILD_ROOT/%{_sysconfdir}/mdadm.conf
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man4
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man5
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8
|
||||
|
@ -52,17 +47,31 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc TODO ChangeLog mdadm.man mdadm.conf-example
|
||||
/sbin/mdadm
|
||||
/etc/mdadm.conf
|
||||
%doc TODO ChangeLog mdadm.man mdadm.conf-example COPYING
|
||||
%{_sbindir}/mdadm
|
||||
%config(noreplace,missingok)/%{_sysconfdir}/mdadm.conf
|
||||
%{_mandir}/man*/md*
|
||||
|
||||
%changelog
|
||||
* Fri Mar 15 2002 <gleblanc@localhost.localdomain>
|
||||
- beautification
|
||||
- made mdadm.conf non-replaceable config
|
||||
- renamed Copyright to License in the header
|
||||
- added missing license file
|
||||
- used macros for file paths
|
||||
|
||||
* Fri Mar 15 2002 Luca Berra <bluca@comedia.it>
|
||||
- Added Obsoletes: mdctl
|
||||
- missingok for configfile
|
||||
|
||||
* Wed Mar 12 2002 NeilBrown <neilb@cse.unsw.edu.au>
|
||||
- Add md.4 and mdadm.conf.5 man pages
|
||||
|
||||
* Fri Mar 08 2002 Chris Siebenmann <cks@cquest.utoronto.ca>
|
||||
- builds properly as non-root.
|
||||
|
||||
* Fri Mar 08 2002 Derek Vadala <derek@cynicism.com>
|
||||
- updated for 0.7, fixed /usr/share/doc and added manpage
|
||||
|
||||
* Tue Aug 07 2001 Danilo Godec <danci@agenda.si>
|
||||
- initial RPM build
|
||||
|
|
Loading…
Reference in New Issue