mdadm-0.7.1
This commit is contained in:
parent
9a9dab3670
commit
56eb10c0b6
|
@ -1,4 +1,11 @@
|
||||||
|
Changed Prior to 0.8 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
|
||||||
|
- Only warn about size variation for raid1/4/5.
|
||||||
|
- Started md.4 man page
|
||||||
|
- Started mdadm.conf.5 man page
|
||||||
|
|
||||||
Changes Prior to 0.7 release
|
Changes Prior to 0.7 release
|
||||||
|
|
||||||
- Fix makefile to install binary at /sbin and not /sbin/sbin
|
- Fix makefile to install binary at /sbin and not /sbin/sbin
|
||||||
|
|
2
Create.c
2
Create.c
|
@ -193,7 +193,7 @@ int Create(char *mddev, int mdfd,
|
||||||
if (verbose && level>0)
|
if (verbose && level>0)
|
||||||
fprintf(stderr, Name ": size set to %dK\n", size);
|
fprintf(stderr, Name ": size set to %dK\n", size);
|
||||||
}
|
}
|
||||||
if ((maxsize-size)*100 > maxsize) {
|
if (level >= 1 && ((maxsize-size)*100 > maxsize)) {
|
||||||
fprintf(stderr, Name ": largest drive (%s) exceed size (%dK) by more than 1%\n",
|
fprintf(stderr, Name ": largest drive (%s) exceed size (%dK) by more than 1%\n",
|
||||||
maxdisc, size);
|
maxdisc, size);
|
||||||
warn = 1;
|
warn = 1;
|
||||||
|
|
18
Detail.c
18
Detail.c
|
@ -81,20 +81,24 @@ int Detail(char *dev, int brief)
|
||||||
if (brief)
|
if (brief)
|
||||||
printf("ARRAY %s level=%s disks=%d", dev, c?c:"-unknown-",array.raid_disks );
|
printf("ARRAY %s level=%s disks=%d", dev, c?c:"-unknown-",array.raid_disks );
|
||||||
else {
|
else {
|
||||||
int array_size;
|
long array_size;
|
||||||
if (ioctl(fd, BLKGETSIZE, &array_size))
|
long long larray_size;
|
||||||
array_size = 0;
|
if (ioctl(fd, BLKGETSIZE64, &larray_size)==0)
|
||||||
else array_size>>= 1;
|
;
|
||||||
|
else if (ioctl(fd, BLKGETSIZE, &array_size)==0)
|
||||||
|
larray_size = array_size<<9;
|
||||||
|
else larray_size = 0;
|
||||||
|
|
||||||
printf("%s:\n", dev);
|
printf("%s:\n", dev);
|
||||||
printf(" Version : %02d.%02d.%02d\n",
|
printf(" Version : %02d.%02d.%02d\n",
|
||||||
array.major_version, array.minor_version, array.patch_version);
|
array.major_version, array.minor_version, array.patch_version);
|
||||||
atime = array.ctime;
|
atime = array.ctime;
|
||||||
printf(" Creation Time : %.24s\n", ctime(&atime));
|
printf(" Creation Time : %.24s\n", ctime(&atime));
|
||||||
printf(" Raid Level : %s\n", c?c:"-unknown-");
|
printf(" Raid Level : %s\n", c?c:"-unknown-");
|
||||||
if (array_size)
|
if (larray_size)
|
||||||
printf(" Array Size : %d%s\n", array_size, human_size(array_size));
|
printf(" Array Size : %ld%s\n", (long)(larray_size>>10), human_size(larray_size));
|
||||||
if (array.level >= 1)
|
if (array.level >= 1)
|
||||||
printf(" Device Size : %d%s\n", array.size, human_size(array.size));
|
printf(" Device Size : %d%s\n", array.size, human_size((long long)array.size<<10));
|
||||||
printf(" Raid Disks : %d\n", array.raid_disks);
|
printf(" Raid Disks : %d\n", array.raid_disks);
|
||||||
printf(" Total Disks : %d\n", array.nr_disks);
|
printf(" Total Disks : %d\n", array.nr_disks);
|
||||||
printf("Preferred Minor : %d\n", array.md_minor);
|
printf("Preferred Minor : %d\n", array.md_minor);
|
||||||
|
|
|
@ -154,7 +154,7 @@ int Examine(mddev_dev_t devlist, int brief, char *conffile)
|
||||||
printf(" Creation Time : %.24s\n", ctime(&atime));
|
printf(" Creation Time : %.24s\n", ctime(&atime));
|
||||||
c=map_num(pers, super.level);
|
c=map_num(pers, super.level);
|
||||||
printf(" Raid Level : %s\n", c?c:"-unknown-");
|
printf(" Raid Level : %s\n", c?c:"-unknown-");
|
||||||
printf(" Device Size : %d%s\n", super.size, human_size(super.size));
|
printf(" Device Size : %d%s\n", super.size, human_size((long long)super.size<<10));
|
||||||
printf(" Raid Disks : %d\n", super.raid_disks);
|
printf(" Raid Disks : %d\n", super.raid_disks);
|
||||||
printf(" Total Disks : %d\n", super.nr_disks);
|
printf(" Total Disks : %d\n", super.nr_disks);
|
||||||
printf("Preferred Minor : %d\n", super.md_minor);
|
printf("Preferred Minor : %d\n", super.md_minor);
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -37,7 +37,7 @@ MANDIR = /usr/share/man/man8
|
||||||
|
|
||||||
OBJS = mdadm.o config.o ReadMe.o util.o Manage.o Assemble.o Build.o Create.o Detail.o Examine.o Monitor.o dlink.o Kill.o
|
OBJS = mdadm.o config.o ReadMe.o util.o Manage.o Assemble.o Build.o Create.o Detail.o Examine.o Monitor.o dlink.o Kill.o
|
||||||
|
|
||||||
all : mdadm mdadm.man
|
all : mdadm mdadm.man md.man mdadm.conf.man
|
||||||
|
|
||||||
mdadm : $(OBJS)
|
mdadm : $(OBJS)
|
||||||
$(CC) -o mdadm $^
|
$(CC) -o mdadm $^
|
||||||
|
@ -45,6 +45,12 @@ mdadm : $(OBJS)
|
||||||
mdadm.man : mdadm.8
|
mdadm.man : mdadm.8
|
||||||
nroff -man mdadm.8 > mdadm.man
|
nroff -man mdadm.8 > mdadm.man
|
||||||
|
|
||||||
|
md.man : md.4
|
||||||
|
nroff -man md.4 > md.man
|
||||||
|
|
||||||
|
mdadm.conf.man : mdadm.conf.5
|
||||||
|
nroff -man mdadm.conf.5 > mdadm.conf.man
|
||||||
|
|
||||||
$(OBJS) : mdadm.h
|
$(OBJS) : mdadm.h
|
||||||
|
|
||||||
install : mdadm mdadm.8
|
install : mdadm mdadm.8
|
||||||
|
|
2
ReadMe.c
2
ReadMe.c
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "mdadm.h"
|
#include "mdadm.h"
|
||||||
|
|
||||||
char Version[] = Name " - v0.7 - 8 March 2002\n";
|
char Version[] = Name " - v0.7.1 - 8 March 2002\n";
|
||||||
/*
|
/*
|
||||||
* File: ReadMe.c
|
* File: ReadMe.c
|
||||||
*
|
*
|
||||||
|
|
4
TODO
4
TODO
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
?? Allow -S /dev/md? - current complains subsequent not a/d/r
|
?? Allow -S /dev/md? - current complains subsequent not a/d/r
|
||||||
|
|
||||||
|
* new "Query" mode to subsume --detail and --examine.
|
||||||
|
--query or -Q, takes a device and tells if it is an MD device,
|
||||||
|
and also tells in a raid superblock is found.
|
||||||
|
|
||||||
* write proc.c to parse /proc/mdstat file, and maybe /proc/partitions too.
|
* write proc.c to parse /proc/mdstat file, and maybe /proc/partitions too.
|
||||||
Build list of arrays: name, rebuild-percent
|
Build list of arrays: name, rebuild-percent
|
||||||
|
|
||||||
|
|
5
makedist
5
makedist
|
@ -8,6 +8,11 @@ else echo $target is not a directory
|
||||||
fi
|
fi
|
||||||
set `grep '^char Version' ReadMe.c `
|
set `grep '^char Version' ReadMe.c `
|
||||||
version=`echo $7 | sed 's/v//'`
|
version=`echo $7 | sed 's/v//'`
|
||||||
|
grep "^Version: $version$" mdadm.spec > /dev/null 2>&1 ||
|
||||||
|
{
|
||||||
|
echo mdadm.conf does not mention version $version.
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
echo version = $version
|
echo version = $version
|
||||||
base=mdadm-$version.tgz
|
base=mdadm-$version.tgz
|
||||||
if [ -f $target/$base ]
|
if [ -f $target/$base ]
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
.TH MD 4
|
||||||
|
.SH NAME
|
||||||
|
md \- Multiple Device driver aka Linux Software Raid
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.BI /dev/md n
|
||||||
|
.br
|
||||||
|
.BI /dev/md/ n
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B md
|
||||||
|
driver provides virtual devices that are created from one or more
|
||||||
|
independant underlying devices. This array of devices often contains
|
||||||
|
redundancy, and hence the acronym RAID which stands for a Redundant
|
||||||
|
Array of Independant Devices.
|
||||||
|
.PP
|
||||||
|
.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
|
||||||
|
to function.
|
||||||
|
.PP
|
||||||
|
.B md
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
|
||||||
|
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
|
||||||
|
(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 between 64K and 128K is lost when a device in
|
||||||
|
incorporated into an MD array.
|
||||||
|
|
||||||
|
The superblock contains, among other things:
|
||||||
|
.TP
|
||||||
|
LEVEL
|
||||||
|
The
|
||||||
|
.TP
|
||||||
|
UUID
|
||||||
|
a 128 bit Universally Unique Identifier that identifies the array that
|
||||||
|
this device is part of.
|
||||||
|
|
||||||
|
.SS LINEAR
|
||||||
|
.SS RAID0
|
||||||
|
.SS RAID1
|
||||||
|
.SS RAID4
|
||||||
|
.SS RAID5
|
||||||
|
.SS REBUILD/RESYNC
|
||||||
|
.SH FILES
|
||||||
|
.TP
|
||||||
|
.B /proc/mdstat
|
||||||
|
Contains information about the status of currently running array.
|
||||||
|
.TP
|
||||||
|
.B /proc/sys/dev/raid/speed_limit_min
|
||||||
|
A readable and writable file that reflects the current goal rebuild
|
||||||
|
speed for times when non-rebuild activity is current on an array.
|
||||||
|
The speed is in Kibibytes per second, and is a per-device rate, not a
|
||||||
|
per-array rate (which means that an array with more disc will shuffle
|
||||||
|
more data for a given speed). The default is 100.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B /proc/sys/dev/raid/speed_limit_max
|
||||||
|
A readable and writable file that reflects the current goal rebuild
|
||||||
|
speed for times when no non-rebuild activity is current on an array.
|
||||||
|
The default is 100,000.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR mdadm (8),
|
||||||
|
.BR mkraid (8).
|
|
@ -0,0 +1,89 @@
|
||||||
|
MD(4) MD(4)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NNAAMMEE
|
||||||
|
md - Multiple Device driver aka Linux Software Raid
|
||||||
|
|
||||||
|
SSYYNNOOPPSSIISS
|
||||||
|
//ddeevv//mmdd_n
|
||||||
|
//ddeevv//mmdd//_n
|
||||||
|
|
||||||
|
DDEESSCCRRIIPPTTIIOONN
|
||||||
|
The mmdd driver provides virtual devices that are created
|
||||||
|
from one or more independant underlying devices. This
|
||||||
|
array of devices often contains redundancy, and hence the
|
||||||
|
acronym RAID which stands for a Redundant Array of Inde-
|
||||||
|
pendant Devices.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
mmdd also supports a number of pseudo RAID (non-redundant)
|
||||||
|
configuations including RAID0 (striped array), LINEAR
|
||||||
|
(catenated array) and MULTIPATH (a set of different inter-
|
||||||
|
faces to the same device).
|
||||||
|
|
||||||
|
|
||||||
|
RRAAIIDD 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-
|
||||||
|
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 (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
|
||||||
|
between 64K and 128K is lost when a device in incorporated
|
||||||
|
into an MD array.
|
||||||
|
|
||||||
|
The superblock contains, among other things:
|
||||||
|
|
||||||
|
LEVEL The
|
||||||
|
|
||||||
|
UUID a 128 bit Universally Unique Identifier that iden-
|
||||||
|
tifies the array that this device is part of.
|
||||||
|
|
||||||
|
|
||||||
|
LLIINNEEAARR
|
||||||
|
RRAAIIDD00
|
||||||
|
RRAAIIDD11
|
||||||
|
RRAAIIDD44
|
||||||
|
RRAAIIDD55
|
||||||
|
RREEBBUUIILLDD//RREESSYYNNCC
|
||||||
|
FFIILLEESS
|
||||||
|
//pprroocc//mmddssttaatt
|
||||||
|
Contains information about the status of currently
|
||||||
|
running array.
|
||||||
|
|
||||||
|
//pprroocc//ssyyss//ddeevv//rraaiidd//ssppeeeedd__lliimmiitt__mmiinn
|
||||||
|
A readable and writable file that reflects the cur-
|
||||||
|
rent goal rebuild speed for times when non-rebuild
|
||||||
|
activity is current on an array. The speed is in
|
||||||
|
Kibibytes per second, and is a per-device rate, not
|
||||||
|
a per-array rate (which means that an array with
|
||||||
|
more disc will shuffle more data for a given
|
||||||
|
speed). The default is 100.
|
||||||
|
|
||||||
|
|
||||||
|
//pprroocc//ssyyss//ddeevv//rraaiidd//ssppeeeedd__lliimmiitt__mmaaxx
|
||||||
|
A readable and writable file that reflects the cur-
|
||||||
|
rent goal rebuild speed for times when no non-
|
||||||
|
rebuild activity is current on an array. The
|
||||||
|
default is 100,000.
|
||||||
|
|
||||||
|
|
||||||
|
SSEEEE AALLSSOO
|
||||||
|
mmddaaddmm(8), mmkkrraaiidd(8).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MD(4)
|
3
mdadm.8
3
mdadm.8
|
@ -569,6 +569,9 @@ or
|
||||||
http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/
|
http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/
|
||||||
.URk
|
.URk
|
||||||
.PP
|
.PP
|
||||||
|
.BR mdadm.conf (5),
|
||||||
|
.BR md (4).
|
||||||
|
.PP
|
||||||
.IR raidtab (5),
|
.IR raidtab (5),
|
||||||
.IR raid0run (8),
|
.IR raid0run (8),
|
||||||
.IR raidstop (8),
|
.IR raidstop (8),
|
||||||
|
|
2
mdadm.c
2
mdadm.c
|
@ -239,7 +239,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
switch(level) {
|
switch(level) {
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, Name ": layout now meaningful for %s arrays.\n",
|
fprintf(stderr, Name ": layout not meaningful for %s arrays.\n",
|
||||||
map_num(pers, level));
|
map_num(pers, level));
|
||||||
exit(2);
|
exit(2);
|
||||||
case -10:
|
case -10:
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
# mdadm configuration file
|
||||||
|
#
|
||||||
|
# mdadm will function properly without the use of a configuration file,
|
||||||
|
# but this file is useful for keeping track of arrays and member disks.
|
||||||
|
# In general, a mdadm.conf file is created, and updated, after arrays
|
||||||
|
# are created. This is the opposite behavior of /etc/raidtab which is
|
||||||
|
# created prior to array construction.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# the config file takes two types of lines:
|
||||||
|
#
|
||||||
|
# DEVICE lines specify a list of devices of where to look for
|
||||||
|
# potential member disks
|
||||||
|
#
|
||||||
|
# ARRAY lines specify information about how to identify arrays so
|
||||||
|
# so that they can be activated
|
||||||
|
#
|
||||||
|
# You can have more than one device line and use wild cards. The first
|
||||||
|
# example includes SCSI the first partition of SCSI disks /dev/sdb,
|
||||||
|
# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second
|
||||||
|
# line looks for array slices on IDE disks.
|
||||||
|
#
|
||||||
|
#DEVICE /dev/sd[bcdjkl]1
|
||||||
|
#DEVICE /dev/hda1 /dev/hdb1
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# ARRAY lines specify an array to assemble and a method of identification.
|
||||||
|
# Arrays can currently be identified by using a UUID, superblock minor number,
|
||||||
|
# or a listing of devices.
|
||||||
|
#
|
||||||
|
# super-minor is usally the minor number of the metadevice
|
||||||
|
# UUID is the Universally Unique Identifier for the array
|
||||||
|
# Each can be obtained using
|
||||||
|
#
|
||||||
|
# mdadm -D <md>
|
||||||
|
#
|
||||||
|
#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
|
||||||
|
#ARRAY /dev/md1 superminor=1
|
||||||
|
#ARRAY /dev/md2 devices=/dev/hda1,/dev/hda2
|
|
@ -0,0 +1,54 @@
|
||||||
|
.TH MDADM.CONF 5
|
||||||
|
.SH NAME
|
||||||
|
mdadm.conf \- configuration for management of Software Raid with mdadm
|
||||||
|
.SH SYNOPSIS
|
||||||
|
/etc/mdadm.conf
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.PP
|
||||||
|
.B mdadm
|
||||||
|
is a tools for creating an managing 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.
|
||||||
|
|
||||||
|
.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
|
||||||
|
word together with the remainder of the line are ignored.
|
||||||
|
|
||||||
|
Any line that start with white space (space or tab) is treated as
|
||||||
|
though it were a continuation of the previous line.
|
||||||
|
|
||||||
|
Empty lines are ignored, but otherwise each (non continuation) line
|
||||||
|
must start with a keyword as listed below. The key words are case
|
||||||
|
insensitve and can be abbreviated to 3 characters.
|
||||||
|
|
||||||
|
The keywords are:
|
||||||
|
.TP
|
||||||
|
.B DEVICE
|
||||||
|
A
|
||||||
|
.B device
|
||||||
|
line lists the devices (whole devices or partitions) that might contain
|
||||||
|
a component of an MD array. When looking for the components of an
|
||||||
|
array,
|
||||||
|
.B mdadm
|
||||||
|
will scan these devices and no others.
|
||||||
|
|
||||||
|
The
|
||||||
|
.B device
|
||||||
|
line may contain a number of different devices (separated by spaces)
|
||||||
|
and each device name can contain wild cards as defined by
|
||||||
|
.BR glob (7).
|
||||||
|
|
||||||
|
Also, there may be several device lines present in the file.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B ARRAY
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mdadm (8),
|
||||||
|
md (4).
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
MDADM.CONF(5) MDADM.CONF(5)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NNAAMMEE
|
||||||
|
mdadm.conf - configuration for management of Software Raid
|
||||||
|
with mdadm
|
||||||
|
|
||||||
|
SSYYNNOOPPSSIISS
|
||||||
|
/etc/mdadm.conf
|
||||||
|
|
||||||
|
DDEESSCCRRIIPPTTIIOONN
|
||||||
|
mmddaaddmm is a tools for creating an managing 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.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
together with the remainder of the line are ignored.
|
||||||
|
|
||||||
|
Any line that start with white space (space or tab) is
|
||||||
|
treated as though it were a continuation of the previous
|
||||||
|
line.
|
||||||
|
|
||||||
|
Empty lines are ignored, but otherwise each (non continua-
|
||||||
|
tion) line must start with a keyword as listed below. The
|
||||||
|
key words are case insensitve and can be abbreviated to 3
|
||||||
|
characters.
|
||||||
|
|
||||||
|
The keywords are:
|
||||||
|
|
||||||
|
DDEEVVIICCEE A ddeevviiccee line lists the devices (whole devices or
|
||||||
|
partitions) that might contain a component of an MD
|
||||||
|
array. When looking for the components of an
|
||||||
|
array, mmddaaddmm will scan these devices and no others.
|
||||||
|
|
||||||
|
The ddeevviiccee line may contain a number of different
|
||||||
|
devices (separated by spaces) and each device name
|
||||||
|
can contain wild cards as defined by gglloobb(7).
|
||||||
|
|
||||||
|
Also, there may be several device lines present in
|
||||||
|
the file.
|
||||||
|
|
||||||
|
|
||||||
|
AARRRRAAYY
|
||||||
|
|
||||||
|
SSEEEE AALLSSOO
|
||||||
|
mdadm (8), md (4).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MDADM.CONF(5)
|
5
mdadm.h
5
mdadm.h
|
@ -46,6 +46,9 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#define MD_MAJOR 9
|
#define MD_MAJOR 9
|
||||||
|
|
||||||
|
/* I seem to need this to make BLKGETSIZE64 to work... */
|
||||||
|
#define u64 __u64
|
||||||
|
|
||||||
|
|
||||||
#include "md_u.h"
|
#include "md_u.h"
|
||||||
|
|
||||||
|
@ -149,4 +152,4 @@ extern int check_raid(int fd, char *name);
|
||||||
extern mddev_ident_t conf_get_ident(char *, char*);
|
extern mddev_ident_t conf_get_ident(char *, char*);
|
||||||
extern mddev_dev_t conf_get_devs(char *);
|
extern mddev_dev_t conf_get_devs(char *);
|
||||||
|
|
||||||
extern char *human_size(long kbytes);
|
extern char *human_size(long long bytes);
|
||||||
|
|
476
mdadm.man
476
mdadm.man
|
@ -1,476 +0,0 @@
|
||||||
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 and manage
|
|
||||||
MD devices. As such it provides a similar set of func-
|
|
||||||
tionality to the rraaiiddttoooollss packages. The key differences
|
|
||||||
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 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).
|
|
||||||
|
|
||||||
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 con-
|
|
||||||
taining wild cards (see _g_l_o_b(7)). These list all the
|
|
||||||
devices that mmddaaddmm is allowed to scan when looking for
|
|
||||||
devices with RAID superblocks. Each line can contain mul-
|
|
||||||
tiple device names, and there can be multiple DEVICE
|
|
||||||
lines. For example:
|
|
||||||
|
|
||||||
DEVICE /dev/hda* /dev/hdc*
|
|
||||||
DEV /dev/sd*
|
|
||||||
DEVICE /dev/discs/disc*/disc
|
|
||||||
|
|
||||||
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 con-
|
|
||||||
sidered 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 hexadecimal,
|
|
||||||
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 normally used
|
|
||||||
to identify an array, but is supported 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.
|
|
||||||
|
|
||||||
|
|
||||||
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/
|
|
||||||
|
|
||||||
_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)
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
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>
|
||||||
|
|
||||||
|
%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.
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
|
||||||
|
%build
|
||||||
|
# This is a debatable issue. The author of this RPM spec file feels that
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
%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/%{_mandir}/man4
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man5
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8
|
||||||
|
install -m644 md.4 $RPM_BUILD_ROOT/%{_mandir}/man4/
|
||||||
|
install -m644 mdadm.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/
|
||||||
|
install -m644 mdadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc TODO ChangeLog mdadm.man mdadm.conf-example
|
||||||
|
/sbin/mdadm
|
||||||
|
/etc/mdadm.conf
|
||||||
|
%{_mandir}/man*/md*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* 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
|
47
mdctl.spec
47
mdctl.spec
|
@ -1,47 +0,0 @@
|
||||||
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
|
|
||||||
Name: mdadm
|
|
||||||
Version: 0.5
|
|
||||||
Release: 1
|
|
||||||
Source0: 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>
|
|
||||||
|
|
||||||
%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.
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q -n mdadm
|
|
||||||
|
|
||||||
%build
|
|
||||||
make
|
|
||||||
|
|
||||||
%install
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
|
||||||
install -m755 mdadm $RPM_BUILD_ROOT/sbin/
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%doc TODO testconfig testconfig2
|
|
||||||
/sbin/*
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Tue Aug 07 2001 Danilo Godec <danci@agenda.si>
|
|
||||||
- initial RPM build
|
|
23
util.c
23
util.c
|
@ -412,7 +412,7 @@ char *map_dev(int major, int minor)
|
||||||
int calc_sb_csum(mdp_super_t *super)
|
int calc_sb_csum(mdp_super_t *super)
|
||||||
{
|
{
|
||||||
unsigned int oldcsum = super->sb_csum;
|
unsigned int oldcsum = super->sb_csum;
|
||||||
unsigned long long newcsum = 0; /* FIXME why does this make it work?? */
|
unsigned long long newcsum = 0;
|
||||||
unsigned long csum;
|
unsigned long csum;
|
||||||
int i;
|
int i;
|
||||||
unsigned int *superc = (int*) super;
|
unsigned int *superc = (int*) super;
|
||||||
|
@ -425,15 +425,26 @@ int calc_sb_csum(mdp_super_t *super)
|
||||||
return csum;
|
return csum;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *human_size(long kbytes)
|
char *human_size(long long bytes)
|
||||||
{
|
{
|
||||||
static char buf[30];
|
static char buf[30];
|
||||||
|
|
||||||
|
|
||||||
if (kbytes < 2000)
|
if (bytes < 5000*1024)
|
||||||
buf[0]=0;
|
buf[0]=0;
|
||||||
else if (kbytes < 2*1024*1024)
|
else if (bytes < 2*1024LL*1024LL*1024LL)
|
||||||
sprintf(buf, " (%d MiB)", kbytes>>10);
|
sprintf(buf, " (%d.%02d MiB %d.%02d MB)",
|
||||||
|
(long)(bytes>>20),
|
||||||
|
(long)(bytes&0xfffff)/(0x100000/100),
|
||||||
|
(long)(bytes/1000/1000),
|
||||||
|
(long)((bytes%1000000)/10000)
|
||||||
|
);
|
||||||
else
|
else
|
||||||
sprintf(buf, " (%d GiB)", kbytes>>20);
|
sprintf(buf, " (%d.%02d GiB %d.%02d GB)",
|
||||||
|
(long)(bytes>>30),
|
||||||
|
(long)((bytes>>10)&0xfffff)/(0x100000/100),
|
||||||
|
(long)(bytes/1000LL/1000LL/1000LL),
|
||||||
|
(long)(((bytes/1000)%1000000)/10000)
|
||||||
|
);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue