parent
d1f1011b94
commit
41a3b72a9c
|
@ -0,0 +1,67 @@
|
||||||
|
Subject: ANNOUNCE: mdadm 2.5 - A tool for managing Soft RAID under Linux
|
||||||
|
|
||||||
|
I am pleased to announce the availability of
|
||||||
|
mdadm version 2.5
|
||||||
|
|
||||||
|
It is available at the usual places:
|
||||||
|
http://www.cse.unsw.edu.au/~neilb/source/mdadm/
|
||||||
|
and
|
||||||
|
http://www.{countrycode}.kernel.org/pub/linux/utils/raid/mdadm/
|
||||||
|
|
||||||
|
mdadm is a tool for creating, managing and monitoring
|
||||||
|
device arrays using the "md" driver in Linux, also
|
||||||
|
known as Software RAID arrays.
|
||||||
|
|
||||||
|
Release 2.5 adds a host of minor updates and one major update.
|
||||||
|
|
||||||
|
The major update involves an "Auto Assemble" function which will,
|
||||||
|
with certainly limits, scan all available devices for anything that
|
||||||
|
looks like an md array, and will try to assemble it.
|
||||||
|
This code should be treated with some caution as it is very new,
|
||||||
|
and could be revised in future, though hopefully not very much.
|
||||||
|
|
||||||
|
The main problem I have always had will auto-assembly is that it
|
||||||
|
is too easy for it to assemble thing that you don't want assembled,
|
||||||
|
e.g. if you have moved some devices from a different computer.
|
||||||
|
To remove this problem, arrays can now be tagged for the computer
|
||||||
|
that is their home (homehost) and only arrays with the correct
|
||||||
|
homehost will be auto-assembled.
|
||||||
|
|
||||||
|
Feedback on the effectiveness and usefulness of this feature and it's
|
||||||
|
documentation is encouraged.
|
||||||
|
|
||||||
|
Changelog Entries:
|
||||||
|
- Support 'mailfrom' line in mdadm.conf so the From: line in alert
|
||||||
|
emails can be explicitly set.
|
||||||
|
- Arrange that SparesMissing (which is similar in import to
|
||||||
|
DegradedArray) generates an Email.
|
||||||
|
- Assume "DEVICE partitions" if no DEVICE line is given.
|
||||||
|
- Support new 'offset' layout for raid10.
|
||||||
|
- When creating a bitmap file, choose a chunksize to limit number
|
||||||
|
of bitmap chunks to 2 million. More than this can cause kmalloc
|
||||||
|
failure.
|
||||||
|
- New 'CREATE' line in mdadm.conf for defaults such as owner, group,
|
||||||
|
mode and auto-flag
|
||||||
|
- --detail checks if array has been started or not and includes that
|
||||||
|
in report.
|
||||||
|
- When using --update=uuid on an array with a bitmap, update the
|
||||||
|
bitmap's uuid too.
|
||||||
|
- Add a copy of /proc/mdstat to the mail message sent by mdadm
|
||||||
|
--monitor.
|
||||||
|
- New flag --no-degraded to avoid starting arrays if there are
|
||||||
|
fewer devices available than last time the array was started.
|
||||||
|
This is only needed with --scan, as with --scan, that behaviour
|
||||||
|
is the default.
|
||||||
|
- Support for 'homehost' concept. This is a fairly major update.
|
||||||
|
It includes a configfile option and a command line option for
|
||||||
|
specifying a homehost, records that host in the superblock,
|
||||||
|
and reports the homehost where possible.
|
||||||
|
- Support for Auto Assembly. "mdadm -As" will, if provided with
|
||||||
|
the name of a homehost, try to assemble all arrays it can find
|
||||||
|
that were created for that homehost. See man pages for more details.
|
||||||
|
|
||||||
|
Development of mdadm is sponsored by
|
||||||
|
SUSE Labs, Novell Inc.
|
||||||
|
|
||||||
|
NeilBrown 26th May 2006
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mdadm.h"
|
#include "mdadm.h"
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
static int name_matches(char *found, char *required, char *homehost)
|
static int name_matches(char *found, char *required, char *homehost)
|
||||||
{
|
{
|
||||||
|
@ -112,7 +113,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
|
||||||
*/
|
*/
|
||||||
int must_close = 0;
|
int must_close = 0;
|
||||||
int old_linux = 0;
|
int old_linux = 0;
|
||||||
int vers;
|
int vers = 0; /* Keep gcc quite - it really is initialised */
|
||||||
void *first_super = NULL, *super = NULL;
|
void *first_super = NULL, *super = NULL;
|
||||||
struct {
|
struct {
|
||||||
char *devname;
|
char *devname;
|
||||||
|
@ -376,7 +377,11 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
|
||||||
st->ss->getinfo_super(&info, first_super);
|
st->ss->getinfo_super(&info, first_super);
|
||||||
c = strchr(info.name, ':');
|
c = strchr(info.name, ':');
|
||||||
if (c) c++; else c= info.name;
|
if (c) c++; else c= info.name;
|
||||||
asprintf(&mddev, "/dev/md/%s", c);
|
if (isdigit(*c) && ((ident->autof & 7)==4 || (ident->autof&7)==6))
|
||||||
|
/* /dev/md/d0 style for partitionable */
|
||||||
|
asprintf(&mddev, "/dev/md/d%s", c);
|
||||||
|
else
|
||||||
|
asprintf(&mddev, "/dev/md/%s", c);
|
||||||
mdfd = open_mddev(mddev, ident->autof);
|
mdfd = open_mddev(mddev, ident->autof);
|
||||||
if (mdfd < 0)
|
if (mdfd < 0)
|
||||||
return mdfd;
|
return mdfd;
|
||||||
|
|
|
@ -14,12 +14,19 @@ Changes Prior to this release
|
||||||
in report.
|
in report.
|
||||||
- When using --update=uuid on an array with a bitmap, update the
|
- When using --update=uuid on an array with a bitmap, update the
|
||||||
bitmap's uuid too.
|
bitmap's uuid too.
|
||||||
- Add a copy of /proc/mdstat to the mail message send by mdadm
|
- Add a copy of /proc/mdstat to the mail message sent by mdadm
|
||||||
--monitor.
|
--monitor.
|
||||||
- New flag --no-degraded to avoid starting arrays if there are
|
- New flag --no-degraded to avoid starting arrays if there are
|
||||||
fewer devices available than last time the array was started.
|
fewer devices available than last time the array was started.
|
||||||
This is only needed with --scan, as with --scan, that behaviour
|
This is only needed with --scan, as with --scan, that behaviour
|
||||||
is the default.
|
is the default.
|
||||||
|
- Support for 'homehost' concept. This is a fairly major update.
|
||||||
|
It includes a configfile option and a command line option for
|
||||||
|
specifying a homehost, records that host in the superblock,
|
||||||
|
and reports the homehost where possible.
|
||||||
|
- Support for Auto Assembly. "mdadm -As" will, if provided with
|
||||||
|
the name of a homehost, try to assemble all arrays it can find
|
||||||
|
that were created for that homehost. See man pages for more details.
|
||||||
|
|
||||||
Changes Prior to 2.4.1 release
|
Changes Prior to 2.4.1 release
|
||||||
- Honour --write-mostly when adding to an array without persistent
|
- Honour --write-mostly when adding to an array without persistent
|
||||||
|
|
2
ReadMe.c
2
ReadMe.c
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "mdadm.h"
|
#include "mdadm.h"
|
||||||
|
|
||||||
char Version[] = Name " - v2.4.1 - 4 April 2006\n";
|
char Version[] = Name " - v2.5 - 26 May 2006\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File: ReadMe.c
|
* File: ReadMe.c
|
||||||
|
|
|
@ -7,6 +7,7 @@ ANNOUNCE-2.3.1
|
||||||
ANNOUNCE-2.4
|
ANNOUNCE-2.4
|
||||||
ANNOUNCE-2.4-pre1
|
ANNOUNCE-2.4-pre1
|
||||||
ANNOUNCE-2.4.1
|
ANNOUNCE-2.4.1
|
||||||
|
ANNOUNCE-2.5
|
||||||
Assemble.c
|
Assemble.c
|
||||||
Build.c
|
Build.c
|
||||||
COPYING
|
COPYING
|
||||||
|
@ -23,6 +24,7 @@ Monitor.c
|
||||||
Query.c
|
Query.c
|
||||||
README.initramfs
|
README.initramfs
|
||||||
ReadMe.c
|
ReadMe.c
|
||||||
|
SHA1.c
|
||||||
TODO
|
TODO
|
||||||
bitmap.c
|
bitmap.c
|
||||||
bitmap.h
|
bitmap.h
|
||||||
|
@ -32,6 +34,7 @@ dlink.h
|
||||||
inventory
|
inventory
|
||||||
makedist
|
makedist
|
||||||
md.4
|
md.4
|
||||||
|
md5.h
|
||||||
md_p.h
|
md_p.h
|
||||||
md_u.h
|
md_u.h
|
||||||
mdadm.8
|
mdadm.8
|
||||||
|
@ -49,6 +52,8 @@ misc/syslog-events
|
||||||
mkinitramfs
|
mkinitramfs
|
||||||
raid5extend.c
|
raid5extend.c
|
||||||
restripe.c
|
restripe.c
|
||||||
|
sha1.c
|
||||||
|
sha1.h
|
||||||
super0.c
|
super0.c
|
||||||
super1.c
|
super1.c
|
||||||
swap_super.c
|
swap_super.c
|
||||||
|
|
106
mdadm.8
106
mdadm.8
|
@ -1,5 +1,5 @@
|
||||||
.\" -*- nroff -*-
|
.\" -*- nroff -*-
|
||||||
.TH MDADM 8 "" v2.4.1
|
.TH MDADM 8 "" v2.5
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mdadm \- manage MD devices
|
mdadm \- manage MD devices
|
||||||
.I aka
|
.I aka
|
||||||
|
@ -281,6 +281,26 @@ on the device, either at the end (for 1.0), at the start (for 1.1) or
|
||||||
4K from the start (for 1.2).
|
4K from the start (for 1.2).
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B --homehost=
|
||||||
|
This will over-ride any
|
||||||
|
.B HOMEHOST
|
||||||
|
setting in the config file and provides the identify of the host which
|
||||||
|
should be considered the home for any arrays.
|
||||||
|
|
||||||
|
When creating an array, the
|
||||||
|
.B homehost
|
||||||
|
will be recorded in the superblock. For version-1 superblocks, it will
|
||||||
|
be prefixed to the array name. For version-0.90 superblocks part of
|
||||||
|
the SHA1 hash of the hostname will be stored in the later half of the
|
||||||
|
UUID.
|
||||||
|
|
||||||
|
When reporting information about an array, any array which is tagged
|
||||||
|
for the given homehost will be reported as such.
|
||||||
|
|
||||||
|
When using Auto-Assemble, only arrays tagged for the given homehost
|
||||||
|
will be assembled.
|
||||||
|
|
||||||
.SH For create, build, or grow:
|
.SH For create, build, or grow:
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -597,7 +617,7 @@ will look for super blocks with a minor number of 0.
|
||||||
Specify the name of the array to assemble. This must be the name
|
Specify the name of the array to assemble. This must be the name
|
||||||
that was specified when creating the array. It must either match
|
that was specified when creating the array. It must either match
|
||||||
then name stored in the superblock exactly, or it must match
|
then name stored in the superblock exactly, or it must match
|
||||||
which the current
|
with the current
|
||||||
.I homehost
|
.I homehost
|
||||||
is added to the start of the given name.
|
is added to the start of the given name.
|
||||||
|
|
||||||
|
@ -728,6 +748,14 @@ The
|
||||||
option will correct the summaries in the superblock. That is the
|
option will correct the summaries in the superblock. That is the
|
||||||
counts of total, working, active, failed, and spare devices.
|
counts of total, working, active, failed, and spare devices.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B --auto-update-homehost
|
||||||
|
This flag is only meaning with auto-assembly (see discussion below).
|
||||||
|
In that situation, if no suitable arrays are found for this homehost,
|
||||||
|
.I mdadm
|
||||||
|
will recan for any arrays at all and will assemble them and update the
|
||||||
|
homehost to match the current host.
|
||||||
|
|
||||||
.SH For Manage mode:
|
.SH For Manage mode:
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -1015,6 +1043,62 @@ option is also available in Build and Create modes. As those modes do
|
||||||
not use a config file, the "auto=" config option does not apply to
|
not use a config file, the "auto=" config option does not apply to
|
||||||
these modes.
|
these modes.
|
||||||
|
|
||||||
|
.SS Auto Assembly
|
||||||
|
When
|
||||||
|
.B --assemble
|
||||||
|
is used with
|
||||||
|
.B --scan
|
||||||
|
and no devices are listed,
|
||||||
|
.I mdadm
|
||||||
|
will first attempt to assemble all the arrays listed in the config
|
||||||
|
file.
|
||||||
|
|
||||||
|
If a
|
||||||
|
.B homehost
|
||||||
|
has been specified (either in the config file or on the command line),
|
||||||
|
.I mdadm
|
||||||
|
will look further for possible arrays and will try to assemble
|
||||||
|
anything that it finds which is tagged as belonging to the given
|
||||||
|
homehost. This is the only situation where
|
||||||
|
.I mdadm
|
||||||
|
will assemble arrays without being given specific device name or
|
||||||
|
identify information for the array.
|
||||||
|
|
||||||
|
If
|
||||||
|
.I mdadm
|
||||||
|
finds a consistent set of devices that look like they should comprise
|
||||||
|
an array, and if the superblock is tagged as belonging to the given
|
||||||
|
home host, it will automatically choose a device name and try to
|
||||||
|
assemble the array. If the array uses version-0.90 metadata, then the
|
||||||
|
.B minor
|
||||||
|
number as recorded in the superblock is used to create a name in
|
||||||
|
.B /dev/md/
|
||||||
|
so for example
|
||||||
|
.BR /dev/md/3 .
|
||||||
|
If the array uses version-1 metadata, then the
|
||||||
|
.B name
|
||||||
|
from the superblock is used to similarly create a name in
|
||||||
|
.BR /dev/md .
|
||||||
|
The name will have any 'host' prefix stripped first.
|
||||||
|
|
||||||
|
If
|
||||||
|
.I mdadm
|
||||||
|
cannot find any array for the given host at all, and if
|
||||||
|
.B --auto-update-homehost
|
||||||
|
is given, then
|
||||||
|
.I mdadm
|
||||||
|
will search again for any array (not just an array created for this
|
||||||
|
host) and will assemble each assuming
|
||||||
|
.IR --update=homehost .
|
||||||
|
This will change the host tag in the superblock so that on the next run,
|
||||||
|
these arrays will be found without the second pass. The intention of
|
||||||
|
this feature is to support transitioning a set of md arrays to using
|
||||||
|
homehost tagging.
|
||||||
|
|
||||||
|
The reason for requiring arrays to be tagged with the homehost for
|
||||||
|
auto assembly is to guard against problems that can arise when moving
|
||||||
|
devices from one host to another.
|
||||||
|
|
||||||
.SH BUILD MODE
|
.SH BUILD MODE
|
||||||
|
|
||||||
.HP 12
|
.HP 12
|
||||||
|
@ -1089,6 +1173,24 @@ be over-ridden with the
|
||||||
.I --force
|
.I --force
|
||||||
option.
|
option.
|
||||||
|
|
||||||
|
When creating an array with version-1 metadata a name for the host is
|
||||||
|
required.
|
||||||
|
If this is not given with the
|
||||||
|
.B --name
|
||||||
|
option,
|
||||||
|
.I mdadm
|
||||||
|
will chose a name based on the last component of the name of the
|
||||||
|
device being created. So if
|
||||||
|
.B /dev/md3
|
||||||
|
is being created, then the name
|
||||||
|
.B 3
|
||||||
|
will be chosen.
|
||||||
|
If
|
||||||
|
.B /dev/md/home
|
||||||
|
is being created, then the name
|
||||||
|
.B home
|
||||||
|
will be used.
|
||||||
|
|
||||||
'''If the
|
'''If the
|
||||||
'''.B --size
|
'''.B --size
|
||||||
'''option is given, it is not necessary to list any component-devices in this command.
|
'''option is given, it is not necessary to list any component-devices in this command.
|
||||||
|
|
2
mdadm.c
2
mdadm.c
|
@ -178,7 +178,7 @@ int main(int argc, char *argv[])
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'r':
|
case 'r':
|
||||||
case 'f':
|
case 'f':
|
||||||
case 6: /* re-add */
|
case ReAdd: /* re-add */
|
||||||
if (!mode) {
|
if (!mode) {
|
||||||
newmode = MANAGE;
|
newmode = MANAGE;
|
||||||
shortopt = short_bitmap_auto_options;
|
shortopt = short_bitmap_auto_options;
|
||||||
|
|
|
@ -291,6 +291,8 @@ MAILADDR root@mydomain.tld
|
||||||
PROGRAM /usr/sbin/handle-mdadm-events
|
PROGRAM /usr/sbin/handle-mdadm-events
|
||||||
.br
|
.br
|
||||||
CREATE group=system mode=0640 auto=part-8
|
CREATE group=system mode=0640 auto=part-8
|
||||||
|
.br
|
||||||
|
HOMEHOST <system>
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR mdadm (8),
|
.BR mdadm (8),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
|
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
|
||||||
Name: mdadm
|
Name: mdadm
|
||||||
Version: 2.4.1
|
Version: 2.5
|
||||||
Release: 1
|
Release: 1
|
||||||
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
|
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
|
||||||
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
|
URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" -*- nroff -*-
|
.\" -*- nroff -*-
|
||||||
.TH MDASSEMBLE 8 "" v2.4.1
|
.TH MDASSEMBLE 8 "" v2.5
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mdassemble \- assemble MD devices
|
mdassemble \- assemble MD devices
|
||||||
.I aka
|
.I aka
|
||||||
|
|
2
super1.c
2
super1.c
|
@ -712,7 +712,7 @@ static int store_super1(struct supertype *st, int fd, void *sbv)
|
||||||
|
|
||||||
if (sb->feature_map & __cpu_to_le32(MD_FEATURE_BITMAP_OFFSET)) {
|
if (sb->feature_map & __cpu_to_le32(MD_FEATURE_BITMAP_OFFSET)) {
|
||||||
struct bitmap_super_s *bm = (struct bitmap_super_s*)
|
struct bitmap_super_s *bm = (struct bitmap_super_s*)
|
||||||
((char*)sb)+1024;
|
(((char*)sb)+1024);
|
||||||
if (__le32_to_cpu(bm->magic) == BITMAP_MAGIC) {
|
if (__le32_to_cpu(bm->magic) == BITMAP_MAGIC) {
|
||||||
locate_bitmap1(st, fd, sbv);
|
locate_bitmap1(st, fd, sbv);
|
||||||
write(fd, bm, sizeof(*bm));
|
write(fd, bm, sizeof(*bm));
|
||||||
|
|
4
test
4
test
|
@ -34,7 +34,8 @@ mdsize12=19992
|
||||||
cleanup() {
|
cleanup() {
|
||||||
$mdadm -Ss
|
$mdadm -Ss
|
||||||
for d in 0 1 2 3 4 5 6 7
|
for d in 0 1 2 3 4 5 6 7
|
||||||
do losetup -d /dev/loop$d ; # rm -f $targetdir/mdtest$d
|
do
|
||||||
|
losetup -d /dev/loop$d ; # rm -f $targetdir/mdtest$d
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ devlist=
|
||||||
for d in 0 1 2 3 4 5 6 7
|
for d in 0 1 2 3 4 5 6 7
|
||||||
do
|
do
|
||||||
[ -f $targetdir/mdtest$d ] || dd if=/dev/zero of=$targetdir/mdtest$d count=$size bs=1K > /dev/null 2>&1
|
[ -f $targetdir/mdtest$d ] || dd if=/dev/zero of=$targetdir/mdtest$d count=$size bs=1K > /dev/null 2>&1
|
||||||
|
[ -b /dev/loop$d ] || mknod /dev/loop$d b 7 $d
|
||||||
if [ $d -eq 7 ]
|
if [ $d -eq 7 ]
|
||||||
then
|
then
|
||||||
losetup /dev/loop$d $targetdir/mdtest6 # for multipath use
|
losetup /dev/loop$d $targetdir/mdtest6 # for multipath use
|
||||||
|
|
|
@ -30,6 +30,7 @@ fi
|
||||||
mdadm -S $md0
|
mdadm -S $md0
|
||||||
|
|
||||||
mdadm --assemble -R $md0 $dev2
|
mdadm --assemble -R $md0 $dev2
|
||||||
|
mdadm --zero-superblock $dev1
|
||||||
mdadm $md0 --add $dev1
|
mdadm $md0 --add $dev1
|
||||||
check recovery
|
check recovery
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ mdadm -S $md0
|
||||||
|
|
||||||
mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev3
|
mdadm --assemble -R $md0 --bitmap=$bmf $dev1 $dev3
|
||||||
check nosync
|
check nosync
|
||||||
|
mdadm --zero-superblock $dev2
|
||||||
mdadm $md0 --add $dev2
|
mdadm $md0 --add $dev2
|
||||||
check recovery
|
check recovery
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue