summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE-2.041
-rw-r--r--ANNOUNCE-2.137
-rw-r--r--ANNOUNCE-2.250
-rw-r--r--ANNOUNCE-2.349
-rw-r--r--ANNOUNCE-2.3.131
-rw-r--r--ANNOUNCE-2.445
-rw-r--r--ANNOUNCE-2.4-pre124
-rw-r--r--ANNOUNCE-2.4.131
-rw-r--r--ANNOUNCE-2.567
-rw-r--r--ANNOUNCE-2.5.140
-rw-r--r--ANNOUNCE-2.5.245
-rw-r--r--ANNOUNCE-2.5.333
-rw-r--r--ANNOUNCE-2.5.438
-rw-r--r--ANNOUNCE-2.5.543
-rw-r--r--ANNOUNCE-2.5.632
-rw-r--r--ANNOUNCE-2.676
-rw-r--r--ANNOUNCE-2.6.133
-rw-r--r--ANNOUNCE-2.6.237
-rw-r--r--ANNOUNCE-2.6.344
-rw-r--r--ANNOUNCE-2.6.431
-rw-r--r--ANNOUNCE-2.6.540
-rw-r--r--ANNOUNCE-2.6.627
-rw-r--r--ANNOUNCE-2.6.727
-rw-r--r--ANNOUNCE-2.6.858
-rw-r--r--ANNOUNCE-2.6.951
-rw-r--r--ANNOUNCE-3.0 (renamed from ANNOUNCE-3.0-devel2)20
-rw-r--r--ANNOUNCE-3.0-devel184
-rw-r--r--ANNOUNCE-3.0-devel3113
-rw-r--r--ANNOUNCE-3.0-rc1139
-rw-r--r--ANNOUNCE-3.0.122
-rw-r--r--ANNOUNCE-3.0.221
-rw-r--r--Assemble.c13
-rw-r--r--Build.c9
-rw-r--r--ChangeLog790
-rw-r--r--Create.c41
-rw-r--r--Detail.c28
-rw-r--r--Examine.c34
-rw-r--r--Grow.c9
-rw-r--r--Incremental.c2
-rw-r--r--Kill.c9
-rw-r--r--Makefile12
-rw-r--r--Manage.c19
-rw-r--r--Monitor.c138
-rw-r--r--Query.c9
-rw-r--r--ReadMe.c6
-rw-r--r--config.c9
-rwxr-xr-xinventory32
-rw-r--r--managemon.c4
-rw-r--r--mapfile.c35
-rw-r--r--md.480
-rw-r--r--mdadm.8522
-rw-r--r--mdadm.c25
-rw-r--r--mdadm.conf.529
-rw-r--r--mdadm.h11
-rw-r--r--mdadm.spec2
-rw-r--r--mdassemble.82
-rw-r--r--mdassemble.c9
-rw-r--r--mdmon.870
-rw-r--r--mdmon.c6
-rw-r--r--mdmon.h4
-rw-r--r--mdopen.c9
-rw-r--r--mdstat.c9
-rw-r--r--monitor.c4
-rw-r--r--platform-intel.c9
-rw-r--r--probe_roms.c26
-rw-r--r--probe_roms.h2
-rw-r--r--restripe.c2
-rw-r--r--super-ddf.c58
-rw-r--r--super-intel.c153
-rw-r--r--super0.c19
-rw-r--r--super1.c11
-rw-r--r--sysfs.c107
-rw-r--r--tests/07testreshape51
-rw-r--r--util.c22
74 files changed, 1054 insertions, 2766 deletions
diff --git a/ANNOUNCE-2.0 b/ANNOUNCE-2.0
deleted file mode 100644
index 46e1d98..0000000
--- a/ANNOUNCE-2.0
+++ /dev/null
@@ -1,41 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.0 - A tool for managing Soft RAID under Linux
-
-I am (at last) please to announce the availability of
- mdadm version 2.0
-
-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.0 contains a substantial rewrite of various pieces of
-functionality, particularly the --create option. This enables support
-for a new style of superblock - the version-1 superblock.
-Version-1 can support many more than 28 devices and can be easily
-moved between hosts with different endian-ness.
-Release 2.0 also contains support for the recent bitmap-intent-logging
-which will appear in 2.6.13, and the RAID1 write-behind that will be
-available in 2.6.14 (it is currently only in -mm).
-
-This release comes with a test-suite which has been used to verify that
-mdadm-2.0 actually works in a number of common scenarios. Some of the
-tests require a bleeding-edge kernel, so don't be surprised if some fail
-on kernels prior to 2.6.14.
-
-Being a '.0' release, 2.0 should be treated with some caution.
-However I believe it is quite stable and can safely be used on
-production systems.
-
-Note that this release is "2.0", not "2.0.0". I never found a use for
-the third number with 1.X.Y, so I dropped it.
-
-
-Development of mdadm has moved from CSE@UNSW and is now sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 26th August 2005
-
diff --git a/ANNOUNCE-2.1 b/ANNOUNCE-2.1
deleted file mode 100644
index fd328e7..0000000
--- a/ANNOUNCE-2.1
+++ /dev/null
@@ -1,37 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.1
-
-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.1 fixes a few problems found after the release of 2.0.
-If you are using raid10 or version-1 superblocks and upgrade is
-recommended.
-
-Specifically:
- - Fix assembling of raid10 array when devices are missing.
- mdadm now correctly detects if a array is workable or not
- depending on which devices are present, and so will correctly
- handle "--assemble --force" if multiple devices have failed.
- - Report raid10 layout in --examine output.
- - Fix assembling of arrays that use the version-1 superblock and
- have spares. Previously the spares would be ignored.
- - Fix bug so that multiple drives can be re-added at once.
- - Fix problem with hot-adding a bitmap to version-1-superblock
- arrays.
-
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 12th September 2005
-
-
diff --git a/ANNOUNCE-2.2 b/ANNOUNCE-2.2
deleted file mode 100644
index 8474c21..0000000
--- a/ANNOUNCE-2.2
+++ /dev/null
@@ -1,50 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.2 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.2
-
-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.2 fixes a few small bugs and add as few small elements of
-functionality. Possibly the most interesting is the addition of
-'README.initramfs' and 'mkinitramfs'. Feedback on these would be
-most welcome.
-
-Changelog Entries:
- - Assorted bug fixes
- - Support write-intent-bitmaps on raid10
- - Support little-endian (Rather than hostendian) bitmaps.
- - Return correct error code from 'mdadm -S'
- - Remove extra blank line from 'mdadm -Eb' output.
- - Improve option parsing so that -a and -b do not have
- optional arguements: the arg is either required or not
- depending on context.
- - Allow scanning of devices listed in /proc/partitions even
- if they don't appear in /dev.
- - Support --assume-clean in --create mode as well as --build
- - Add support for --monitor to report to syslog: -y or --syslog.
- Thanks to Ross Vandegrift
- - --monitor now reports which device failed in a 'Fail' message
- This broke with 2.6
- - Improve chance of array starting properly after a crash.
- mdadm was insisting the event numbers were identical, but this
- isn't needed, and is a problem if the crash was while the metadata
- was being updated.
- - Support --update==uuid
- - Added README.initramfs and mkinitramfs to help people use an
- initram for starting md arrays at boot.
-
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 5th December 2005
-
-
diff --git a/ANNOUNCE-2.3 b/ANNOUNCE-2.3
deleted file mode 100644
index b57dcb0..0000000
--- a/ANNOUNCE-2.3
+++ /dev/null
@@ -1,49 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.3 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.3
-
-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.3 fixes an assortment of bugs including the "--assemble --scan"
-crash. It also makes mdadm better at handling very large arrays.
-Finally, it adds some functionality to support some pending kernel
-features such as raid5 reshaping.
-
-Changelog Entries:
- - Try /etc/mdadm/mdadm.conf if /etc/mdadm.conf doesn't exist.
- This provided compatability for Debian.
- - Fixed for version-1 superblock:
- report chunksize for raid6 and raid10
- make sure device size used is a multiple of chunksize
- - Fix "--assemble --scan" crash.
- - Fix completely failure to create array on ppc64
- - Fix memcmp in place of memcpy
- - A few minor improvements to online help
- - Clean up usage of 'long long' for used-size of devices, so
- that it is possible to create a raid1 of 7TB devices!
- - Make internal bitmaps work on 7TB raid1 arrays.
- - Provide error message if --examine doesn't find any superblock.
- - Report 'reshape' status in --examine - this depends on kernel
- patches that are not yet finalised.
- - Report bitmap status in --detail and --examine
- - Default to v1 superblocks instead of v0.90 if the array
- is too big for 0.90 to handle.
- - Sort the output of "mdadm --detail --scan" so that it is
- in a suitable order for assembling arrays. i.e. components come
- before an array that they are part of.
- - Print size of large reiserfs array properly went warning of
- possible confilcts.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 2nd February 2006
-
diff --git a/ANNOUNCE-2.3.1 b/ANNOUNCE-2.3.1
deleted file mode 100644
index b84668b..0000000
--- a/ANNOUNCE-2.3.1
+++ /dev/null
@@ -1,31 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.3.1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.3.1
-
-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.3.1 primarily fixes a few compile problems with 2.3. Though
-there are some functionality changes, they are extremely minor and you
-probably won't notice them.
-
-Changelog Entries:
- - Fixed -O2 compile so I could make and RPM.
- - Type cast number to be printed %llu so it compiles on 64bit
- machines. (Thanks Luca).
- - Stop using asm/byteorder.h - to make Redhat happy :-(
- - Require bitmap files to have a '/' in their name.
- - Error-check a few syscalls - code from SuSE package.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 6th February 2006
-
diff --git a/ANNOUNCE-2.4 b/ANNOUNCE-2.4
deleted file mode 100644
index 3923af5..0000000
--- a/ANNOUNCE-2.4
+++ /dev/null
@@ -1,45 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.4 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.4
-
-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.4 primarily adds support for increasing the number of
-devices in a RAID5 array, which requires 2.6.17 (or some -rc or -mm
-prerelease).
-It also includes a number of minor functionality enhancements and
-documentation updates.
-
-Changelog Entries:
- - Rewrite 'reshape' support including performing a backup
- of the critical region for a raid5 growth, and restoring that
- backup after a crash.
- - Put a 'canary' at each end of the backup so a corruption
- can be more easily detected.
- - Remove useless 'ident' arguement from ->getinfo_super method.
- - Support --backup-file for backing-up critical section during
- growth.
- - Erase old superblocks (of different versions) when creating new
- array.
- - Allow --monitor to work with arrays with >28 devices
- - Report reshape information in --detail
- - Handle symlinks in /dev better
- - Fix mess in --detail output which a device is missing.
- - Manpage tidyup
- - Support 'bitmap=' in mdadm.conf for auto-assembling arrays with
- write-intent bitmaps in separate files.
- - Updates to md.4 man page including section on RESTRIPING and SYSFS
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 30th March 2006
-
diff --git a/ANNOUNCE-2.4-pre1 b/ANNOUNCE-2.4-pre1
deleted file mode 100644
index bd906b4..0000000
--- a/ANNOUNCE-2.4-pre1
+++ /dev/null
@@ -1,24 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.4-pre1 - development release for testing only
-
-I am somewhat cautious in announcing the availability of
- mdadm version 2.4-pre1
-
-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/
-
-pre-release 2.4-pre1 contains support for growing a raid5 array i.e.
-adding extra drives and restriping the whole arrays.
-
-This requires a kernel more recent than 2.6.16-rc6-mm2.
-
-During a restripe, there is a crtical section at the start where a
-system crash can leave the contents of the raid5 unrecoverable. This
-version of mdadm will backup that section, and can restore it when
-reassembling the array after a crash.
-
-Have fun, but use it carefully and report any problems.
-
-NeilBrown 20th March 2006
-
diff --git a/ANNOUNCE-2.4.1 b/ANNOUNCE-2.4.1
deleted file mode 100644
index 255f049..0000000
--- a/ANNOUNCE-2.4.1
+++ /dev/null
@@ -1,31 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.4.1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.4.1
-
-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.
-
-2.4.1 primarily fixes an alignment problem in the version-1
-superblock. This is an incompatible change relating to
-raid5-reshape. Read the change log below.
-
-Changelog Entries:
- - Honour --write-mostly when adding to an array without persistent
- superblocks.
- - Fix alignment problem in version-1 superblocks.
- NOTE: This is an incompatable change affecting raid5 reshape.
- If you want to reshape a raid5 using version-1 superblocks,
- use 2.6.17-rc2 or later, and mdadm-2.4.1 or later.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 7th April 2006
-
diff --git a/ANNOUNCE-2.5 b/ANNOUNCE-2.5
deleted file mode 100644
index 8515015..0000000
--- a/ANNOUNCE-2.5
+++ /dev/null
@@ -1,67 +0,0 @@
-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
-
diff --git a/ANNOUNCE-2.5.1 b/ANNOUNCE-2.5.1
deleted file mode 100644
index 75c48e8..0000000
--- a/ANNOUNCE-2.5.1
+++ /dev/null
@@ -1,40 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.1
-
-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/
-and via git at
- git://neil.brown.name/git/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.1 adds multiple minor updates including a couple of bugfixes.
-
-Changelog Entries:
- - Various fixes for gcc warnings
- - uclibc warnings
- - Makefile improvements for static linking/intalling
- - Makefile uninstall target
- - Really fix return status of --examine
- - Typos
- - Byteorder stuff (again)
- - Don't try to create devices with --manage or --grow
- - allow default metadata (superblock) type to be specified
- in mdadm.conf
- - Get --stop to list devices stopped but honour --quiet
- - remove libssl dependency
- - Avoid some misdetection of overlapping partitions
- - Fix memory leak in --monitor mode
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 16th June 2006
-
-
diff --git a/ANNOUNCE-2.5.2 b/ANNOUNCE-2.5.2
deleted file mode 100644
index 06fd949..0000000
--- a/ANNOUNCE-2.5.2
+++ /dev/null
@@ -1,45 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.2 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.2
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.2 is primarily a bugfix release over 2.5.1.
-It also contains a work-around for a kernel bug which affects
-hot-adding to arrays with a version-1 superblock.
-
-Changelog Entries:
- - Fix problem with compiling with gcc-2 compilers
- - Fix compile problem of post-incrmenting a variable in a macro arg.
- - Stop map_dev from returning [0:0], as that breaks things.
- - Add 'Array Slot' line to --examine for version-1 superblocks
- to make it a bit easier to see what is happening.
- - Work around bug in --add handling for version-1 superblocks
- in 2.6.17 (and prior).
- - Make -assemble a bit more resilient to finding strange
- information in superblocks.
- - Don't claim newly added spares are InSync!! (don't know why that
- code was ever in there)
- - Work better when no 'ftw' is available, and check to see
- if current uclibc provides ftw.
- - Never use /etc/mdadm.conf if --config file is given (previously
- some code used one, some used the other).
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 27th June 2006
-
-
diff --git a/ANNOUNCE-2.5.3 b/ANNOUNCE-2.5.3
deleted file mode 100644
index 92aa278..0000000
--- a/ANNOUNCE-2.5.3
+++ /dev/null
@@ -1,33 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.3 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.3
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.3 is a bugfix release over 2.5.2.
-
-Changelog Entries:
- - Document v0.91 superblocks in md.4
- - Make GPL explicit in man pages.
- - Fix recent breakage of starting degraded arrays.
- - Tidyup automatic name choice for v-1 arrays:
- /dev/md_d0 now becomes '0', not '_d0'.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 7th August 2006
-
-
diff --git a/ANNOUNCE-2.5.4 b/ANNOUNCE-2.5.4
deleted file mode 100644
index bf2f197..0000000
--- a/ANNOUNCE-2.5.4
+++ /dev/null
@@ -1,38 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.4 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.4
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.4 is a bugfix release over 2.5.3
-
-Changelog Entries:
- - When creating devices in /dev/md/ create matching symlinks
- from /dev. e.g. /dev/md0 -> /dev/md/0.
- Allow this to be disabled in mdadm.conf or on command line.
- - Fix some endian-ness issues with version-1 superblocks (affects
- bigendian only).
- - Fix endian problem with 'bitmap' metadata
- - Allow a number (of partitions) after the 'yes' option to --auto=
- This is particularly useful in the 'create' line in mdadm.conf.
- - Remove partitions from any whole device that is made part of
- an md array. This is a work-around for annoying messages
- when the first block on some drive accidentally looks like a
- partition table.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 13th October 2006
diff --git a/ANNOUNCE-2.5.5 b/ANNOUNCE-2.5.5
deleted file mode 100644
index 73eea4e..0000000
--- a/ANNOUNCE-2.5.5
+++ /dev/null
@@ -1,43 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.5 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.5
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.5 is a bugfix release over 2.5.4.
-Hopefully the last before 2.6.
-
-Changelog Entries:
- - Don't #include linux/blkpg.h as that isn't safe. Just
- include the content literally.
- - Reduce maximum bitmap usage when working with bitmap files,
- so that a only single-page allocations are made, even on
- 64bit hosts with 4K pages.
- - Close stray fd in mdassemble so that it can assemble stacked
- devices
- - If mdassemble finds an array already assembled, it marks it
- read-write.
- - Remove error in md_open if array is already active. This isn't
- needed and gets in the ways if an array was created e.g. in
- initramfs, but device doesn't yet exist in /dev.
- - When --assemble --scan is run, if all arrays that could be found
- have already been started, don't report an error.
- - Fix a couple of bugs related to raid10 and the new 'offset' layout.
- - Improve error message when a wrong '--update' option is given.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 23rd October 2006
diff --git a/ANNOUNCE-2.5.6 b/ANNOUNCE-2.5.6
deleted file mode 100644
index 80daa7c..0000000
--- a/ANNOUNCE-2.5.6
+++ /dev/null
@@ -1,32 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.5.6 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.5.6
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6 is a bugfix release over 2.5.5, which it turns out
-wasn't the last before 2.6. Maybe this one?
-
-Changelog Entries:
- - Fix bug which meant "bitmap=xxx" in mdadm.conf was not handled
- properly.
- - Documentation updates.
- - Fix bug that caused infinite loop when doing auto-assembly,
- in certain cases where arrays couldn't be assembled.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 6th November 2006
diff --git a/ANNOUNCE-2.6 b/ANNOUNCE-2.6
deleted file mode 100644
index cd3741d..0000000
--- a/ANNOUNCE-2.6
+++ /dev/null
@@ -1,76 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6 adds assorted fixes and improvements and a new major mode.
-"Incremental Assembly" via -I or --incremental can be used to
-assemble an array one device at a time. The idea is that you get
-udev to run "mdadm -Iq devicename" on each new block device that it
-finds. Anything that is part of an array gets included in an array as
-appropriate.
-Two special notes:
- 1/ This is very new code and is probably buggy. It passes a few basic
- tests, and helped me find some kernel bugs, but it is still fresh
- and should not be considered 'stable'. Please test and provide
- feedback.
- 2/ There is a bug in the linux kernel that makes incremental assembly
- not possible in general (you cannot safely remove a drive from an array
- that has not yet been started. This is needed if an old device was
- detected first). If mdadm detects a kernel which might have the
- bug, it rejects --incremental requests.
- The bug will hopefully be fixed in 2.6.20 and this mdadm release
- contains patches for 2.6.18, 2.6.18.6 and 2.6.19. Apply the
- appropriate patch to test --incremental.
-
-Changelog Entries:
- - Fixed UUID printing in "--detail --brief" for version1 metadata.
- - --update=resync did exactly the wrong thing for version1 metadata.
- It caused a resync to not happen, rather than to happen.
- - Allow --assemble --force to mark a raid6 clean when it has two
- missing devices (which is needed else if won't assemble.
- Without this fix it would only assemble if one or zero
- missing devices.
- - Support --update=devicesize for cases where the underlying device
- can change size.
- - Default to --auto=yes so the array devices with 'standard' names
- get created automatically, as this is almost always what is wanted.
- - Give useful message if raid4/5/6 cannot be started because it is
- not clean and is also degraded.
- - Increase raid456 stripe cache size if needed to --grow the array.
- The setting used unfortunately requires intimate knowledge of the
- kernel, and it not reset when the reshape finishes.
- - Change 'Device Size' to 'Used Dev Size' because it only shows how
- much of each device is actually used, not how big they are.
- - --wait or -W will wait for resync activity to finish on the given
- devices.
- - Fix some problems with --update=uuid and add a test.
- - If two drives in a raid5 disappear at the same time, then "-Af"
- will add them both in rather than just one and forcing the array
- to 'clean'. This is slightly safer in some cases.
- - Check device is large enough before hot-add: this improves quality
- of error message.
- - Don't hold md device open for so long in --monitor mode - map_dev
- can be slow and interferes with trying to stop the array.
- - Support --uuid= with --create to choose your own UUID.
- - New major more "--incremental" for incremental assemble of arrays,
- intended for use with udev.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 21st December 2006
-Blessed Christmas to all.
diff --git a/ANNOUNCE-2.6.1 b/ANNOUNCE-2.6.1
deleted file mode 100644
index 2cea723..0000000
--- a/ANNOUNCE-2.6.1
+++ /dev/null
@@ -1,33 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.1
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.1 adds a few minor bug fixes to 2.6 including improved
-support for growing a RAID6 array.
-
-Changelog Entries:
- - --monitor was producing some meaningless warnings due to a bug.
- - Fix some compiler warnings.
- - Fully support --grow for raid6. If a reshape crashed during the
- critical period, mdadm wouldn't restore the Q information
- properly.
- - Update documentation for --grow.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 22nd February 2007
diff --git a/ANNOUNCE-2.6.2 b/ANNOUNCE-2.6.2
deleted file mode 100644
index 215bd1a..0000000
--- a/ANNOUNCE-2.6.2
+++ /dev/null
@@ -1,37 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.2 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.2
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.2 adds a few minor bug fixes to 2.6.1
-
-Changelog Entries:
- - --fail detached and --remove faulty can be used to fail and
- remove devices that are no longer physically present.
- - --export option for --detail or present information in a format
- that can be processed by udev.
- - fix internal bitmap allocation problems with v1.1, v1.2 metadata.
- - --help now goes to stdout so you can direct it to a pager.
- - Various manpage updates.
- - Make "--grow --add" for linear arrays really work.
- - --auto-detect to trigger in-kernel autodetect.
- - Make return code for "--detail --test" more reliable. Missing
- devices as well as failed devices cause an error.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 21st May 2007
diff --git a/ANNOUNCE-2.6.3 b/ANNOUNCE-2.6.3
deleted file mode 100644
index 168539d..0000000
--- a/ANNOUNCE-2.6.3
+++ /dev/null
@@ -1,44 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.3 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.3
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.3 adds a few minor bug fixes to 2.6.2
-
-Changelog Entries:
- - allow --write-behind to be set for --grow.
- - When adding new disk to an array, don't reserve so much bitmap
- space that the disk cannot store the required data. (Needed when
- 1.x array was created with older mdadm).
- - When adding a drive that was a little too small, we did not get
- the correct error message.
- - Make sure that if --assemble find an array in the critical region
- of a reshape, and cannot find the critical data to restart the
- reshape, it gives an error message.
- - Fix segfault with '--detail --export' and non-persistent
- superblocks.
- - Various manpage updates.
- - Improved 'raid4' support (--assemble, --monitor)
- - Option parsing fixes w.r.t -a
- - Interpret "--assemble --metadata=1" to allow any version 1.x
- metadata, and be more specific in the "metadata=" message printed
- with --examine --brief
- - Fix spare migration in --monitor.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 20th August 2007
diff --git a/ANNOUNCE-2.6.4 b/ANNOUNCE-2.6.4
deleted file mode 100644
index fd745fa..0000000
--- a/ANNOUNCE-2.6.4
+++ /dev/null
@@ -1,31 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.4 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.4
-
-It is available at the usual places:
- http://www.cse.unsw.edu.au/~neilb/source/mdadm/
-and
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.4 adds a few minor bug fixes to 2.6.3
-
-Changelog Entries:
- - Make "--create --auto=mdp" work for non-standard device names.
- - Fix restarting of a 'reshape' if it was stopped in the middle.
- - Fix a segfault when using v1 superblock.
- - Make --write-mostly effective when re-adding a device to an array.
- - Various minor fixes
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 19th October 2007
diff --git a/ANNOUNCE-2.6.5 b/ANNOUNCE-2.6.5
deleted file mode 100644
index c5f3138..0000000
--- a/ANNOUNCE-2.6.5
+++ /dev/null
@@ -1,40 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.5 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.5
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.5 adds a few minor bug fixes to 2.6.4
-
-Changelog Entries:
- - Avoid segfault when parsing /proc/mdstat with auto-read-only
- arrays.
- - Fix problem with failing to add devices to v.large (>4TB) arrays,
- cause by problems with device-size overflow.
- - For v0.90 superblocks, print the 'Events' count as a real count,
- not 2 numbers separated by a dot.
- - Updates some URLs in the man page.
- - Allow creation of a RAID6 with exactly one missing device.
- - Use LOG_PID for syslog, so you get the pid of mdadm in the log
- files.
- - --export now works with --examine too (not just --detail)
- - Improve auto-creation of device special file when using
- --incremental
- - Simple locking for --incremental so mdadm doesn't get confused
- when run concurrently with itself.
- - Make --incremental cope better with arrays that are being reshaped.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 15th May 2007
diff --git a/ANNOUNCE-2.6.6 b/ANNOUNCE-2.6.6
deleted file mode 100644
index 8253429..0000000
--- a/ANNOUNCE-2.6.6
+++ /dev/null
@@ -1,27 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.6 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.6
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.6 fixes a compile problem in 2.6.5 and adds a small manpage update.
-
-Changelog Entries:
- - "make everything" now make mdassemble.auto
- - fix compile problem with mdassemble.auto
- - Update FAQ URLs in man page again.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 19th May 2007
diff --git a/ANNOUNCE-2.6.7 b/ANNOUNCE-2.6.7
deleted file mode 100644
index 5fa4a80..0000000
--- a/ANNOUNCE-2.6.7
+++ /dev/null
@@ -1,27 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.7 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.7
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.7 fixes a few bugs in 2.6.5 which 2.6.6 didn't fix.
-
-Changelog Entries:
- - Avoid NULL reference calling free_super and elsewhere.
- - Remove stray semicolon (Causes compile error with gcc-2.95)
- - Fix autoassemble for stack arrays.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 6th June 2008
diff --git a/ANNOUNCE-2.6.8 b/ANNOUNCE-2.6.8
deleted file mode 100644
index 55f484c..0000000
--- a/ANNOUNCE-2.6.8
+++ /dev/null
@@ -1,58 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.8 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.8
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.8 contains various bug fixes and minor enhancements.
-It is possibly that 2.6.8 will be the last release in the 2.x
-series and very likely that there will never be a 2.7.
-Hopefully 3.0 will be released soon making future development
-of 2.6.x unnecessary. However if a need does arise for a 2.6.9
-it will be considered.
-
-Changelog Entries:
- fix add_dev() handling of broken links
- Assemble: allow --force to work even when event counts are 0.
- mapfile: fix bug in testing for /var/run/mdadm/
- Incremental: change precedence order for autof setting.
- Adjust major number testing to allow for extended minor number in 2.6.28
- Incremental: allow assembly of foreign array.
- Incremental: fix setting of 'autof' flag.
- Fix --incremental assembly of partitions arrays.
- Fix NULL pointer oops
- Fix bad metadata formatting
- Allow WRITEMOSTLY to be cleared on --readd using --readwrite.
- Remove .UR .UE macros from man page because the don't do what we want.
- Grow: Fix linear-growth when devices are not all the same size.
- Improve reporting of layout for raid10.
- Manage: allow adding device that is just large enough to v1.x array.
- Cosmetic cleanup of some messages.
- Clean up usage of open()
- Add support for distribution specific build extensions
- Fix confusing usage in md.4 man page.
- Describe the HOMEHOST entry in the mdadm.conf man page.
- Some more cleanup of tests.
- Add test for stoping and restarting a raid5 reshape.
- Add "bitmap=" to "--detail --brief" output when relevant.
- Improve error message when mdadm fails to stop an array.
- Couple more man page fixes
- Add text to man pages suggesting partition type to use for version 1.x metadata.
- Italic/bold fixes in man pages.
- Fix bug in forced assemble.
- Fix an error when assembling arrays that are in the middle of a reshape.
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 28th November 2008
diff --git a/ANNOUNCE-2.6.9 b/ANNOUNCE-2.6.9
deleted file mode 100644
index ddbc530..0000000
--- a/ANNOUNCE-2.6.9
+++ /dev/null
@@ -1,51 +0,0 @@
-Subject: ANNOUNCE: mdadm 2.6.9 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 2.6.9
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=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.6.9 contains various bug fixes.
-Clearly 2.6.8 was not the final 2.x release.
-Hopefully 2.6.9 will be as I don't want go to 2.7, and
-2.6.10 might be confusing (though I'll probably go that
-way if I need to).
-
-New features will only appear in the 3.x series of which 3.0 will be
-release within a few months.
-
-Changelog Entries:
- Bernhard Reutner-Fischer (1):
- mdadm fix compilation for uClibc
-
- Dustin Kirkland (2):
- Fail overtly when asprintf fails to allocate memory
- Typo in earlier patch : asprintf -> vasprintf
-
- NeilBrown (11):
- Allow --config in --incremental mode.
- Kill: Don't use O_EXCL when --force is used.
- Assemble: don't assume array is 'clean' unless all devices think it is.
- Assemble: set stripe_cache_size properly when restarting a reshape.
- map: rebuild map if it doesn't exist.
- Free mdstat data structures properly.
- Fix the used device size in mdadm -D output.
- Document 'max' option to --grow --size in --help output.
- Fix possible crash if bitmap metadata is bad.
- Monitor: send --test message for arrays in /proc/mdstat that aren't in mdadm.conf
- super1: make sure max_dev grows enough when adding a device to an array.
-
-
-Development of mdadm is sponsored by
- SUSE Labs, Novell Inc.
-
-NeilBrown 28th November 2008
diff --git a/ANNOUNCE-3.0-devel2 b/ANNOUNCE-3.0
index 0f2924c..f2d4f84 100644
--- a/ANNOUNCE-3.0-devel2
+++ b/ANNOUNCE-3.0
@@ -1,7 +1,7 @@
-Subject: ANNOUNCE: mdadm 3.0-devel2 - A tool for managing Soft RAID under Linux
+Subject: ANNOUNCE: mdadm 3.0 - A tool for managing Soft RAID under Linux
-I am pleased to announce the availability of
- mdadm version 3.0-devel2
+I am pleased to (finally) announce the availability of
+ mdadm version 3.0
It is available at the usual places:
countrycode=xx.
@@ -10,8 +10,11 @@ and via git at
git://neil.brown.name/mdadm
http://neil.brown.name/git?p=mdadm
-Note that this is a "devel" release. It should be used with
-caution, though it is believed to be close to release-candidate stage.
+
+This is a major new version and as such should be treated with some
+caution. However it has seen substantial testing and is considerred
+to be ready for wide use.
+
The significant change which justifies the new major version number is
that mdadm can now handle metadata updates entirely in userspace.
@@ -28,7 +31,7 @@ If udev is installed on the system, mdadm will not create any devices
in /dev. Rather it allows udev to manage those devices. For this to work
as expected, the included udev rules file should be installed.
-If udev is not install, mdadm will still create devices and symlinks
+If udev is not installed, mdadm will still create devices and symlinks
as required, and will also remove them when the array is stopped.
mdadm now requires all devices which do not have a standard name (mdX
@@ -92,7 +95,4 @@ versions for mdadm are still supported and the kernel still performs
the same updates it use to. The new 'mdmon' approach is only used for
newly introduced metadata types.
-Any testing and feedback will be greatly appreciated.
-
-NeilBrown 5th November 2008
-
+NeilBrown 2nd June 2009
diff --git a/ANNOUNCE-3.0-devel1 b/ANNOUNCE-3.0-devel1
deleted file mode 100644
index 89ed2e3..0000000
--- a/ANNOUNCE-3.0-devel1
+++ /dev/null
@@ -1,84 +0,0 @@
-Subject: ANNOUNCE: mdadm 3.0-devel1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 3.0-devel1
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=mdadm
-
-Note that this is a "devel" release. It is not intended for
-production use yet, but rather for testing and ongoing development.
-
-The significant change which justifies the new major version number is
-that mdadm can now handle metadata updates entirely in userspace.
-This allows mdadm to support metadata formats that the kernel knows
-nothing about.
-
-Currently two such metadata formats are supported:
- - DDF - The SNIA standard format
- - Intel Matrix - The metadata used by recent Intel ICH controlers.
-
-The manual pages have not yet been updated, but here is a brief outline.
-
-Externally managed metadata introduces the concept of a 'container'.
-A container is a collection of (normally) physical devices which have
-a common set of metadata. A container is assembled as an md array, but
-is left 'inactive'.
-
-A container can contain one or more data arrays. These are composed from
-slices (partitions?) of various devices in the container.
-
-For example, a 5 devices DDF set can container a RAID1 using the first
-half of two devices, a RAID0 using the first half of the remain 3 devices,
-and a RAID5 over thte second half of all 5 devices.
-
-A container can be created with
-
- mdadm --create /dev/md0 -e ddf -n5 /dev/sd[abcde]
-
-or "-e imsm" to use the Intel Matrix Storage Manager.
-
-An array can be created within a container either by giving the
-container name and the only member:
-
- mdadm -C /dev/md1 --level raid1 -n 2 /dev/md0
-
-or by listing the component devices
-
- mdadm -C /dev/md2 --level raid0 -n 3 /dev/sd[cde]
-
-The assemble a container, it is easiest just to pass each device in turn to
-mdadm -I
-
- for i in /dev/sd[abcde]
- do mdadm -I $i
- done
-
-This will assemble the container and the components.
-
-Alternately the container can be assembled explicitly
-
- mdadm -A /dev/md0 /dev/sd[abcde]
-
-Then the components can all be assembled with
-
- mdadm -I /dev/md0
-
-For each container, mdadm will start a program called "mdmon" which will
-monitor the array and effect any metadata updates needed. The array is
-initially assembled readonly. It is up to "mdmon" to mark the metadata
-as 'dirty' and which the array to 'read-write'.
-
-The version 0.90 and 1.x metadata formats supported by previous
-versions for mdadm are still supported and the kernel still performs
-the same updates it use to. The new 'mdmon' approach is only used for
-newly introduced metadata types.
-
-Any testing and feedback will be greatly appreciated.
-
-NeilBrown 18th September 2008
-
diff --git a/ANNOUNCE-3.0-devel3 b/ANNOUNCE-3.0-devel3
deleted file mode 100644
index 078be07..0000000
--- a/ANNOUNCE-3.0-devel3
+++ /dev/null
@@ -1,113 +0,0 @@
-Subject: ANNOUNCE: mdadm 3.0-devel3 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 3.0-devel3
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=mdadm
-
-Note that this is a "devel" release. It should be used with
-caution, though it is believed to be close to release-candidate stage.
-
-There have been numerous improvements and additions since -devel2.
-I think we are close to a release of 3.0.
-
-I need to add lots of tests to the test suite to test the new
-functionality. And I need to review the man pages.
-
-After that I will release -rc1 followed by -final.
-
-
-The following is the same introduction to 3.x as appeared in
-previous announcements.
-
-
-Any testing and feedback will be greatly appreciated.
-
-NeilBrown 10th March 2009
-
-
-=====================================================
-
-The significant change which justifies the new major version number is
-that mdadm can now handle metadata updates entirely in userspace.
-This allows mdadm to support metadata formats that the kernel knows
-nothing about.
-
-Currently two such metadata formats are supported:
- - DDF - The SNIA standard format
- - Intel Matrix - The metadata used by recent Intel ICH controlers.
-
-Also the approach to device names has changed significantly.
-
-If udev is installed on the system, mdadm will not create any devices
-in /dev. Rather it allows udev to manage those devices. For this to work
-as expected, the included udev rules file should be installed.
-
-If udev is not install, mdadm will still create devices and symlinks
-as required, and will also remove them when the array is stopped.
-
-mdadm now requires all devices which do not have a standard name (mdX
-or md_dX) to live in the directory /dev/md/. Names in this directory
-will always be created as symlinks back to the standard name in /dev.
-
-The man pages contain some information about the new externally managed
-metadata. However see below for a more condensed overview.
-
-Externally managed metadata introduces the concept of a 'container'.
-A container is a collection of (normally) physical devices which have
-a common set of metadata. A container is assembled as an md array, but
-is left 'inactive'.
-
-A container can contain one or more data arrays. These are composed from
-slices (partitions?) of various devices in the container.
-
-For example, a 5 devices DDF set can container a RAID1 using the first
-half of two devices, a RAID0 using the first half of the remain 3 devices,
-and a RAID5 over thte second half of all 5 devices.
-
-A container can be created with
-
- mdadm --create /dev/md0 -e ddf -n5 /dev/sd[abcde]
-
-or "-e imsm" to use the Intel Matrix Storage Manager.
-
-An array can be created within a container either by giving the
-container name and the only member:
-
- mdadm -C /dev/md1 --level raid1 -n 2 /dev/md0
-
-or by listing the component devices
-
- mdadm -C /dev/md2 --level raid0 -n 3 /dev/sd[cde]
-
-To assemble a container, it is easiest just to pass each device in turn to
-mdadm -I
-
- for i in /dev/sd[abcde]
- do mdadm -I $i
- done
-
-This will assemble the container and the components.
-
-Alternately the container can be assembled explicitly
-
- mdadm -A /dev/md0 /dev/sd[abcde]
-
-Then the components can all be assembled with
-
- mdadm -I /dev/md0
-
-For each container, mdadm will start a program called "mdmon" which will
-monitor the array and effect any metadata updates needed. The array is
-initially assembled readonly. It is up to "mdmon" to mark the metadata
-as 'dirty' and which the array to 'read-write'.
-
-The version 0.90 and 1.x metadata formats supported by previous
-versions for mdadm are still supported and the kernel still performs
-the same updates it use to. The new 'mdmon' approach is only used for
-newly introduced metadata types.
diff --git a/ANNOUNCE-3.0-rc1 b/ANNOUNCE-3.0-rc1
deleted file mode 100644
index c6269d4..0000000
--- a/ANNOUNCE-3.0-rc1
+++ /dev/null
@@ -1,139 +0,0 @@
-Subject: ANNOUNCE: mdadm 3.0-rc1 - A tool for managing Soft RAID under Linux
-
-I am pleased to announce the availability of
- mdadm version 3.0-rc1
-
-It is available at the usual places:
- countrycode=xx.
- http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
-and via git at
- git://neil.brown.name/mdadm
- http://neil.brown.name/git?p=mdadm
-
-This is a "release candidate" which means that I think it is safe
-to use and that there will be no significant change in functionality
-before release.
-
-The man pages aren't really "release candidate" yet but I will be
-working on them before the final release.
-
-The most significant changes since -devel3 relate to the names of md
-devices as they appear in /dev and /dev/md/, and in particular the names
-that are used when an array is assembled with "--incremental" or with
-"mdadm --assemble --scan" when there are no ARRAY lines in mdadm.conf.
-In these cases mdadm needs to deduce a name to use, and to try to
-avoid using a name that a different array might have a stronger claim to.
-The rules are:
- - if the array is mentioned in mdadm.conf, use the name given there.
- - if the array appear to have been created for "this host" using the
- "homehost" concept, trust the name given in the metadata
- - if the new setting "HOMEHOST <ignore>" is given (can be in mdadm.conf
- or on command line) the the name given in the metadata is not
- associated with some other array by mdadm.conf, then trust the
- name given in the metadata
- - otherwise use the name in the metadata, but in an untrusted manner.
-
-If a name is untrusted, or if the name is already in use by another
-array, then a numeric suffix like "_0", "_1" is appended to create
-a unique name for the array.
-
-That name is then used to create a device file in /dev/md/.
-
-So if all arrays needed for boot will always be listed in
-/etc/mdadm.conf, then it is appropriate to add "HOMEHOST <ignore>" to
-mdadm.conf and there is no risk of conflicting names. However if you
-want auto-assemble to assemble all arrays at boot time and you don't
-want to list them in mdadm.conf, then don't give "HOMEHOST <ignore>"
-either else there could be a risk of the wrong array being assembled
-for a given name.
-
-
-
-The following is the same introduction to 3.x as appeared in
-previous announcements.
-
-Any testing and feedback will be greatly appreciated.
-
-NeilBrown 11th May 2009
-
-
-=====================================================
-
-The significant change which justifies the new major version number is
-that mdadm can now handle metadata updates entirely in userspace.
-This allows mdadm to support metadata formats that the kernel knows
-nothing about.
-
-Currently two such metadata formats are supported:
- - DDF - The SNIA standard format
- - Intel Matrix - The metadata used by recent Intel ICH controlers.
-
-Also the approach to device names has changed significantly.
-
-If udev is installed on the system, mdadm will not create any devices
-in /dev. Rather it allows udev to manage those devices. For this to work
-as expected, the included udev rules file should be installed.
-
-If udev is not install, mdadm will still create devices and symlinks
-as required, and will also remove them when the array is stopped.
-
-mdadm now requires all devices which do not have a standard name (mdX
-or md_dX) to live in the directory /dev/md/. Names in this directory
-will always be created as symlinks back to the standard name in /dev.
-
-The man pages contain some information about the new externally managed
-metadata. However see below for a more condensed overview.
-
-Externally managed metadata introduces the concept of a 'container'.
-A container is a collection of (normally) physical devices which have
-a common set of metadata. A container is assembled as an md array, but
-is left 'inactive'.
-
-A container can contain one or more data arrays. These are composed from
-slices (partitions?) of various devices in the container.
-
-For example, a 5 devices DDF set can container a RAID1 using the first
-half of two devices, a RAID0 using the first half of the remain 3 devices,
-and a RAID5 over thte second half of all 5 devices.
-
-A container can be created with
-
- mdadm --create /dev/md0 -e ddf -n5 /dev/sd[abcde]
-
-or "-e imsm" to use the Intel Matrix Storage Manager.
-
-An array can be created within a container either by giving the
-container name and the only member:
-
- mdadm -C /dev/md1 --level raid1 -n 2 /dev/md0
-
-or by listing the component devices
-
- mdadm -C /dev/md2 --level raid0 -n 3 /dev/sd[cde]
-
-To assemble a container, it is easiest just to pass each device in turn to
-mdadm -I
-
- for i in /dev/sd[abcde]
- do mdadm -I $i
- done
-
-This will assemble the container and the components.
-
-Alternately the container can be assembled explicitly
-
- mdadm -A /dev/md0 /dev/sd[abcde]
-
-Then the components can all be assembled with
-
- mdadm -I /dev/md0
-
-For each container, mdadm will start a program called "mdmon" which will
-monitor the array and effect any metadata updates needed. The array is
-initially assembled readonly. It is up to "mdmon" to mark the metadata
-as 'dirty' and which the array to 'read-write'.
-
-The version 0.90 and 1.x metadata formats supported by previous
-versions for mdadm are still supported and the kernel still performs
-the same updates it use to. The new 'mdmon' approach is only used for
-newly introduced metadata types.
diff --git a/ANNOUNCE-3.0.1 b/ANNOUNCE-3.0.1
new file mode 100644
index 0000000..91b4428
--- /dev/null
+++ b/ANNOUNCE-3.0.1
@@ -0,0 +1,22 @@
+Subject: ANNOUNCE: mdadm 3.0.1 - A tool for managing Soft RAID under Linux
+
+I am pleased to announce the availability of
+ mdadm version 3.0.1
+
+It is available at the usual places:
+ countrycode=xx.
+ http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
+and via git at
+ git://neil.brown.name/mdadm
+ http://neil.brown.name/git?p=mdadm
+
+
+This contains only minor bug fixes over 3.0. If you are using
+3.0, you could consider upgrading.
+
+The brief change log is:
+ - Fix various segfaults
+ - Fixed for --examine with containers
+ - Lots of other little fixes.
+
+NeilBrown 25th September 2009
diff --git a/ANNOUNCE-3.0.2 b/ANNOUNCE-3.0.2
new file mode 100644
index 0000000..93643d1
--- /dev/null
+++ b/ANNOUNCE-3.0.2
@@ -0,0 +1,21 @@
+Subject: ANNOUNCE: mdadm 3.0.2 - A tool for managing Soft RAID under Linux
+
+I am pleased to announce the availability of
+ mdadm version 3.0.2
+
+It is available at the usual places:
+ countrycode=xx.
+ http://www.${countrycode}kernel.org/pub/linux/utils/raid/mdadm/
+and via git at
+ git://neil.brown.name/mdadm
+ http://neil.brown.name/git?p=mdadm
+
+
+This just contains one bugfix over 3.0.1 - I was obviously a bit hasty
+in releasing that one.
+
+The brief change log is:
+ - Fix crash when hosthost is not set, as often happens in
+ early boot.
+
+NeilBrown 25th September 2009
diff --git a/Assemble.c b/Assemble.c
index 3bde9ce..7c3a249 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -188,6 +183,8 @@ int Assemble(struct supertype *st, char *mddev,
if (!devlist &&
ident->uuid_set == 0 &&
ident->super_minor < 0 &&
+ ident->name[0] == 0 &&
+ (ident->container == NULL || ident->member == NULL) &&
ident->devices == NULL) {
fprintf(stderr, Name ": No identity information available for %s - cannot assemble.\n",
mddev ? mddev : "further assembly");
@@ -323,6 +320,8 @@ int Assemble(struct supertype *st, char *mddev,
content = tmpdev->content;
else
content = tst->ss->container_content(tst);
+ if (!content)
+ goto loop; /* empty container */
tmpdev->content = content->next;
if (tmpdev->content == NULL)
diff --git a/Build.c b/Build.c
index 2d9f68f..7f39258 100644
--- a/Build.c
+++ b/Build.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
diff --git a/ChangeLog b/ChangeLog
index adf622c..e829cfe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,770 +1,20 @@
-Changed Prior to this release
- - --readwrite can be used with --re-add to clear the writemostly
- flag.
-
-Changes Prior to 2.6.7 release
- - Avoid NULL reference calling free_super and elsewhere.
- - Remove stray semicolon (Causes compile error with gcc-2.95)
- - Fix autoassemble for stack arrays.
-
-Changes Prior to 2.6.6 release
- - "make everything" now make mdassemble.auto
- - fix compile problem with mdassemble.auto
- - Update FAQ URLs in man page again.
-
-Changes Prior to 2.6.5 release
- - Avoid segfault when parsing /proc/mdstat with auto-read-only
- arrays.
- - Fix problem with failing to add devices to v.large (>4TB) arrays,
- cause by problems with device-size overflow.
- - For v0.90 superblocks, print the 'Events' count as a real count,
- not 2 numbers separated by a dot.
- - Updates some URLs in the man page.
- - Allow creation of a RAID6 with exactly one missing device.
- - Use LOG_PID for syslog, so you get the pid of mdadm in the log
- files.
- - --export now works with --examine too (not just --detail)
- - Improve auto-creation of device special file when using
- --incremental
- - Simple locking for --incremental so mdadm doesn't get confused
- when run concurrently with itself.
- - Make --incremental cope better with arrays that are being reshaped.
-
-Changes Prior to 2.6.4 release
- - Make "--create --auto=mdp" work for non-standard device names.
- - Fix restarting of a 'reshape' if it was stopped in the middle.
- - Fix a segfault when using v1 superblock.
- - Make --write-mostly effective when re-adding a device to an array.
- - Various minor fixes
-
-Changes Prior to 2.6.3 release
- - allow --write-behind to be set for --grow.
- - When adding new disk to an array, don't reserve so much bitmap
- space that the disk cannot store the required data. (Needed when
- 1.x array was created with older mdadm).
- - When adding a drive that was a little too small, we did not get
- the correct error message.
- - Make sure that if --assemble find an array in the critical region
- of a reshape, and cannot find the critical data to restart the
- reshape, it gives an error message.
- - Fix segfault with '--detail --export' and non-persistent
- superblocks.
- - Various manpage updates.
- - Improved 'raid4' support (--assemble, --monitor)
- - Option parsing fixes w.r.t -a
- - Interpret "--assemble --metadata=1" to allow any version 1.x
- metadata, and be more specific in the "metadata=" message printed
- with --examine --brief
- - Fix spare migration in --monitor.
-
-Changes Prior to 2.6.2 release
- - --fail detached and --remove faulty can be used to fail and
- remove devices that are no longer physically present.
- - --export option for --detail or present information in a format
- that can be processed by udev.
- - fix internal bitmap allocation problems with v1.1, v1.2 metadata.
- - --help now goes to stdout so you can direct it to a pager.
- - Various manpage updates.
- - Make "--grow --add" for linear arrays really work.
- - --auto-detect to trigger in-kernel autodetect.
- - Make return code for "--detail --test" more reliable. Missing
- devices as well as failed devices cause an error.
-
-Changes Prior to 2.6.1 release
- - --monitor was producing some meaningless warnings due to a bug.
- - Fix some compiler warnings.
- - Fully support --grow for raid6. If a reshape crashed during the
- critical period, mdadm wouldn't restore the Q information
- properly.
- - Update documentation for --grow.
-
-Changes Prior to 2.6 release
- - Fixed UUID printing in "--detail --brief" for version1 metadata.
- - --update=resync did exactly the wrong thing for version1 metadata.
- It caused a resync to not happen, rather than to happen.
- - Allow --assemble --force to mark a raid6 clean when it has two
- missing devices (which is needed else if won't assemble.
- Without this fix it would only assemble if one or zero
- missing devices.
- - Support --update=devicesize for cases where the underlying device
- can change size.
- - Default to --auto=yes so the array devices with 'standard' names
- get created automatically, as this is almost always what is wanted.
- - Give useful message if raid4/5/6 cannot be started because it is
- not clean and is also degraded.
- - Increase raid456 stripe cache size if needed to --grow the array.
- The setting used unfortunately requires intimate knowledge of the
- kernel, and it not reset when the reshape finishes.
- - Change 'Device Size' to 'Used Dev Size' because it only shows how
- much of each device is actually used, not how big they are.
- - --wait or -W will wait for resync activity to finish on the given
- devices.
- - Fix some problems with --update=uuid and add a test.
- - If two drives in a raid5 disappear at the same time, then "-Af"
- will add them both in rather than just one and forcing the array
- to 'clean'. This is slightly safer in some cases.
- - Check device is large enough before hot-add: this improves quality
- of error message.
- - Don't hold md device open for so long in --monitor mode - map_dev
- can be slow and interferes with trying to stop the array.
- - Support --uuid= with --create to choose your own UUID.
- - New major more "--incremental" for incremental assemble of arrays,
- intended for use with udev.
-
-Changes Prior to 2.5.6 release
- - Fix bug which meant "bitmap=xxx" in mdadm.conf was not handled
- properly.
- - Documentation updates.
- - Fix bug that caused infinite loop when doing auto-assembly,
- in certain cases where arrays couldn't be assembled.
-
-Changes Prior to 2.5.5 release
- - Don't #include linux/blkpg.h as that isn't safe. Just
- include the content literally.
- - Reduce maximum bitmap usage when working with bitmap files,
- so that a only single-page allocations are made, even on
- 64bit hosts with 4K pages.
- - Close stray fd in mdassemble so that it can assemble stacked
- devices
- - If mdassemble finds an array already assembled, it marks it
- read-write.
- - Remove error in md_open if array is already active. This isn't
- needed and gets in the ways if an array was created e.g. in
- initramfs, but device doesn't yet exist in /dev.
- - When --assemble --scan is run, if all arrays that could be found
- have already been started, don't report an error.
- - Fix a couple of bugs related to raid10 and the new 'offset' layout.
- - Improve error message when a wrong '--update' option is given.
-
-Changes Prior to 2.5.4 release
- - When creating devices in /dev/md/ create matching symlinks
- from /dev. e.g. /dev/md0 -> /dev/md/0.
- Allow this to be disabled in mdadm.conf or on command line.
- - Fix some endian-ness issues with version-1 superblocks (affects
- bigendian only).
- - Fix endian problem with 'bitmap' metadata
- - Allow a number (of partitions) after the 'yes' option to --auto=
- This is particularly useful in the 'create' line in mdadm.conf.
- - Remove partitions from any whole device that is made part of
- an md array. This is a work-around for annoying messages
- when the first block on some drive accidentally looks like a
- partition table.
-
-Changes Prior to 2.5.3 release
- - Document v0.91 superblocks in md.4
- - Make GPL explicit in man pages.
- - Fix recent breakage of starting degraded arrays.
- - Tidyup automatic name choice for v-1 arrays:
- /dev/md_d0 now becomes '0', not '_d0'.
-
-Changes Prior to 2.5.2 release
- - Fix problem with compiling with gcc-2 compilers
- - Fix compile problem of post-incrmenting a variable in a macro arg.
- - Stop map_dev from returning [0:0], as that breaks things.
- - Add 'Array Slot' line to --examine for version-1 superblocks
- to make it a bit easier to see what is happening.
- - Work around bug in --add handling for version-1 superblocks
- in 2.6.17 (and prior).
- - Make -assemble a bit more resilient to finding strange
- information in superblocks.
- - Don't claim newly added spares are InSync!! (don't know why that
- code was ever in there)
- - Work better when no 'ftw' is available, and check to see
- if current uclibc provides ftw.
- - Never use /etc/mdadm.conf if --config file is given (previously
- some code used one, some used the other).
-
-Changes Prior to 2.5.1 release
- - Various fixes for gcc warnings
- - uclibc warnings
- - Makefile improvements for static linking/intalling
- - Makefile uninstall target
- - Really fix return status of --examine
- - Typos
- - Byteorder stuff (again)
- - Don't try to create devices with --manage or --grow
- - allow default metadata (superblock) type to be specified
- in mdadm.conf
- - Get --stop to list devices stopped but honour --quiet
- - remove libssl dependency
- - Avoid some misdetection of overlapping partitions
- - Fix memory leak in --monitor mode
-
-Changes Prior to 2.5 release
- - 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.
-
-Changes Prior to 2.4.1 release
- - Honour --write-mostly when adding to an array without persistent
- superblocks.
- - Fix alignment problem in version-1 superblocks.
- NOTE: This is an incompatable change affecting raid5 reshape.
- If you want to reshape a raid5 using version-1 superblocks,
- use 2.6.17-rc2 or later, and mdadm-2.4.1 or later.
-
-Changes Prior to 2.4 release
- - Rewrite 'reshape' support including performing a backup
- of the critical region for a raid5 growth, and restoring that
- backup after a crash.
- - Put a 'canary' at each end of the backup so a corruption
- can be more easily detected.
- - Remove useless 'ident' arguement from ->getinfo_super method.
- - Support --backup-file for backing-up critical section during
- growth.
- - Erase old superblocks (of different versions) when creating new
- array.
- - Allow --monitor to work with arrays with >28 devices
- - Report reshape information in --detail
- - Handle symlinks in /dev better
- - Fix mess in --detail output which a device is missing.
- - Manpage tidyup
- - Support 'bitmap=' in mdadm.conf for auto-assembling arrays with
- write-intent bitmaps in separate files.
- - Updates to md.4 man page including section on RESTRIPING and SYSFS
-
-Changes Prior to 2.3.1 release
- - Fixed -O2 compile so I could make and RPM.
- - Type cast number to be printed %llu so it compiles on 64bit
- machines. (Thanks Luca).
- - Stop using asm/byteorder.h - to make Redhat happy :-(
- - Require bitmap files to have a '/' in their name.
- - Error-check a few syscalls - code from SuSE package.
-
-Changes Prior to 2.3 release
- - Try /etc/mdadm/mdadm.conf if /etc/mdadm.conf doesn't exist.
- This provided compatability for Debian.
- - Fixed for version-1 superblock:
- report chunksize for raid6 and raid10
- make sure device size used is a multiple of chunksize
- - Fix "--assemble --scan" crash.
- - Fix completely failure to create array on ppc64
- - Fix memcmp in place of memcpy
- - A few minor improvements to online help
- - Clean up usage of 'long long' for used-size of devices, so
- that it is possible to create a raid1 of 7TB devices!
- - Make internal bitmaps work on 7TB raid1 arrays.
- - Provide error message if --examine doesn't find any superblock.
- - Report 'reshape' status in --examine - this depends on kernel
- patches that are not yet finalised.
- - Report bitmap status in --detail and --examine
- - Default to v1 superblocks instead of v0.90 if the array
- is too big for 0.90 to handle.
- - Sort the output of "mdadm --detail --scan" so that it is
- in a suitable order for assembling arrays. i.e. components come
- before an array that they are part of.
- - Print size of large reiserfs array properly went warning of
- possible confilcts.
-
-Changes Prior to 2.2 release
- - Assorted bug fixes
- - Support write-intent-bitmaps on raid10
- - Support little-endian (Rather than hostendian) bitmaps.
- - Return correct error code from 'mdadm -S'
- - Remove extra blank line from 'mdadm -Eb' output.
- - Improve option parsing so that -a and -b do not have
- optional arguements: the arg is either required or not
- depending on context.
- - Allow scanning of devices listed in /proc/partitions even
- if they don't appear in /dev.
- - Support --assume-clean in --create mode as well as --build
- - Add support for --monitor to report to syslog: -y or --syslog.
- Thanks to Ross Vandegrift
- - --monitor now reports which device failed in a 'Fail' message
- This broke with 2.6
- - Improve chance of array starting properly after a crash.
- mdadm was insisting the event numbers were identical, but this
- isn't needed, and is a problem if the crash was while the metadata
- was being updated.
- - Support --update==uuid
- - Added README.initramfs and mkinitramfs to help people use an
- initram for starting md arrays at boot.
-
-Changes Prior to 2.1 release
- - Fix assembling of raid10 array when devices are missing.
- mdadm now correctly detects if a array is workable or not
- depending on which devices are present, and so will correctly
- handle "--assemble --force" if multiple devices have failed.
- - Report raid10 layout in --examine output.
- - Fix assembling of arrays that use the version-1 superblock and
- have spares. Previously the spares would be ignored.
- - Fix bug so that multiple drives can be re-added at once.
- - Fix problem with hot-adding a bitmap to version-1-superblock
- arrays.
-
-Changes Prior to 2.0
- - Support assembling from byte-swapped superblocks
- metadata type "0.swap" and --update=byteorder
- - write-mostly and write-behind support for raid1.
- - Support --name= and 'name=' config entry for identifying
- arrays be name.
- - RAID10 in man pages.
- - Lot of minor manpage updates
-
-Changes Prior to 2.0-devel-3 release
- - Assorted fixes for multiple bugs...
- - Add test suite
-
-Changes Prior to 1.12.0 release
- Several of these are backported from the Debian package
- - Don't use 'lstat' to check for blockdevices, use stat.
- - Document --size=max option for --grow
- - Document SparesMissing event and DeviceDisappeared/WrongLevel
- - --stop --scan repeatly cycles until no more progress can be made
- so that stack devices are stopped properly
- - Minor type rationalisation for ident->uuid - now always 'int[]'
- - Fix type in online help for --grow (was -F, now -G)
- - Allow --auto command line option to set default auto=
- value when running "--assemble --scan". Previously
- --auto was ignored if --scan was given
- - Fix a few type casts
- - Fix parsing of /dev/md/N in is_standard
- - Fix rounding errors in human_size()
- - Fix silly example in mdadm.conf-examples
- - When finding a /dev name for a device, prefer shorter names
- - Suppress listing of devices= in --brief output of -D or -E,
- unless -v is given (-vv gives the old behaviour with -Dsv).
- This is because the device list can change and so is not a
- stable aspect of the array
- - Allow --force with --grow so '-Gfn1' works (on raid1)
- - Replace sprintf calls with snprintf (to quiet diet-libc)
- - Add man page for mdassemble
- - Fix compilation with tinyc
-
-Changes Prior to 1.11.0 release
- - Fix embarassing bug which causes --add to always fail.
-
-Changes Prior to 1.10.0 release
- - Fix bug with --config=partitions
- - Open sub-devices with O_EXCL to detect if already in use
- - Make sure superblock updates are flushed directly to disk.
-
-Changes Prior to 2.0-devel-1 release
- - Support for version-1 superblock. See --metadata option.
- - Support for bitmap based intent logging.
- - Minor fixes.
-
-Changes Prior to 1.9.0 release
- - Fix rpm build problem (stray %)
- - Minor manpage updates
- - Change "dirty" status to "active" as it was confusing people.
- - --assemble --auto recognises 'standard' name and insists on using
- the appropriate major/minor number for them.
- - Remove underscore from partition names, so partitions of
- "foo" are "foo1", "foo2" etc (unchanged) and partitions of
- "f00" are "f00p1", "f00p2" etc rather than "f00_p1"...
- - Use "major", "minor", "makedev" macros instead of
- "MAJOR", "MINOR", "MKDEV" so that large device numbers work
- on 2.6 (providing you have glibc 2.3.3 or later).
- - Add some missing closes of open file descriptors.
- - Reread /proc/partition for every array assembled when using
- it to find devices, rather than only once.
- - Make "mdadm -Ss" stop stacked devices properly, by reversing the
- order in which arrays are stopped.
- - Improve some error messages.
- - Allow device name to appear before first option, so e.g.
- mdadm /dev/md0 -A /dev/sd[ab]
- works.
- - Assume '-Q' if just a device is given, rather than being silent.
- - Change "dirty" status to "active" as it was confusing people.
-
-Changes Prior to 1.8.0 release
- - Makefile cleanup from Luca Berra <bluca@comedia.it>
- - --pid-file (-i) to set a pid file to use with --monitor --daemonise
- - Fix typo in mdadm man page
- - Fix coredump when "-s" used with no config file present.
- - Support new "faulty" personality which can inject synthetic
- faults. (Not in kernel.org yet at 1Nov2004)
- - Support raid0/linear on devices > 2 Terabytes
- - Make sure raid6 resyncs when created with one missing device
-
-Changes Prior to 1.7.0 release
- - Support "--grow --add" to add a device to a linear array, if the
- kernel supports it. Not documented yet.
- - Restore support for uclibc which was broken recently.
- - Several improvements to the output of --detail, including
- reporting "resyncing" or "recovering" in the state.
- - Close filedescriptor at end of --detail (exit would have closed it
- anyway, so this isn't abig deal).
- - Report "Sync checkpoint" in --examine output if appropriate.
- - Add --update=resync for --assemble mode to for a resync when the
- array is assembled.
- - Add support for "raid10", which is under development in 2.6.
- Not documented yet.
- - --monitor now reads spare-group and spares info from config file
- even when names of arrays to scan are given on the command line
-
-Changes Prior to 1.6.0 release
- - Device name given in -Eb is determined by examining /dev rather
- than assuming /dev/md%d
- - Fix bug in --monitor where an array could be held open an so
- could not be stopped without killing mdadm.
- - Add --grow mode. Currently only --size and --raid-disks can be
- changed. Both require kernel support which, at the time of
- writing, is not in a release kernel yet.
- - Don't print out "errors" or "no-errors" in -D and -E, as the bit
- is never set or used.
- - Use md event notification in 2.6.??? to make --monitor mode
- respond instantly to events.
- - Add --auto= option and auto= configfile entry to tell mdadm to
- create device files as needed. This is particularly useful
- with partitioned arrays where the major device number can change.
- - When generating --brief listing, if the standard name doesn't
- exist, search /dev for one rather than using a temp name.
- - Allow --build to build raid1 and multipath arrays.
- - Add "--assume-clean" for Create and Build, particularly for raid1
- Note: this is dangerous. Only use it if you are certain.
- - Fix bug so that Rebuild status monitoring works again.
- - Add "degraded" and "recovering" options to the "Status:"
- entry for --detail
-
-Changes Prior to 1.5.0 release
- - new commands "mdassemble" which is a stripped-down equivalent of
- "mdadm -As", that can be compiled with dietlibc.
- Thanks to Luca Berra <bluca@comedia.it>.
- It can be using in an initramfs or initrd.
- - Fix compiling error with BLKGETSIZE64 and some signed/unsigned
- comparison warnings.
- - Add Rebuild Status (% complete) to --detail output.
- - Support "--monitor --test" which will generate a test alert
- for each array once, to test notification paths.
- - Generate RebuildFinished event when rebuild finishes.
- - Support for raid6 as found in 2.6.2 - thanks to
- H. Peter Anvin <hpa@zytor.com>
- - Support partitioned md arrays with a different major number and
- naming scheme (md_dX in /proc/mdstat, /dev/md/dXpY in /dev).
-
-Changes Prior to 1.4.0 release
- - Document fact that creating a raid5 array really creates a
- degraded array with a spare.
- - Add "spares=" tag to config file and generate it wit --detail and
- --examine
- - Add "SparesMissing" event when --monitor first sees an array and
- it doesn't have the enough spare devices.
- - Add --update=summaries for --assemble to update summary
- information in superblock, and correct other inconsistancies in
- the superblock.
- - Add --test option to --detail to set a meaningful exit status.
-
-Changes Prior to 1.3.0 release
- - Make 'size' and unsigned long in Create to allow creation of
- larger arrays.
- - Explicitly flag spare devices as 'spare' in --detail and --examine
- output. Previously they simply had no flags lists.
- - Make MailCmd (for monitor) configurable in Makefile, and default
- to "/usr/sbin/sendmail -t". Also split out the warning related
- flags into CWFLAGS for easier build configurability.
- - Minor bugfix in Manage code.
- - --monitor now notices and reports degraded arrays at startup using
- "DegradedArray" event, and also has a --oneshot option to only
- report DegradedArrays, and then exit.
- - Small man-page clarification w.r.t. raid levels and raid4 in
- particular.
- - Disallow creation of arrays with only one device as this is
- probably a mistake. --force will override this check.
- - Correct some misleading documentation in the "mdadm --create --help"
- message.
- - Ignore chunksize if raid1 or multipath.
- - Explicit statement in man page that raid-disks cannot be changed
- after array is created.
- - Improve message when attempting to start an array with
- insufficient devices. Instead of required the array to be full,
- we only require it has as many active devices as last time.
-
-Changes Prior to 1.2.0 release
- - Fix bug where --daemonise required an argument.
- - In --assemble --verbose, print appropriate message if device is
- not in devices= list
- - Updated mdadm.conf.5 to reflect fact that device= takes wildcards
- - Typos: componenet -> component
- - Reduce size of "--help" message put excess into "--help-options"
- - Fix bug introduced when MD_SB_DISKS dependancy removed, and which
- caused spares not be assembled properly.
- - Print appropriate message if --monitor --scan decides not to
- monitor anything.
-Changes Prior to 1.1.0 release
- - add --deamonise flag for --monitor - forks and prints pid to stdout
- - Fix bug so we REALLY clear dirty flag with -Af
- - -Db now prints a 'devices=' word for each array.
- - "mdadm -A /dev/md0" will get info from configfile, even without scan
- - When assembling multipath arrays, ignore devices which are flagged
- as having errors.
- - take --super-minor=dev to mean "use the minor number of the mddev
- being assembled.
- - take --config=none to mean "completely ignore config file"
- - Make --monitor require --scan or a device list.
-Changes Prior to 1.0.9 release
- - Documentation updates including kernel parameters documented
- in md.4
- - --assemble --force for raid4/5 will mark clean, needed for 2.5
- - --detail prints out the events counter as well
- - flush device before reading superblock to be sure to get
- current data
- - added mdadm.static target to makefile for static linking
- - --monitor was ignoring /dev/md0 due to off-by-one error
- - Fix assorted typos
- - Fix printing of Gibibytes - calc was wrong.
- - Fix printing of Array Size in --detail when very big.
- - --monitor no longer tries to work for raid0 or linear as these
- have nothing to be monitored.
- - The word 'partitions' on a DEVICE line will cause all partitions
- listed in /proc/partitions to be considered
- - If the config file is called 'partitions' then it will be treated
- as though it contained exactly 'device partitions' so e.g.
- mdadm -Ebsc partitions
- will find all raid partitions easily.
- - successfully assemble multipath devices by ignoring raid_disk
- value from superblock (it is always the same).
- - --assemble not tied to MD_SB_DISKS limit quite so much
- - Support compiling with tcc
- - Support compiling with uclibc - just skip scan of /dev
- - Add --update= option for Assemble mode. Either sparc2.2
- or super-minor updates are possible. See mdadm.8
-
-Changes Prior to 1.0.1 release
- - Round off MB/GiB etc values instead of round down.
- - Add --sparc2.2 option to examine to shift superblock around
- and --sparc2.2update to rewrite the superblock
- - Fix assorted typos in online help
-
-Changes Prior to 1.0.0 release
- - Allow --config with Misc mode (for --examine --scan)
- - Add $(CXFLAGS) to end of CFLAGS in makefile
- - When making an N disk raid5 array, the Nth drive
- is moved to the end of the array as a spare rather than
- being shifted up one place. This means that when the
- kernel builds onto the last spare and inserts it,
- the devices will be in the expected order.
- - Man page improvements
-Changes Prior to 0.8.2 release
- - Correct spelling of persist[ae]nce/persist[ae]nt.
- - Change "disk" to "device" in options and config file
- - convert array size to "long long" *before* shift-left in -D and -Q
-
-Changes Prior to 0.8.1 release
- - Add "INSTALL" file.
- - Fix some "i" variables that were not being set properly
- - Initialise minsize and maxsize so that compilers don't complain.
- - Tidy up Makefile and mdadm.spec installations
- - Add "multipath" to documentation of valid levels
-
-Changes Prior to 0.8 release
- - Fix another bug in Assemble.c due to confusing 'i' with 'j'
- - Minimal, untested, support for multipath
- - re-write of argument parsing to have more coherent modes,
- - add --query,-Q option
- - Update mdadm.8 to reflect arg processing change and --query
- - Change "long" to "unsigned long" for device sizes
- - Handle "mailaddr" and "program" lines in config file for follow/scan mode.
- - --follow --scan will exit if no program or mail found
- - Add MAILADDR and PROGRAM to mdadm.conf-example
- - Spell check man pages
- - consistently use "component devices" instead of "subdevices"
- - Make -Wall -Werror really work and fix lots of errors.
- - --detail and --stop can have --scan which chooses devices from /proc/mdstat
- - --monitor detects 20% changes in resync, failed spares,
- disappearing arrays,
- - --monitor --scan will automatically add any devices found in /proc/mdstat
- - --monitor will move spares between arrays with same spare-group if necessary
- - Documentation for Monitor Mode
- - --query notes if the array containing the given device is active or not
- - Finished md.4 man page.
-
-Changes Prior to 0.7.2 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
- - 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
-
- - Fix makefile to install binary at /sbin and not /sbin/sbin
- Also install man page.
- - Add --zero-superblock based on --destroywithextremeprejudice
- from Dale Stephenson <steph@snapserver.com>
- - change name to mdadm. It is palandromic, and much nicer to pronouce.
-
-Changes Prior to 0.6 release
-
- - Remove the limit on the number of device names that can be
- given on the command line.
- - Fix bug in --assemble --force where it would only update a
- single superblock.
- - Fix bogus printing of big numbers not being block devices
- when given names of devices that don't exist.
- - When --assemble --force, consider superblocks with an event
- count that is 1 behind as out-of-date. Normally they are
- considered up-to-date (as the kernel assumes this too).
- - When marking drives as not-failed in the superblock,
- we also mark them as ACTIVE and SYNC.
- - Don't start arrays for which not all drives are available unless:
- --scan which implies that all drives were found automatically
- --run which means the user knows what they want
- --force which means that we are fixing something broken
- - Make sure all device numbers passed as 3rd arg of ioctl
- are passed as unsigned lock, so that it works on SPARC
- - If HOT_ADD_DISK failes for -a, then only try ADD_NEW_DISK
- if we cannot read from the array, i.e. if the array is
- not started yet.
- - man page update
- - Taught Examine to handle --scan. It examines all devices listed
- on DEVICE lines in the config file.
- - Added --brief (-b) flag for Examine and Detail to print out
- and mdctl.conf compatible description with uuid=, level=,
- disks= and - for Examine - devices=
- --examine --brief collects all devices the make the one array and
- list them as one entry.
- - Added level= and disks= options to ARRAY lines in config files
- so --brief output could be used as-is.
- - Make parity style ({left,right}-{,a}symmetric) consistantly use -,
- never _.
- - Add "Array Size" to --detail output
- - Change "Size" to "Device Size" and exclude from Detail of arrays
- that do not have a consistent device size.
- - Add Human readable MiB or GiB value on size lines of Detail and Examine
- - --assemble --scan doesn't complain about active drives
- - require number of spares given in -x to be listed.
- - Made --build actually work.
-Changes Prior to 0.5 release
-
- --assemble:
- spare drives are handled properly.
-
- --force can be used to recover from 2-drive failures on RAID5
- If you belive that /dev/hda1 /dev/hdb1 /dev/hdc1 /dev/hdd1 should
- make a raid5 array, but it has experienced multiple failures and
- wont start, then
-
- mdctl --assemble --force /dev/md0 /dev/hd[abcd]1
-
- Should update the superblock on the newest failed drive and
- restart the array in degraded mode. You should then remove the
- remaining failed drive and re-add it (if you are happy that it
- might work).
-
- Ofcourse whenever you have a 2-drive failure, you have a risk
- of corruption in data that hasn't be changed for a long time. So
- this doesn't give you your array back all nice and happy, but it
- does allow you to recover data that might not be corrupt.
-
- More flexibility in identifying a RAID array in the mdctl.conf
- e.g.
- array /dev/md4 super-minor=4
-
- assembles /dev/md4 from all devices found that have a raid
- superblock that says the minor number of the array is 4.
- If the blocks with the right minor number do not all have the
- same UUID, an error is flags and no assembly happens.
-
- array /dev/md3 devices=/dev/hd[abc]2
-
- Assembles /dev/md3 drom /dev/hda2 /dev/hdb2 and/dev/hdc2. All
- devices must exist and have raid superblock with the same uuid.
-
- If two identity specifiers are used, only devices that match all
- of them are considered, so
-
- array /dev/md2 devices=/dev/hd?2 super-minor=2
-
- will assemble /dev/md2 using all /dev/hd?2 devices which have a
- raid superblock with minor number 2.
-
- --create:
- When listing devices for --create, the word "missing" can be
- used to indicate that the respective slot does not have a
- working drive currently. This is similar to the "failed-disk"
- directive in mkraid/raidtab.
- e.g.
- mdctl --create --level=5 -raid-disks=4 --spare-disks=2
- /dev/md0 /dev/sda /dev/sdb missing /dev/sdc /dev/sdd /dev/sde
-
- will create a raid5 array with the third slot empty, and two
- spares.
-
- By default, raid5 arrays are created with the last slot empty
- and drive listed for the last slot added as a spare. If a
- "missing" slot is given, or if --force is given, then --create
- does exactly what you ask and doesn't try to be clever.
-
-
- --follow / --monitor:
-
- This is a new mode. I couldn't stop my self from picking a name
- starting with F (as current modes start A,B,C,D,E) but I
- relented and provided an alternate name that is somewhat more
- meaningful.
-
- In this mode, mdctl does not exit, but runs continuously and
- periodically polls all the md devices to see if they have had
- any interested state change.
- The changes that it currently notices are:
- Fail - an active disc fails
- FailSpare - a spare, that was presumably being build, fails
- ActiveSpare - a spare becomes active, presumably after a rebuild.
-
- Options:
- --mail mailaddress - send Email on any Fail* event
- --program program - run the program on any event.
- Args are: eventname mddevice subdevice(if-known)
- --delay seconds - change from the default 60second pause
- between polls.
-
- I plan to add functionality to this mode to allow sharing of
- spare drives. If an array is marks "spare-group=fred", and it
- has a failed drive and no spares, and if some other array is
- also "spare-group=fred" and it has no failed drives, but does
- have a spare drive that is big enough, the spare will be moved
- to the first array.
-
- I also have the idea of adding a --grow mode which will re-organise
- the data on an N disk raid0/4/5 array to be on an N+M disk array.
- I have no concrete plans for this though.
-
- I got rid of the "v" in the archive file name, and include the
- version number in the directory created by the archive.
-
- There is now a man page and mdctl.spec (for rpm) thanks to
- Danilo Godec <danci@agenda.si>.
-
- Ofcourse, the man page is now out of date and despite being based on
- the --help output, is not wholy correct. After I get --follow
- working properly, I plan to revise the various documentation and/or
- the code to make sure the two match.
+Please see git logs for detailed change log.
+This file just contains highlight.
+
+Changes Prior to release 3.0.2
+ - Fix crash when hosthost is not set, as often happens in
+ early boot.
+
+Changes Prior to release 3.0.1
+ - Fix various segfaults
+ - Fixed for --examine with containers
+ - Lots of other little fixes.
+
+Changes Prior to release 3.0
+ - Support for externally managed metadata, specifically DDF and IMSM.
+ - Depend on udev to create entries in /dev, rather than creating them
+ ourselves.
+ - remove --auto-update-home-hosts
+ - new config file line "auto"
+ - new "<ignore>" and "any" options for "homehost"
+ - numerous bug fixes and minor enhancements.
diff --git a/Create.c b/Create.c
index 36df10d..c96b319 100644
--- a/Create.c
+++ b/Create.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -797,7 +792,39 @@ int Create(struct supertype *st, char *mddev,
dv == moved_disk && dnum != insert_point) break;
}
if (pass == 1) {
+ struct mdinfo info_new;
+ struct map_ent *me = NULL;
+
+ /* check to see if the uuid has changed due to these
+ * metadata changes, and if so update the member array
+ * and container uuid. Note ->write_init_super clears
+ * the subarray cursor such that ->getinfo_super once
+ * again returns container info.
+ */
+ map_lock(&map);
+ st->ss->getinfo_super(st, &info_new);
+ if (st->ss->external && level != LEVEL_CONTAINER &&
+ !same_uuid(info_new.uuid, info.uuid, 0)) {
+ map_update(&map, fd2devnum(mdfd),
+ info_new.text_version,
+ info_new.uuid, chosen_name);
+ me = map_by_devnum(&map, st->container_dev);
+ }
+
st->ss->write_init_super(st);
+
+ /* update parent container uuid */
+ if (me) {
+ char *path = strdup(me->path);
+
+ st->ss->getinfo_super(st, &info_new);
+ map_update(&map, st->container_dev,
+ info_new.text_version,
+ info_new.uuid, path);
+ free(path);
+ }
+ map_unlock(&map);
+
flush_metadata_updates(st);
}
}
diff --git a/Detail.c b/Detail.c
index e3bcfc4..55d5481 100644
--- a/Detail.c
+++ b/Detail.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -127,12 +122,25 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
disk.minor == 0)
continue;
if ((dv=map_dev(disk.major, disk.minor, 1))) {
- if ((!st || !st->sb) &&
+ /* some formats (imsm) have free-floating-spares
+ * with a uuid of uuid_match_any, they don't
+ * have very good info about the rest of the
+ * container, so keep searching when
+ * encountering such a device. Otherwise, stop
+ * after the first successful call to
+ * ->load_super.
+ */
+ int free_spare = memcmp(uuid_match_any,
+ info.uuid,
+ sizeof(uuid_match_any)) == 0;
+ if ((!st || !st->sb || free_spare) &&
(array.raid_disks == 0 ||
(disk.state & (1<<MD_DISK_ACTIVE)))) {
/* try to read the superblock from this device
* to get more info
*/
+ if (free_spare)
+ st->ss->free_super(st);
int fd2 = dev_open(dv, O_RDONLY);
if (fd2 >=0 && st &&
st->ss->load_super(st, fd2, NULL) == 0) {
@@ -199,11 +207,11 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
printf("ARRAY %s", dev);
if (brief > 1) {
if (array.raid_disks)
- printf("level=%s num-devices=%d",
+ printf(" level=%s num-devices=%d",
c?c:"-unknown-",
array.raid_disks );
else
- printf("level=container num-devices=%d",
+ printf(" level=container num-devices=%d",
array.nr_disks);
}
if (container) {
diff --git a/Examine.c b/Examine.c
index bc06b40..7fbd4ae 100644
--- a/Examine.c
+++ b/Examine.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -68,7 +63,7 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
} *arrays = NULL;
for (; devlist ; devlist=devlist->next) {
- struct supertype *st = forcest;
+ struct supertype *st;
fd = dev_open(devlist->devname, O_RDONLY);
if (fd < 0) {
@@ -80,7 +75,9 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
err = 1;
}
else {
- if (!st)
+ if (forcest)
+ st = dup_super(forcest);
+ else
st = guess_super(fd);
if (st)
err = st->ss->load_super(st, fd,
@@ -119,11 +116,10 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
ap->st = st;
arrays = ap;
st->ss->getinfo_super(st, &ap->info);
- } else {
+ } else
st->ss->getinfo_super(st, &ap->info);
- st->ss->free_super(st);
- }
- if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
+ if (!st->loaded_container &&
+ !(ap->info.disk.state & (1<<MD_DISK_SYNC)))
ap->spares++;
d = dl_strdup(devlist->devname);
dl_add(ap->devs, d);
@@ -141,15 +137,23 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
for (ap=arrays; ap; ap=ap->next) {
char sep='=';
char *d;
+ int newline = 0;
+
ap->st->ss->brief_examine_super(ap->st, brief > 1);
- if (ap->spares) printf(" spares=%d", ap->spares);
+ if (ap->spares)
+ newline += printf(" spares=%d", ap->spares);
if (brief > 1) {
- printf(" devices");
+ newline += printf(" devices");
for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
printf("%c%s", sep, d);
sep=',';
}
}
+ if (ap->st->ss->brief_examine_subarrays) {
+ if (newline)
+ printf("\n");
+ ap->st->ss->brief_examine_subarrays(ap->st, brief > 1);
+ }
ap->st->ss->free_super(ap->st);
/* FIXME free ap */
if (ap->spares || brief > 1)
diff --git a/Grow.c b/Grow.c
index 803f5eb..5ebb482 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
#include "dlink.h"
diff --git a/Incremental.c b/Incremental.c
index b6f527a..8c686f7 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -2,7 +2,7 @@
* Incremental.c - support --incremental. Part of:
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2006-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
diff --git a/Kill.c b/Kill.c
index 96b270f..f5c5821 100644
--- a/Kill.c
+++ b/Kill.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*
* Added by Dale Stephenson
* steph@snapserver.com
diff --git a/Makefile b/Makefile
index a0d50b5..5636392 100644
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,7 @@ SRCS = mdadm.c config.c mdstat.c ReadMe.c util.c Manage.c Assemble.c Build.c \
MON_OBJS = mdmon.o monitor.o managemon.o util.o mdstat.o sysfs.o config.o \
Kill.o sg_io.o dlink.o ReadMe.o super0.o super1.o super-intel.o \
- super-ddf.o sha1.o crc32.o msg.o Monitor.o bitmap.o \
+ super-ddf.o sha1.o crc32.o msg.o bitmap.o \
platform-intel.o probe_roms.o
@@ -105,7 +105,7 @@ ASSEMBLE_SRCS += $(ASSEMBLE_AUTO_SRCS)
ASSEMBLE_FLAGS += -DMDASSEMBLE_AUTO
endif
-all : mdadm mdmon mdadm.man md.man mdadm.conf.man
+all : mdadm mdmon mdadm.man md.man mdadm.conf.man mdmon.man
everything: all mdadm.static swap_super test_stripe \
mdassemble mdassemble.auto mdassemble.static mdassemble.man \
@@ -167,6 +167,9 @@ mdassemble.klibc : $(ASSEMBLE_SRCS) mdadm.h
mdadm.man : mdadm.8
nroff -man mdadm.8 > mdadm.man
+mdmon.man : mdmon.8
+ nroff -man mdmon.8 > mdmon.man
+
md.man : md.4
nroff -man md.4 > md.man
@@ -198,8 +201,9 @@ install-uclibc : mdadm.uclibc install-man
install-klibc : mdadm.klibc install-man
$(INSTALL) -D $(STRIP) -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm
-install-man: mdadm.8 md.4 mdadm.conf.5
+install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
$(INSTALL) -D -m 644 mdadm.8 $(DESTDIR)$(MAN8DIR)/mdadm.8
+ $(INSTALL) -D -m 644 mdmon.8 $(DESTDIR)$(MAN8DIR)/mdmon.8
$(INSTALL) -D -m 644 md.4 $(DESTDIR)$(MAN4DIR)/md.4
$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
@@ -207,7 +211,7 @@ install-udev: udev-md-raid.rules
$(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules
uninstall:
- rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 md.4 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
+ rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
test: mdadm mdmon test_stripe swap_super
@echo "Please run 'sh ./test' as root"
diff --git a/Manage.c b/Manage.c
index 6bd33b9..9217139 100644
--- a/Manage.c
+++ b/Manage.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -428,11 +423,15 @@ int Manage_subdevs(char *devname, int fd,
} else {
j = 0;
- if (stat(dv->devname, &stb)) {
+ tfd = dev_open(dv->devname, O_RDONLY);
+ if (tfd < 0 || fstat(tfd, &stb) != 0) {
fprintf(stderr, Name ": cannot find %s: %s\n",
dv->devname, strerror(errno));
+ if (tfd >= 0)
+ close(tfd);
return 1;
}
+ close(tfd);
if ((stb.st_mode & S_IFMT) != S_IFBLK) {
fprintf(stderr, Name ": %s is not a "
"block device.\n",
@@ -454,7 +453,7 @@ int Manage_subdevs(char *devname, int fd,
return 1;
}
/* Make sure it isn't in use (in 2.6 or later) */
- tfd = open(dv->devname, O_RDONLY|O_EXCL|O_DIRECT);
+ tfd = dev_open(dv->devname, O_RDONLY|O_EXCL|O_DIRECT);
if (tfd < 0) {
fprintf(stderr, Name ": Cannot open %s: %s\n",
dv->devname, strerror(errno));
@@ -610,7 +609,7 @@ int Manage_subdevs(char *devname, int fd,
int dfd;
if (dv->writemostly == 1)
disc.state |= 1 << MD_DISK_WRITEMOSTLY;
- dfd = open(dv->devname, O_RDWR | O_EXCL|O_DIRECT);
+ dfd = dev_open(dv->devname, O_RDWR | O_EXCL|O_DIRECT);
if (tst->ss->add_to_super(tst, &disc, dfd,
dv->devname)) {
close(dfd);
diff --git a/Monitor.c b/Monitor.c
index e43175f..af486d7 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -284,6 +279,10 @@ int Monitor(mddev_dev_t devlist,
mse = mse2;
}
+ if (array.utime == 0)
+ /* external arrays don't update utime */
+ array.utime = time(0);
+
if (st->utime == array.utime &&
st->failed == array.failed_disks &&
st->working == array.working_disks &&
@@ -481,16 +480,25 @@ int Monitor(mddev_dev_t devlist,
}
}
if (dev > 0) {
- if (ioctl(fd2, HOT_REMOVE_DISK,
- (unsigned long)dev) == 0) {
- if (ioctl(fd1, HOT_ADD_DISK,
- (unsigned long)dev) == 0) {
+ struct mddev_dev_s devlist;
+ char devname[20];
+ devlist.next = NULL;
+ devlist.used = 0;
+ devlist.re_add = 0;
+ devlist.writemostly = 0;
+ devlist.devname = devname;
+ sprintf(devname, "%d:%d", major(dev), minor(dev));
+
+ devlist.disposition = 'r';
+ if (Manage_subdevs(st2->devname, fd2, &devlist, -1) == 0) {
+ devlist.disposition = 'a';
+ if (Manage_subdevs(st->devname, fd1, &devlist, -1) == 0) {
alert("MoveSpare", st->devname, st2->devname, mailaddr, mailfrom, alert_cmd, dosyslog);
close(fd1);
close(fd2);
break;
}
- else ioctl(fd2, HOT_ADD_DISK, (unsigned long) dev);
+ else Manage_subdevs(st2->devname, fd2, &devlist, -1);
}
}
close(fd1);
@@ -573,7 +581,7 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail
n=fwrite(buf, 1, n, mp); /* yes, i don't care about the result */
fclose(mdstat);
}
- fclose(mp);
+ pclose(mp);
}
}
@@ -641,107 +649,3 @@ int Wait(char *dev)
mdstat_wait(5);
}
}
-
-static char *clean_states[] = {
- "clear", "inactive", "readonly", "read-auto", "clean", NULL };
-
-int WaitClean(char *dev, int verbose)
-{
- int fd;
- struct mdinfo *mdi;
- int rv = 1;
- int devnum;
-
- fd = open(dev, O_RDONLY);
- if (fd < 0) {
- if (verbose)
- fprintf(stderr, Name ": Couldn't open %s: %s\n", dev, strerror(errno));
- return 1;
- }
-
- devnum = fd2devnum(fd);
- mdi = sysfs_read(fd, devnum, GET_VERSION|GET_LEVEL|GET_SAFEMODE);
- if (!mdi) {
- if (verbose)
- fprintf(stderr, Name ": Failed to read sysfs attributes for "
- "%s\n", dev);
- close(fd);
- return 0;
- }
-
- switch(mdi->array.level) {
- case LEVEL_LINEAR:
- case LEVEL_MULTIPATH:
- case 0:
- /* safemode delay is irrelevant for these levels */
- rv = 0;
-
- }
-
- /* for internal metadata the kernel handles the final clean
- * transition, containers can never be dirty
- */
- if (!is_subarray(mdi->text_version))
- rv = 0;
-
- /* safemode disabled ? */
- if (mdi->safe_mode_delay == 0)
- rv = 0;
-
- if (rv) {
- int state_fd = sysfs_open(fd2devnum(fd), NULL, "array_state");
- char buf[20];
- fd_set fds;
- struct timeval tm;
-
- /* minimize the safe_mode_delay and prepare to wait up to 5s
- * for writes to quiesce
- */
- sysfs_set_safemode(mdi, 1);
- tm.tv_sec = 5;
- tm.tv_usec = 0;
-
- /* give mdmon a chance to checkpoint resync */
- sysfs_set_str(mdi, NULL, "sync_action", "idle");
-
- FD_ZERO(&fds);
-
- /* wait for array_state to be clean */
- while (1) {
- rv = read(state_fd, buf, sizeof(buf));
- if (rv < 0)
- break;
- if (sysfs_match_word(buf, clean_states) <= 4)
- break;
- FD_SET(state_fd, &fds);
- rv = select(state_fd + 1, NULL, NULL, &fds, &tm);
- if (rv < 0 && errno != EINTR)
- break;
- lseek(state_fd, 0, SEEK_SET);
- }
- if (rv < 0)
- rv = 1;
- else if (ping_monitor(mdi->text_version) == 0) {
- /* we need to ping to close the window between array
- * state transitioning to clean and the metadata being
- * marked clean
- */
- rv = 0;
- } else
- rv = 1;
- if (rv && verbose)
- fprintf(stderr, Name ": Error waiting for %s to be clean\n",
- dev);
-
- /* restore the original safe_mode_delay */
- sysfs_set_safemode(mdi, mdi->safe_mode_delay);
- close(state_fd);
- }
-
- sysfs_free(mdi);
- close(fd);
-
- return rv;
-}
-
-
diff --git a/Query.c b/Query.c
index dc69eb8..8847be7 100644
--- a/Query.c
+++ b/Query.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2002-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2002-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
diff --git a/ReadMe.c b/ReadMe.c
index 170e395..0a50acb 100644
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2007 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
#include "mdadm.h"
-char Version[] = Name " - v3.0-rc1 - 11th May 2009\n";
+char Version[] = Name " - v3.0.2 - 25th September 2009\n";
/*
* File: ReadMe.c
@@ -139,7 +139,9 @@ struct option long_options[] = {
{"write-mostly",0, 0, 'W'},
{"re-add", 0, 0, ReAdd},
{"homehost", 1, 0, HomeHost},
+#if 0
{"auto-update-homehost", 0, 0, AutoHomeHost},
+#endif
{"symlinks", 1, 0, Symlinks},
/* For assemble */
diff --git a/config.c b/config.c
index 275ca21..c962afd 100644
--- a/config.c
+++ b/config.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
diff --git a/inventory b/inventory
index 5e1aa75..63e3a0a 100755
--- a/inventory
+++ b/inventory
@@ -1,33 +1,7 @@
-ANNOUNCE-2.0
-ANNOUNCE-2.1
-ANNOUNCE-2.2
-ANNOUNCE-2.3
-ANNOUNCE-2.3.1
-ANNOUNCE-2.4
-ANNOUNCE-2.4.1
-ANNOUNCE-2.4-pre1
-ANNOUNCE-2.5
-ANNOUNCE-2.5.1
-ANNOUNCE-2.5.2
-ANNOUNCE-2.5.3
-ANNOUNCE-2.5.4
-ANNOUNCE-2.5.5
-ANNOUNCE-2.5.6
-ANNOUNCE-2.6
-ANNOUNCE-2.6.1
-ANNOUNCE-2.6.2
-ANNOUNCE-2.6.3
-ANNOUNCE-2.6.4
-ANNOUNCE-2.6.5
-ANNOUNCE-2.6.6
-ANNOUNCE-2.6.7
-ANNOUNCE-2.6.8
-ANNOUNCE-2.6.9
-ANNOUNCE-3.0-devel1
-ANNOUNCE-3.0-devel2
-ANNOUNCE-3.0-devel3
-ANNOUNCE-3.0-rc1
+ANNOUNCE-3.0
+ANNOUNCE-3.0.1
+ANNOUNCE-3.0.2
Assemble.c
bitmap.c
bitmap.h
diff --git a/managemon.c b/managemon.c
index 3835c99..f9d545d 100644
--- a/managemon.c
+++ b/managemon.c
@@ -1,8 +1,8 @@
/*
* mdmon - monitor external metadata arrays
*
- * Copyright (C) 2007-2008 Neil Brown <neilb@suse.de>
- * Copyright (C) 2007-2008 Intel Corporation
+ * Copyright (C) 2007-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2007-2009 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
diff --git a/mapfile.c b/mapfile.c
index 601c4cc..ed59db5 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -297,6 +297,37 @@ struct map_ent *map_by_name(struct map_ent **map, char *name)
return NULL;
}
+/* sets the proper subarray and container_dev according to the metadata
+ * version super_by_fd does this automatically, this routine is meant as
+ * a supplement for guess_super()
+ */
+static void set_member_info(struct supertype *st, struct mdstat_ent *ent)
+{
+
+ st->subarray[0] = '\0';
+
+ if (ent->metadata_version == NULL ||
+ strncmp(ent->metadata_version, "external:", 9) != 0)
+ return;
+
+ if (is_subarray(&ent->metadata_version[9])) {
+ char version[strlen(ent->metadata_version)+1];
+ char *subarray;
+ char *name = &version[10];
+
+ strcpy(version, ent->metadata_version);
+ subarray = strrchr(version, '/');
+ name = &version[10];
+
+ if (!subarray)
+ return;
+ *subarray++ = '\0';
+
+ st->container_dev = devname2devnum(name);
+ strncpy(st->subarray, subarray, sizeof(st->subarray));
+ }
+}
+
void RebuildMap(void)
{
struct mdstat_ent *mdstat = mdstat_read(0, 0);
@@ -337,8 +368,10 @@ void RebuildMap(void)
st = guess_super(dfd);
if ( st == NULL)
ok = -1;
- else
+ else {
+ set_member_info(st, md);
ok = st->ss->load_super(st, dfd, NULL);
+ }
close(dfd);
if (ok != 0)
continue;
diff --git a/md.4 b/md.4
index ea12eaf..04b5308 100644
--- a/md.4
+++ b/md.4
@@ -11,6 +11,8 @@ md \- Multiple Device driver aka Linux Software RAID
.BI /dev/md n
.br
.BI /dev/md/ n
+.br
+.BR /dev/md/ name
.SH DESCRIPTION
The
.B md
@@ -37,15 +39,17 @@ including RAID0 (striped array), LINEAR (catenated array),
MULTIPATH (a set of different interfaces to the same device),
and FAULTY (a layer over a single device into which errors can be injected).
-.SS MD SUPER BLOCK
-Each device in an array may have a
-.I superblock
-which records information about the structure and state of the array.
+.SS MD METADATA
+Each device in an array may have some
+.I metadata
+stored in the device. This metadata is sometimes called a
+.BR superblock .
+The metadata records information about the structure and state of the array.
This allows the array to be reliably re-assembled after a shutdown.
From Linux kernel version 2.6.10,
.B md
-provides support for two different formats of this superblock, and
+provides support for two different formats of metadata, and
other formats can be added. Prior to this release, only one format is
supported.
@@ -66,11 +70,11 @@ normally 1K long, but can be longer. It is normally stored between 8K
and 12K from the end of the device, on a 4K boundary, though
variations can be stored at the start of the device (version 1.1) or 4K from
the start of the device (version 1.2).
-This superblock format stores multibyte data in a
+This metadata format stores multibyte data in a
processor-independent format and supports up to hundreds of
component devices (version 0.90 only supports 28).
-The superblock contains, among other things:
+The metadata contains, among other things:
.TP
LEVEL
The manner in which the devices are arranged into the array
@@ -80,6 +84,7 @@ UUID
a 128 bit Universally Unique Identifier that identifies the array that
contains this device.
+.PP
When a version 0.90 array is being reshaped (e.g. adding extra devices
to a RAID5), the version number is temporarily set to 0.91. This
ensures that if the reshape process is stopped in the middle (e.g. by
@@ -88,7 +93,7 @@ not support reshaping, then the array will not be assembled (which
would cause data corruption) but will be left untouched until a kernel
that can complete the reshape processes is used.
-.SS ARRAYS WITHOUT SUPERBLOCKS
+.SS ARRAYS WITHOUT METADATA
While it is usually best to create arrays with superblocks so that
they can be assembled reliably, there are some circumstances when an
array without superblocks is preferred. These include:
@@ -118,6 +123,40 @@ configuration that does not use a superblock, and to maintain the state of
the array elsewhere. While not encouraged for general us, it does
have special-purpose uses and is supported.
+.SS ARRAYS WITH EXTERNAL METADATA
+
+From release 2.6.28, the
+.I md
+driver supports arrays with externally managed metadata. That is,
+the metadata is not managed by the kernel by rather by a user-space
+program which is external to the kernel. This allows support for a
+variety of metadata formats without cluttering the kernel with lots of
+details.
+.PP
+.I md
+is able to communicate with the user-space program through various
+sysfs attributes so that it can make appropriate changes to the
+metadata \- for example to make a device as faulty. When necessary,
+.I md
+will wait for the program to acknowledge the event by writing to a
+sysfs attribute.
+The manual page for
+.IR mdmon (8)
+contains more detail about this interaction.
+
+.SS CONTAINERS
+Many metadata formats use a single block of metadata to describe a
+number of different arrays which all use the same set of devices.
+In this case it is helpful for the kernel to know about the full set
+of devices as a whole. This set is known to md as a
+.IR container .
+A container is an
+.I md
+array with externally managed metadata and with device offset and size
+so that it just covers the metadata part of the devices. The
+remainder of each device is available to be incorporated into various
+arrays.
+
.SS LINEAR
A linear array simply catenates the available space on each
@@ -138,12 +177,12 @@ A RAID0 array (which has zero redundancy) is also known as a
striped array.
A RAID0 array is configured at creation with a
.B "Chunk Size"
-which must be a power of two, and at least 4 kibibytes.
+which must be a power of two (prior to Linux 2.6.31), and at least 4
+kibibytes.
The RAID0 driver assigns the first chunk of the array to the first
device, the second chunk to the second device, and so on until all
-drives have been assigned one chunk. This collection of chunks forms
-a
+drives have been assigned one chunk. This collection of chunks forms a
.BR stripe .
Further chunks are gathered into stripes in the same way, and are
assigned to the remaining space in the drives.
@@ -175,6 +214,11 @@ multiple sequential streams or a random workload will use more than one
spindle. In theory, having an N-disk RAID1 will allow N sequential
threads to read from all disks.
+Individual devices in a RAID1 can be marked as "write-mostly".
+This drives are excluded from the normal read balancing and will only
+be read from when there is no other option. This can be useful for
+devices connected over a slow link.
+
.SS RAID4
A RAID4 array is like a RAID0 array with an extra device for storing
@@ -274,7 +318,11 @@ A MULTIPATH array is composed of a number of logically different
devices, often fibre channel interfaces, that all refer the the same
real device. If one of these interfaces fails (e.g. due to cable
problems), the multipath driver will attempt to redirect requests to
-another interface.
+another interface.
+
+The MULTIPATH drive is not receiving any ongoing development and
+should be considered a legacy driver. The device-mapper based
+multipath drivers should be preferred for new installations.
.SS FAULTY
The FAULTY md module is provided for testing purposes. A faulty array
@@ -569,6 +617,8 @@ in
.TP
.B md_mod.start_ro=1
+.TP
+.B /sys/module/md_mod/parameters/start_ro
This tells md to start all arrays in read-only mode. This is a soft
read-only that will automatically switch to read-write on the first
write request. However until that write request, nothing is written
@@ -577,6 +627,8 @@ operation is started.
.TP
.B md_mod.start_dirty_degraded=1
+.TP
+.B /sys/module/md_mod/parameters/start_dirty_degraded
As mentioned above, md will not normally start a RAID4, RAID5, or
RAID6 that is both dirty and degraded as this situation can imply
hidden data loss. This can be awkward if the root filesystem is
@@ -626,13 +678,13 @@ 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 disks will shuffle
-more data for a given speed). The default is 100.
+more data for a given speed). The default is 1000.
.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.
+The default is 200,000.
.SH SEE ALSO
.BR mdadm (8),
diff --git a/mdadm.8 b/mdadm.8
index 44f3331..8022014 100644
--- a/mdadm.8
+++ b/mdadm.8
@@ -5,7 +5,7 @@
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\" See file COPYING in distribution for details.
-.TH MDADM 8 "" v3.0-rc1
+.TH MDADM 8 "" v3.0.2
.SH NAME
mdadm \- manage MD devices
.I aka
@@ -17,7 +17,7 @@ Linux Software RAID
.SH DESCRIPTION
RAID devices are virtual devices created from two or more
-real block devices. This allows multiple devices (typically disk
+real block devices. This allows multiple devices (typically disk
drives or partitions thereof) to be combined into a single device to
hold (for example) a single filesystem.
Some RAID levels include redundancy and so can survive some degree of
@@ -81,7 +81,7 @@ mdadm has several major modes of operation:
.TP
.B Assemble
Assemble the components of a previously created
-array into an active array. Components can be explicitly given
+array into an active array. Components can be explicitly given
or can be searched for.
.I mdadm
checks that the components
@@ -90,7 +90,7 @@ information so as to assemble a faulty array.
.TP
.B Build
-Build an array that doesn't have per-device superblocks. For these
+Build an array that doesn't have per-device metadata (superblocks). For these
sorts of arrays,
.I mdadm
cannot differentiate between initial creation and subsequent assembly
@@ -102,15 +102,20 @@ what you are doing.
.TP
.B Create
-Create a new array with per-device superblocks.
-.\"It can progress
-.\"in several step create-add-add-run or it can all happen with one command.
+Create a new array with per-device metadata (superblocks).
+Appropriate metadata is written to each device, and then the array
+comprising those devices is activated. A 'resync' process is started
+to make sure that the array is consistent (e.g. both sides of a mirror
+contain the same data) but the content of the device is left otherwise
+untouched.
+The array can be used as soon as it has been created. There is no
+need to wait for the initial resync to finish.
.TP
.B "Follow or Monitor"
Monitor one or more md devices and act on any state changes. This is
-only meaningful for raid1, 4, 5, 6, 10 or multipath arrays, as
-only these have interesting state. raid0 or linear never have
+only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as
+only these have interesting state. RAID0 or Linear never have
missing, spare, or failed drives, so there is nothing to monitor.
.TP
@@ -194,7 +199,8 @@ work if
is compiled into the kernel \(em not if it is a module.
Arrays can be auto-detected by the kernel if all the components are in
primary MS-DOS partitions with partition type
-.BR FD .
+.BR FD ,
+and all use v0.90 metadata.
In-kernel autodetect is not recommended for new installations. Using
.I mdadm
to detect and assemble arrays \(em possibly in an
@@ -207,7 +213,7 @@ If a device is given before any options, or if the first option is
.BR \-\-fail ,
or
.BR \-\-remove ,
-then the MANAGE mode is assume.
+then the MANAGE mode is assumed.
Anything other than these will cause the
.B Misc
mode to be assumed.
@@ -304,7 +310,7 @@ says to get a list of array devices from
.TP
.B \-e ", " \-\-metadata=
-Declare the style of superblock (raid metadata) to be used. The
+Declare the style of RAID metadata (superblock) to be used. The
default is 0.90 for
.BR \-\-create ,
and to guess for other operations.
@@ -327,8 +333,9 @@ The different sub-versions store the superblock at different locations
on the device, either at the end (for 1.0), at the start (for 1.1) or
4K from the start (for 1.2).
.IP ddf
-Use the "Industry Standard" DDF (Disk Data Format) format. When
-creating a DDF array a
+Use the "Industry Standard" DDF (Disk Data Format) format defined by
+SNIA.
+When creating a DDF array a
.B CONTAINER
will be created, and normal arrays can be created in that container.
.IP imsm
@@ -350,7 +357,7 @@ 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
+will be recorded in the metadata. 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.
@@ -360,7 +367,8 @@ for the given homehost will be reported as such.
When using Auto-Assemble, only arrays tagged for the given homehost
will be allowed to use 'local' names (i.e. not ending in '_' followed
-by a digit string).
+by a digit string). See below under
+.BR "Auto Assembly" .
.SH For create, build, or grow:
@@ -371,30 +379,29 @@ number of spare devices (see below) must equal the number of
.I component-devices
(including "\fBmissing\fP" devices)
that are listed on the command line for
-.BR \-\-create .
+.BR \-\-create .
Setting a value of 1 is probably
a mistake and so requires that
.B \-\-force
be specified first. A value of 1 will then be allowed for linear,
-multipath, raid0 and raid1. It is never allowed for raid4 or raid5.
+multipath, RAID0 and RAID1. It is never allowed for RAID4, RAID5 or RAID6.
.br
This number can only be changed using
.B \-\-grow
-for RAID1, RAID5 and RAID6 arrays, and only on kernels which provide
-necessary support.
+for RAID1, RAID4, RAID5 and RAID6 arrays, and only on kernels which provide
+the necessary support.
.TP
.BR \-x ", " \-\-spare\-devices=
Specify the number of spare (eXtra) devices in the initial array.
Spares can also be added
and removed later. The number of component devices listed
-on the command line must equal the number of raid devices plus the
+on the command line must equal the number of RAID devices plus the
number of spare devices.
-
.TP
.BR \-z ", " \-\-size=
-Amount (in Kibibytes) of space to use from each drive in RAID level 1/4/5/6.
+Amount (in Kibibytes) of space to use from each drive in RAID levels 1/4/5/6.
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
@@ -404,7 +411,7 @@ issued.
This value can be set with
.B \-\-grow
-for RAID level 1/4/5/6. If the array was created with a size smaller
+for RAID level 1/4/5/6. If the array was created with a size smaller
than the currently active drives, the extra space can be accessed
using
.BR \-\-grow .
@@ -434,14 +441,20 @@ before the number of devices in the array is reduced.
.TP
.BR \-c ", " \-\-chunk=
Specify chunk size of kibibytes. The default is 64.
+This is only meaningful for RAID0, RAID4, RAID5, RAID6, and RAID10.
.TP
.BR \-\-rounding=
-Specify rounding factor for linear array (==chunk size)
+Specify rounding factor for a Linear array. The size of each
+component will be rounded down to a multiple of this size.
+This is a synonym for
+.B \-\-chunk
+but highlights the different meaning for Linear as compared to other
+RAID levels.
.TP
.BR \-l ", " \-\-level=
-Set raid level. When used with
+Set RAID level. When used with
.BR \-\-create ,
options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4,
raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty, container.
@@ -466,7 +479,7 @@ This option configures the fine details of data layout for RAID5, RAID6,
and RAID10 arrays, and controls the failure modes for
.IR faulty .
-The layout of the raid5 parity block can be one of
+The layout of the RAID5 parity block can be one of
.BR left\-asymmetric ,
.BR left\-symmetric ,
.BR right\-asymmetric ,
@@ -475,6 +488,31 @@ The layout of the raid5 parity block can be one of
The default is
.BR left\-symmetric .
+It is also possibly to cause RAID5 to use a RAID4-like layout by
+choosing
+.BR parity\-first ,
+or
+.BR parity\-last .
+
+Finally for RAID5 there are DDF\-compatible layouts,
+.BR ddf\-zero\-restart ,
+.BR ddf\-N\-restart ,
+and
+.BR ddf\-N\-continue .
+
+These same layouts are available for RAID6. There are also 4 layouts
+that will provide an intermediate stage for converting between RAID5
+and RAID6. These provide a layout which is identical to the
+corresponding RAID5 layout on the first N\-1 devices, and has the 'Q'
+syndrome (the second 'parity' block used by RAID6) on the last device.
+These layouts are:
+.BR left\-symmetric\-6 ,
+.BR right\-symmetric\-6 ,
+.BR left\-asymmetric\-6 ,
+.BR right\-asymmetric\-6 ,
+and
+.BR pairty\-first\-6 .
+
When setting the failure mode for level
.I faulty,
the options are:
@@ -503,7 +541,7 @@ Finally, the layout options for RAID10 are one of 'n', 'o' or 'f' followed
by a small number. The default is 'n2'. The supported options are:
.I 'n'
-signals 'near' copies. Multiple copies of one data block are at
+signals 'near' copies. Multiple copies of one data block are at
similar offsets in different devices.
.I 'o'
@@ -516,7 +554,7 @@ down.
.I 'f'
signals 'far' copies
(multiple copies have very different offsets).
-See md(4) for more detail about 'near' and 'far'.
+See md(4) for more detail about 'near', 'offset', and 'far'.
The number is the number of copies of each datablock. 2 is normal, 3
can be useful. This number can be at most equal to the number of
@@ -566,7 +604,7 @@ Storing bitmap files on other filesystems may result in serious problems.
.TP
.BR \-\-bitmap\-chunk=
-Set the chunksize of the bitmap. Each bit corresponds to that many
+Set the chunksize of the bitmap. Each bit corresponds to that many
Kilobytes of storage.
When using a file based bitmap, the default is to use the smallest
size that is at-least 4 and requires no more than 2^21 chunks.
@@ -575,10 +613,9 @@ When using an
bitmap, the chunksize is automatically determined to make best use of
available space.
-
.TP
.BR \-W ", " \-\-write\-mostly
-subsequent devices lists in a
+subsequent devices listed in a
.BR \-\-build ,
.BR \-\-create ,
or
@@ -591,8 +628,8 @@ slow link.
.TP
.BR \-\-write\-behind=
Specify that write-behind mode should be enabled (valid for RAID1
-only). If an argument is specified, it will set the maximum number
-of outstanding writes allowed. The default value is 256.
+only). If an argument is specified, it will set the maximum number
+of outstanding writes allowed. The default value is 256.
A write-intent bitmap is required in order to use write-behind
mode, and write-behind is only attempted on drives marked as
.IR write-mostly .
@@ -606,16 +643,17 @@ when trying to recover from a major failure as you can be sure that no
data will be affected unless you actually write to the array. It can
also be used when creating a RAID1 or RAID10 if you want to avoid the
initial resync, however this practice \(em while normally safe \(em is not
-recommended. Use this only if you really know what you are doing.
+recommended. Use this only if you really know what you are doing.
.TP
.BR \-\-backup\-file=
This is needed when
.B \-\-grow
is used to increase the number of
-raid-devices in a RAID5 if there are no spare devices available.
-See the section below on RAID_DEVICE CHANGES. The file should be
-stored on a separate device, not on the raid array being reshaped.
+raid-devices in a RAID5 if there are no spare devices available.
+See the GROW MODE section below on RAID\-DEVICES CHANGES. The file
+should be stored on a separate device, not on the RAID array being
+reshaped.
.TP
.BR \-\-array-size= ", " \-Z
@@ -637,8 +675,16 @@ amount of available space is.
Set a
.B name
for the array. This is currently only effective when creating an
-array with a version-1 superblock. The name is a simple textual
-string that can be used to identify array components when assembling.
+array with a version-1 superblock, or an array in a DDF container.
+The name is a simple textual string that can be used to identify array
+components when assembling. If name is needed but not specified, it
+is taken from the basename of the device that is being created.
+e.g. when creating
+.I /dev/md/home
+the
+.B name
+will default to
+.IR home .
.TP
.BR \-R ", " \-\-run
@@ -657,7 +703,7 @@ Insist that
accept the geometry and layout specified without question. Normally
.I mdadm
will not allow creation of an array with only one device, and will try
-to create a raid5 array with one missing drive (as this makes the
+to create a RAID5 array with one missing drive (as this makes the
initial resync work faster). With
.BR \-\-force ,
.I mdadm
@@ -700,48 +746,50 @@ partitions. A different number of partitions can be specified at the
end of this option (e.g.
.BR \-\-auto=p7 ).
If the device name ends with a digit, the partition names add a 'p',
-and a number, e.g. "/dev/md/home1p3". If there is no
-trailing digit, then the partition names just have a number added,
-e.g. "/dev/md/scratch3".
+and a number, e.g.
+.IR /dev/md/home1p3 .
+If there is no trailing digit, then the partition names just have a
+number added, e.g.
+.IR /dev/md/scratch3 .
If the md device name is in a 'standard' format as described in DEVICE
NAMES, then it will be created, if necessary, with the appropriate
-number based on that name. If the device name is not in one of these
-formats, then a unused minor number will be allocated. The minor
+device number based on that name. If the device name is not in one of these
+formats, then a unused device number will be allocated. The device
number will be considered unused if there is no active array for that
number, and there is no entry in /dev for that number and with a
-non-standard name. Name that are not in 'standard' format are only
+non-standard name. Names that are not in 'standard' format are only
allowed in "/dev/md/".
.ig XX
-\".TP
-\".BR \-\-symlink = no
-\"Normally when
-\".B \-\-auto
-\"causes
-\".I mdadm
-\"to create devices in
-\".B /dev/md/
-\"it will also create symlinks from
-\".B /dev/
-\"with names starting with
-\".B md
-\"or
-\".BR md_ .
-\"Use
-\".B \-\-symlink=no
-\"to suppress this, or
-\".B \-\-symlink=yes
-\"to enforce this even if it is suppressing
-\".IR mdadm.conf .
-\"
+.\".TP
+.\".BR \-\-symlink = no
+.\"Normally when
+.\".B \-\-auto
+.\"causes
+.\".I mdadm
+.\"to create devices in
+.\".B /dev/md/
+.\"it will also create symlinks from
+.\".B /dev/
+.\"with names starting with
+.\".B md
+.\"or
+.\".BR md_ .
+.\"Use
+.\".B \-\-symlink=no
+.\"to suppress this, or
+.\".B \-\-symlink=yes
+.\"to enforce this even if it is suppressing
+.\".IR mdadm.conf .
+.\"
.XX
.SH For assemble:
.TP
.BR \-u ", " \-\-uuid=
-uuid of array to assemble. Devices which don't have this uuid are
+uuid of array to assemble. Devices which don't have this uuid are
excluded
.TP
@@ -761,6 +809,12 @@ e.g. when assembling
.B \-\-super\-minor=dev
will look for super blocks with a minor number of 0.
+.B \-\-super\-minor
+is only relevant for v0.90 metadata, and should not normally be used.
+Using
+.B \-\-uuid
+is much safer.
+
.TP
.BR \-N ", " \-\-name=
Specify the name of the array to assemble. This must be the name
@@ -772,7 +826,15 @@ prefixed to the start of the given name.
.TP
.BR \-f ", " \-\-force
-Assemble the array even if some superblocks appear out-of-date
+Assemble the array even if the metadata on some devices appears to be
+out-of-date. If
+.I mdadm
+cannot find enough working devices to start the array, but can find
+some devices that are recorded as having failed, then it will mark
+those devices as working so that the array can be started.
+An array which requires
+.B \-\-force
+to be started may contain data corruption. Use it carefully.
.TP
.BR \-R ", " \-\-run
@@ -853,7 +915,7 @@ This can be useful if
reports a different "Preferred Minor" to
.BR \-\-detail .
In some cases this update will be performed automatically
-by the kernel driver. In particular the update happens automatically
+by the kernel driver. In particular the update happens automatically
at the first write to an array with redundancy (RAID level 1 or
greater) on a 2.6 (or later) kernel.
@@ -887,8 +949,8 @@ The
.B resync
option will cause the array to be marked
.I dirty
-meaning that any redundancy in the array (e.g. parity for raid5,
-copies for raid1) may be incorrect. This will cause the raid system
+meaning that any redundancy in the array (e.g. parity for RAID5,
+copies for RAID1) may be incorrect. This will cause the RAID system
to perform a "resync" pass to make sure that all redundant information
is correct.
@@ -906,7 +968,7 @@ with original (Version 0.90) superblocks.
The
.B summaries
-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.
The
@@ -925,6 +987,7 @@ This will cause
to determine the maximum usable amount of space on each device and
update the relevant field in the metadata.
+.ig XX
.TP
.B \-\-auto\-update\-homehost
This flag is only meaningful with auto-assembly (see discussion below).
@@ -932,16 +995,27 @@ In that situation, if no suitable arrays are found for this homehost,
.I mdadm
will rescan for any arrays at all and will assemble them and update the
homehost to match the current host.
+.XX
.SH For Manage mode:
.TP
.BR \-a ", " \-\-add
-hot-add listed devices.
+hot-add listed devices. For arrays with redundancy, the listed
+devices become available as spares. If the array is degraded, it will
+immediately start recovering data on to one of these spares.
.TP
.BR \-\-re\-add
-re-add a device that was recently removed from an array.
+re-add a device that was recently removed from an array. This is only
+needed for arrays that have be built (i.e. with
+.BR --build ).
+For created arrays, devices are always re-added if that is possible.
+When re-adding a device, if nothing has changed on the array since the
+device was removed, no recovery is performed. Also, if the array has
+a write-intent bitmap, then the recovery performed after a re-add will
+be limited to those blocks which, according to the bitmap, might have
+changed since the device was removed.
.TP
.BR \-r ", " \-\-remove
@@ -978,18 +1052,17 @@ same as
.TP
.BR \-\-write\-mostly
Subsequent devices that are added or re-added will have the 'write-mostly'
-flag set. This is only valid for RAID! and means that the 'md' driver
+flag set. This is only valid for RAID1 and means that the 'md' driver
will avoid reading from these devices if possible.
.TP
.BR \-\-readwrite
Subsequent devices that are added or re-added will have the 'write-mostly'
flag cleared.
-
.P
-Each of these options require that the first device listed is the array
+Each of these options requires that the first device listed is the array
to be acted upon, and the remainder are component devices to be added,
-removed, or marked as faulty. Several different operations can be
+removed, marked as faulty, etc. Several different operations can be
specified for different devices, e.g.
.in +5
mdadm /dev/md0 \-\-add /dev/sda1 \-\-fail /dev/sdb1 \-\-remove /dev/sdb1
@@ -1022,11 +1095,11 @@ Information about what is discovered is presented.
.TP
.BR \-D ", " \-\-detail
-Print detail of one or more md devices.
+Print details of one or more md devices.
.TP
.BR \-\-detail\-platform
-Print detail of the platform's raid capabilities (firmware / hardware
+Print details of the platform's RAID capabilities (firmware / hardware
topology) for a given metadata format.
.TP
@@ -1041,12 +1114,21 @@ pairs for easy import into the environment.
.TP
.BR \-E ", " \-\-examine
-Print content of md superblock on device(s).
+Print contents of the metadata stored on the named device(s).
+Note the contrast between
+.B \-\-examine
+and
+.BR \-\-detail .
+.B \-\-examine
+applies to devices which are components of an array, while
+.B \-\-detail
+applies to a whole array which is currently active.
.TP
.B \-\-sparc2.2
-If an array was created on a 2.2 Linux kernel patched with RAID
-support, the superblock will have been created incorrectly, or at
-least incompatibly with 2.4 and later kernels. Using the
+If an array was created on a SPARC machine with a 2.2 Linux kernel
+patched with RAID support, the superblock will have been created
+incorrectly, or at least incompatibly with 2.4 and later kernels.
+Using the
.B \-\-sparc2.2
flag with
.B \-\-examine
@@ -1058,11 +1140,19 @@ the right thing, then the array can be successfully assembled using
.BR \-X ", " \-\-examine\-bitmap
Report information about a bitmap file.
The argument is either an external bitmap file or an array component
-in case of an internal bitmap.
+in case of an internal bitmap. Note that running this on an array
+device (e.g.
+.BR /dev/md0 )
+does not report the bitmap for that array.
.TP
.BR \-R ", " \-\-run
-start a partially built array.
+start a partially assembled array. If
+.B \-\-assemble
+did not find enough devices to fully start the array, it might leaving
+it partially assembled. If you wish, you can then use
+.B \-\-run
+to start the array in degraded mode.
.TP
.BR \-S ", " \-\-stop
@@ -1090,7 +1180,9 @@ When used with
.BR \-\-detail ,
the exit status of
.I mdadm
-is set to reflect the status of the device.
+is set to reflect the status of the device. See below in
+.B MISC MODE
+for details.
.TP
.BR \-W ", " \-\-wait
@@ -1164,14 +1256,17 @@ facility of 'daemon' and varying priorities.
Give a delay in seconds.
.I mdadm
polls the md arrays and then waits this many seconds before polling
-again. The default is 60 seconds.
+again. The default is 60 seconds. Since 2.6.16, there is no need to
+reduce this as the kernel alerts
+.I mdadm
+immediately when there is any change.
.TP
.BR \-f ", " \-\-daemonise
Tell
.I mdadm
to run as a background daemon if it decides to monitor anything. This
-causes it to fork and run in the child, and to disconnect form the
+causes it to fork and run in the child, and to disconnect from the
terminal. The process id of the child is written to stdout.
This is useful with
.B \-\-scan
@@ -1216,16 +1311,16 @@ Usage:
.HP 12
Usage:
.B mdadm \-\-assemble \-\-scan
-.I md-devices-and-options...
+.I md-devices-and-options...
.HP 12
Usage:
.B mdadm \-\-assemble \-\-scan
-.I options...
+.I options...
.PP
-This usage assembles one or more raid arrays from pre-existing components.
+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 component-devices. These can be found in a number of ways.
+array, and a number of component-devices. These can be found in a number of ways.
In the first usage example (without the
.BR \-\-scan )
@@ -1233,8 +1328,9 @@ the first device given is the md device.
In the second usage example, all devices listed are treated as md
devices and assembly is attempted.
In the third (where no devices are listed) all md devices that are
-listed in the configuration file are assembled. Then any arrays that
-can be found on unused devices will also be assembled.
+listed in the configuration file are assembled. If not arrays are
+described by the configuration file, then any arrays that
+can be found on unused devices will be assembled.
If precisely one device is listed, but
.B \-\-scan
@@ -1246,7 +1342,9 @@ was given and identity information is extracted from the configuration file.
The identity can be given with the
.B \-\-uuid
-option, with the
+option, the
+.B \-\-name
+option, or the
.B \-\-super\-minor
option, will be taken from the md-device record in the config file, or
will be taken from the super block of the first component-device
@@ -1254,7 +1352,7 @@ listed on the command line.
Devices can be given on the
.B \-\-assemble
-command line or in the config file. Only devices which have an md
+command line or in the config file. Only devices which have an md
superblock which contains the right identity will be considered for
any array.
@@ -1275,50 +1373,59 @@ identity of md arrays.
Normally the array will be started after it is assembled. However if
.B \-\-scan
-is not given and insufficient drives were listed 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, 4, 5, 6, or 10), give the
+is not given and not all expected drives were listed, 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, 4, 5, 6, or 10),
+give the
.B \-\-run
flag.
-If the md device does not exist, then it will be created providing the
-intent is clear. i.e. the name must be in a standard form, or the
-.B \-\-auto
-option must be given to clarify how and whether the device should be
-created.
-This can be useful for handling partitioned devices (which don't have
-a stable device number \(em it can change after a reboot) and when using
-"udev" to manage your
+If
+.I udev
+is active,
+.I mdadm
+does not create any entries in
.B /dev
-tree (udev cannot handle md devices because of the unusual device
-initialisation conventions).
+but leaves that to
+.IR udev .
+It does record information in
+.B /var/run/mdadm/map
+which will allow
+.I udev
+to choose the correct name.
-If the option to "auto" is "mdp" or "part" or (on the command line
-only) "p", then mdadm will create a partitionable array, using the
-first free one that is not in use and does not already have an entry
-in /dev (apart from numeric /dev/md* entries).
+If
+.I mdadm
+detects that udev is not configured, it will create the devices in
+.B /dev
+itself.
-If the option to "auto" is "yes" or "md" or (on the command line)
-nothing, then mdadm will create a traditional, non-partitionable md
-array.
+In Linux kernels prior to version 2.6.28 there were two distinctly
+different types of md devices that could be created: one that could be
+partitioned using standard partitioning tools and one that could not.
+Since 2.6.28 that distinction is no longer relevant as both type of
+devices can be partitioned.
+.I mdadm
+will normally create the type that originally could not be partitioned
+as it has a well defined major number (9).
-It is expected that the "auto" functionality will be used to create
-device entries with meaningful names such as "/dev/md/home" or
-"/dev/md/root", rather than names based on the numerical array number.
+Prior to 2.6.28, it is important that mdadm chooses the correct type
+of array device to use. This can be controlled with the
+.B \-\-auto
+option. In particular, a value of "mdp" or "part" or "p" tells mdadm
+to use a partitionable device rather than the default.
-When using option "auto" to create a partitionable array, the device
-files for the first 4 partitions are also created. If a different
-number is required it can be simply appended to the auto option.
-e.g. "auto=part8". Partition names are created by appending a digit
-string to the device name, with an intervening "p" if the device name
-ends with a digit.
+In the no-udev case, the value given to
+.B \-\-auto
+can be suffixed by a number. This tells
+.I mdadm
+to create that number of partition devices rather than the default of 4.
-The
+The value given to
.B \-\-auto
-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
-these modes.
+can also be given in the configuration file as a word starting
+.B auto=
+on the ARRAY line for the relevant array.
.SS Auto Assembly
When
@@ -1330,13 +1437,15 @@ and no devices are listed,
will first attempt to assemble all the arrays listed in the config
file.
-It will then look further for possible arrays and will try to assemble
-anything that it finds. Arrays which are tagged as belonging to the given
-homehost will be assembled and started normally. Arrays which do not
-obviously belong to this host are given names that are expected not to
-conflict with anything local, and are started "read-auto" so that
-nothing is written to any device until the array is written to. i.e.
-automatic resync etc is delayed.
+In no array at listed in the config (other than those marked
+.BR <ignore> )
+it will look through the available devices for possible arrays and
+will try to assemble anything that it finds. Arrays which are tagged
+as belonging to the given homehost will be assembled and started
+normally. Arrays which do not obviously belong to this host are given
+names that are expected not to conflict with anything local, and are
+started "read-auto" so that nothing is written to any device until the
+array is written to. i.e. automatic resync etc is delayed.
If
.I mdadm
@@ -1352,9 +1461,10 @@ so for example
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
+.B /dev/md/
(the name will have any 'host' prefix stripped first).
+.ig XX
If
.I mdadm
cannot find any array for the given host at all, and if
@@ -1372,6 +1482,7 @@ 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.
+.XX
.SH BUILD MODE
@@ -1387,14 +1498,16 @@ Usage:
.PP
This usage is similar to
.BR \-\-create .
-The difference is that it creates an array without a superblock. With
+The difference is that it creates an 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 raid0, linear, multipath, or faulty, or one of their
-synonyms. All devices must be listed and the array will be started
-once complete.
+The level may raid0, linear, raid1, raid10, multipath, or faulty, or
+one of their synonyms. All devices must be listed and the array will
+be started once complete. It will often be appropriate to use
+.B \-\-assume\-clean
+with levels raid1 or raid10.
.SH CREATE MODE
@@ -1406,20 +1519,20 @@ Usage:
.BI \-\-level= Y
.br
.BI \-\-raid\-devices= Z
-.I devices
+.I devices
.PP
This usage will initialise a new md array, associate some devices with
it, and activate the array.
-If the
-.B \-\-auto
-option is given (as described in more detail in the section on
-Assemble mode), then the md device will be created with a suitable
-device number if necessary.
+The named device will normally not exist when
+.I "mdadm \-\-create"
+is run, but will be created by
+.I udev
+once the array becomes active.
-As devices are added, they are checked to see if they contain raid
-superblocks or filesystems. They are also checked to see if the variance in
+As devices are added, they are checked to see if they contain RAID
+superblocks or filesystems. They are also checked to see if the variance in
device size exceeds 1%.
If any discrepancy is found, the array will not automatically be run, though
@@ -1441,9 +1554,9 @@ others can be
When creating a RAID5 array,
.I mdadm
will automatically create a degraded array with an extra spare drive.
-This is because building the spare into a degraded array is in general faster than resyncing
-the parity on a non-degraded, but not clean, array. This feature can
-be overridden with the
+This is because building the spare into a degraded array is in general
+faster than resyncing the parity on a non-degraded, but not clean,
+array. This feature can be overridden with the
.B \-\-force
option.
@@ -1465,11 +1578,11 @@ is being created, then the name
.B home
will be used.
-When creating a partition based array, using
-.I mdadm
-with version-1.x metadata, the partition type should be set to
+When creating a partition based array, using
+.I mdadm
+with version-1.x metadata, the partition type should be set to
.B 0xDA
-(non fs-data). This type selection allows for greater precision since
+(non fs-data). This type selection allows for greater precision since
using any other [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)],
might create problems in the event of array recovery through a live cdrom.
@@ -1514,7 +1627,6 @@ be in use.
.B \-\-readonly
start the array readonly \(em not supported yet.
-
.SH MANAGE MODE
.HP 12
Usage:
@@ -1525,7 +1637,7 @@ Usage:
This usage will allow individual devices in an array to be failed,
removed or added. It is possible to perform multiple operations with
-on command. For example:
+on command. For example:
.br
.B " mdadm /dev/md0 \-f /dev/hda1 \-r /dev/hda1 \-a /dev/hda1"
.br
@@ -1537,12 +1649,20 @@ and will then remove it from the array and finally add it back
in as a spare. However only one md array can be affected by a single
command.
+When a device is added to an active array, mdadm checks to see if it
+has metadata on it which suggests that it was recently a member of the
+array. If it does, it tried to "re-add" the device. If there have
+been no changes since the device was removed, or if the array has a
+write-intent bitmap which has recorded whatever changes there were,
+then the device will immediately become a full member of the array and
+those differences recorded in the bitmap will be resolved.
+
.SH MISC MODE
.HP 12
Usage:
.B mdadm
.I options ...
-.I devices ...
+.I devices ...
.PP
MISC mode includes a number of distinct operations that
@@ -1557,7 +1677,7 @@ The information discovered is reported.
.TP
.B \-\-detail
The device should be an active md device.
-.B mdadm
+.B mdadm
will display a detailed description of the array.
.B \-\-brief
or
@@ -1589,7 +1709,7 @@ There was an error while trying to get information about the device.
.TP
.B \-\-detail\-platform
-Print detail of the platform's raid capabilities (firmware / hardware
+Print detail of the platform's RAID capabilities (firmware / hardware
topology). If the metadata is specified with
.B \-e
or
@@ -1658,7 +1778,6 @@ For
.B \-\-scan
causes all devices listed in the config file to be examined.
-
.SH MONITOR MODE
.HP 12
@@ -1684,7 +1803,7 @@ and if the destination array has a failed drive but no spares.
If any devices are listed on the command line,
.I mdadm
-will only monitor those devices. Otherwise all arrays listed in the
+will only monitor those devices. Otherwise all arrays listed in the
configuration file will be monitored. Further, if
.B \-\-scan
is given, then any other md devices that appear in
@@ -1768,7 +1887,7 @@ device has been successfully rebuilt and has been made active.
.B NewArray
A new md array has been detected in the
.B /proc/mdstat
-file. (syslog priority: Info)
+file. (syslog priority: Info)
.TP
.B DegradedArray
@@ -1857,7 +1976,7 @@ The GROW mode is used for changing the size or shape of an active
array.
For this to work, the kernel must support the necessary change.
Various types of growth are being added during 2.6 development,
-including restructuring a raid5 array to have more active devices.
+including restructuring a RAID5 array to have more active devices.
Currently the only support available is to
.IP \(bu 4
@@ -1893,7 +2012,11 @@ Note that when an array changes size, any filesystem that may be
stored in the array will not automatically grow to use the space. The
filesystem will need to be explicitly told to use the extra space.
-.SS RAID-DEVICES CHANGES
+Also the size of an array cannot be changed while it has an active
+bitmap. If an array has a bitmap, it must be removed before the size
+can be changed. Once the change it complete a new bitmap can be created.
+
+.SS RAID\-DEVICES CHANGES
A RAID1 array can work with any number of devices from 1 upwards
(though 1 is not very useful). There may be times which you want to
@@ -1911,8 +2034,8 @@ present will be activated immediately.
Changing the number of active devices in a RAID5 or RAID6 is much more
effort. Every block in the array will need to be read and written
back to a new location. From 2.6.17, the Linux Kernel is able to
-increase the number of devices in a RAID5 safely, including restart
-and interrupted "reshape". From 2.6.31, the Linux Kernel is able to
+increase the number of devices in a RAID5 safely, including restarting
+an interrupted "reshape". From 2.6.31, the Linux Kernel is able to
increase or decrease the number of devices in a RAID5 or RAID6.
When decreasing the number of devices, the size of the array will also
@@ -1925,7 +2048,7 @@ This is a reversible change which simply makes the end of the array
inaccessible. The integrity of any data can then be checked before
the non-reversible reduction in the number of devices is request.
-When relocating the first few stripes on a raid5, it is not possible
+When relocating the first few stripes on a RAID5, it is not possible
to keep the data on disk completely consistent and crash-proof. To
provide the required safety, mdadm disables writes to the array while
this "critical section" is reshaped, and takes a backup of the data
@@ -1968,7 +2091,7 @@ stored on the device being reshaped.
A write-intent bitmap can be added to, or removed from, an active
array. Either internal bitmaps, or bitmaps stored in a separate file,
can be added. Note that if you add a bitmap stored in a file which is
-in a filesystem that is on the raid array being affected, the system
+in a filesystem that is on the RAID array being affected, the system
will deadlock. The bitmap must be on a separate filesystem.
.SH INCREMENTAL MODE
@@ -1986,7 +2109,6 @@ Usage:
Usage:
.B mdadm \-\-incremental \-\-run \-\-scan
-
.PP
This mode is designed to be used in conjunction with a device
discovery system. As devices are found in a system, they can be
@@ -2046,6 +2168,7 @@ finds any known version of metadata. If no
.I md
metadata is found, the device is rejected.
+.ig XX
.IP +
Does the metadata match an expected array?
The metadata can match in two ways. Either there is an array listed
@@ -2063,14 +2186,16 @@ If
.I mdadm
is not able to positively identify the array as belonging to the
current host, the device will be rejected.
+.XX
-.IP +
.I mdadm
keeps a list of arrays that it has partially assembled in
.B /var/run/mdadm/map
(or
.B /var/run/mdadm.map
-if the directory doesn't exist). If no array exists which matches
+if the directory doesn't exist. Or maybe even
+.BR /dev/.mdadm.map ).
+If no array exists which matches
the metadata on the new device,
.I mdadm
must choose a device name and unit number. It does this based on any
@@ -2087,7 +2212,13 @@ line in
suggests that a non-partitionable array is preferred, that will be
honoured.
-.IP +
+If the array is not found in the config file and its metadata does not
+identify it as belonging to the "homehost", then
+.I mdadm
+will choose a name for the array which is certain not to conflict with
+any array which does belong to this host. It does this be adding an
+underscore and a small number to the name preferred by the metadata.
+
Once an appropriate array is found or created and the device is added,
.I mdadm
must decide if the array is ready to be started. It will
@@ -2101,8 +2232,8 @@ As an alternative,
may be passed to
.I mdadm
in which case the array will be run as soon as there are enough
-devices present for the data to be accessible. For a raid1, that
-means one device will start the array. For a clean raid5, the array
+devices present for the data to be accessible. For a RAID1, that
+means one device will start the array. For a clean RAID5, the array
will be started as soon as all but one drive is present.
Note that neither of these approaches is really ideal. If it can
@@ -2117,7 +2248,6 @@ that no metadata updates are made and no attempt at resync or recovery
happens. Further devices that are found before the first write can
still be added safely.
-
.SH ENVIRONMENT
This section describes environment variables that affect how mdadm
operates.
@@ -2144,7 +2274,7 @@ will create and devices that are needed.
.B " mdadm \-\-query /dev/name-of-device"
.br
-This will find out if a given device is a raid array, or is part of
+This will find out if a given device is a RAID array, or is part of
one, and will provide brief information about the device.
.B " mdadm \-\-assemble \-\-scan"
@@ -2244,7 +2374,7 @@ Create a DDF array over 6 devices.
.B " mdadm --create /dev/md/home -n3 -l5 -z 30000000 /dev/md/ddf"
.br
-Create a raid5 array over any 3 devices in the given DDF set. Use
+Create a RAID5 array over any 3 devices in the given DDF set. Use
only 30 gigabytes of each device.
.B " mdadm -A /dev/md/ddf1 /dev/sd[a-f]"
@@ -2268,7 +2398,6 @@ Provide help about the format of the config file.
.br
Provide general help.
-
.SH FILES
.SS /proc/mdstat
@@ -2284,7 +2413,6 @@ uses this to find arrays when
is given in Misc mode, and to monitor array reconstruction
on Monitor mode.
-
.SS /etc/mdadm.conf
The config file lists which devices may be scanned to see if
@@ -2301,7 +2429,13 @@ If
.B /var/run/mdadm
does not exist as a directory, then
.B /var/run/mdadm.map
-is used instead.
+is used instead. If
+.B /var/run
+is not available (as may be the case during early boot),
+.B /dev/.mdadm.map
+is used on the basis that
+.B /dev
+is usually available very early in boot.
.SH DEVICE NAMES
@@ -2326,13 +2460,18 @@ can be given.
When
.I mdadm
-chooses device names during auto-assembly, it will normally add a
-small sequence number to the end of the name to avoid conflicted
-between multiple arrays that have the same name. If
+chooses device names during auto-assembly or incremental assembly, it
+will sometimes add a small sequence number to the end of the name to
+avoid conflicted between multiple arrays that have the same name. If
.I mdadm
can reasonably determine that the array really is meant for this host,
either by a hostname in the metadata, or by the presence of the array
-in /etc/mdadm.conf, then it will leave of the suffix if possible.
+in /etc/mdadm.conf, then it will leave off the suffix if possible.
+Also if the homehost is specified as
+.B <ignore>
+.I mdadm
+will only use a suffix if a different array of the same name already
+exists or is listed in the config file.
The standard names for non-partitioned arrays (the only sort of md
array available in 2.4 and earlier) are of the form
@@ -2374,7 +2513,7 @@ RAID, see:
.\"for new releases of the RAID driver check out:
.\"
.\".IP
-.\".UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
+.\".UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
.\"ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
.\".UE
.\".PP
@@ -2392,6 +2531,7 @@ should always be available from
.PP
Related man pages:
.PP
+.IR mdmon (8),
.IR mdadm.conf (5),
.IR md (4).
.PP
diff --git a/mdadm.c b/mdadm.c
index 6b571d7..a4f2d90 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*
* Additions for bitmap and write-behind RAID options, Copyright (C) 2003-2004,
* Paul Clements, SteelEye Technology, Inc.
@@ -345,9 +340,11 @@ int main(int argc, char *argv[])
}
continue;
+#if 0
case O(ASSEMBLE,AutoHomeHost):
auto_update_home = 1;
continue;
+#endif
case O(INCREMENTAL, 'e'):
case O(CREATE,'e'):
case O(ASSEMBLE,'e'):
@@ -433,7 +430,10 @@ int main(int argc, char *argv[])
optarg);
exit(2);
}
- if (level != 0 && level != -1 && level != 1 && level != -4 && level != -5 && mode == BUILD) {
+ if (level != 0 && level != LEVEL_LINEAR && level != 1 &&
+ level != LEVEL_MULTIPATH && level != LEVEL_FAULTY &&
+ level != 10 &&
+ mode == BUILD) {
fprintf(stderr, Name ": Raid level %s not permitted with --build.\n",
optarg);
exit(2);
@@ -1166,6 +1166,7 @@ int main(int argc, char *argv[])
} while (rv2!=2);
/* Incase there are stacked devices, we need to go around again */
} while (acnt);
+#if 0
if (cnt == 0 && auto_update_home && homehost) {
/* Nothing found, maybe we need to bootstrap homehost info */
do {
@@ -1185,6 +1186,7 @@ int main(int argc, char *argv[])
/* Incase there are stacked devices, we need to go around again */
} while (acnt);
}
+#endif
if (cnt == 0 && rv == 0) {
fprintf(stderr, Name ": No arrays found in config file or automatically\n");
rv = 1;
@@ -1382,6 +1384,13 @@ int main(int argc, char *argv[])
rv = 1;
break;
}
+ if (delay == 0) {
+ if (get_linux_version() > 20616)
+ /* mdstat responds to poll */
+ delay = 1000;
+ else
+ delay = 60;
+ }
rv= Monitor(devlist, mailaddr, program,
delay?delay:60, daemonise, scan, oneshot,
dosyslog, test, pidfile);
diff --git a/mdadm.conf.5 b/mdadm.conf.5
index 87a8c1b..002e2b3 100644
--- a/mdadm.conf.5
+++ b/mdadm.conf.5
@@ -63,7 +63,7 @@ will cause
.I mdadm
to look for assembled CONTAINER arrays and included them as a source
for assembling further arrays.
-.PP
+
The word
.I partitions
will cause
@@ -86,7 +86,7 @@ DEVICE /dev/hda* /dev/hdc*
.br
DEV /dev/sd*
.br
-DEVICE /dev/discs/disc*/disc
+DEVICE /dev/disk/by-path/pci*
.br
DEVICE partitions
@@ -109,13 +109,12 @@ which matches the rest of the line will never be automatically assembled.
If no device name is given,
.I mdadm
will use various heuristics to determine an appropriate name.
-.PP
+
Subsequent words identify the array, or identify the array as a member
of a group. If multiple identities are given,
then a component device must match ALL identities to be considered a
match. Each identity word has a tag, and equals sign, and some value.
The tags are:
-
.RS 4
.TP
.B uuid=
@@ -160,6 +159,7 @@ this is mainly for compatibility with the output of
.TP
.B spares=
The value is a number of spare devices to expect the array to have.
+The sole use of this keyword and value is as follows:
.B mdadm \-\-monitor
will report an array if it is found to have fewer than this number of
spares when
@@ -225,12 +225,12 @@ Specify that this array is a member array of some container. The
value given can be either a path name in /dev, or a UUID of the
container array.
-.IP
+.TP
.B member=
Specify that this array is a member array of some container. Each
type of container has some way to enumerate member arrays, often a
simple sequence number. The value identifies which member of a
-container the array is. It will usually accompany a 'container=' word.
+container the array is. It will usually accompany a "container=" word.
.RE
.TP
@@ -337,7 +337,7 @@ The
.B homehost
line gives a default value for the
.B --homehost=
-option to mdadm. There should be exactly one other word on the line.
+option to mdadm. There should normally be only one other word on the line.
It should either be a host name, or one of the special words
.B <system>
and
@@ -351,19 +351,26 @@ systemcall is used to get the host name.
If
.B <ignore>
is given, then a flag is set so that when arrays are being
-auto-assemble the checking of the recorded
+auto-assembled the checking of the recorded
.I homehost
is disabled.
+If
+.B <ignore>
+is given it is also possible to give an explicit name which will be
+used when creating arrays. This is the only case when there can be
+more that one other word on the
+.B HOMEHOST
+line.
When arrays are created, this host name will be stored in the
metadata. When arrays are assembled using auto-assembly, arrays which
do not record the correct homehost name in their metadata will be
-assembled using a 'foreign' name. A 'foreign' name alway ends with a
-digit string (possibly preceded by an underscore) to differentiate it
+assembled using a "foreign" name. A "foreign" name alway ends with a
+digit string preceded by an underscore to differentiate it
from any possible local name. e.g.
.B /dev/md/1_1
or
-.BR /dev/md/home0 .
+.BR /dev/md/home_0 .
.TP
.B AUTO
A list of names of metadata format can be given, each preceded by a
diff --git a/mdadm.h b/mdadm.h
index b0ff7dc..74a1b71 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#define _GNU_SOURCE
@@ -446,6 +441,7 @@ extern struct superswitch {
*/
void (*examine_super)(struct supertype *st, char *homehost);
void (*brief_examine_super)(struct supertype *st, int verbose);
+ void (*brief_examine_subarrays)(struct supertype *st, int verbose);
void (*export_examine_super)(struct supertype *st);
/* Used to report details of an active array.
@@ -861,6 +857,7 @@ extern int open_container(int fd);
extern int mdmon_running(int devnum);
extern int signal_mdmon(int devnum);
extern int check_env(char *name);
+extern __u32 random32(void);
extern int start_mdmon(int devnum);
extern char *devnum2devname(int num);
diff --git a/mdadm.spec b/mdadm.spec
index c961817..7ea4c8c 100644
--- a/mdadm.spec
+++ b/mdadm.spec
@@ -1,6 +1,6 @@
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays)
Name: mdadm
-Version: 3.0_rc1
+Version: 3.0.2
Release: 1
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tgz
URL: http://neil.brown.name/blog/mdadm
diff --git a/mdassemble.8 b/mdassemble.8
index 1baf2fe..cedcd0f 100644
--- a/mdassemble.8
+++ b/mdassemble.8
@@ -1,5 +1,5 @@
.\" -*- nroff -*-
-.TH MDASSEMBLE 8 "" v3.0-rc1
+.TH MDASSEMBLE 8 "" v3.0.2
.SH NAME
mdassemble \- assemble MD devices
.I aka
diff --git a/mdassemble.c b/mdassemble.c
index 45ff9c5..cf83795 100644
--- a/mdassemble.c
+++ b/mdassemble.c
@@ -1,7 +1,7 @@
/*
* mdassemble - assemble Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
* Copyright (C) 2003 Luca Berra <bluca@vodka.it>
*
*
@@ -20,12 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
diff --git a/mdmon.8 b/mdmon.8
index 2129dc7..6092812 100644
--- a/mdmon.8
+++ b/mdmon.8
@@ -1,5 +1,5 @@
.\" See file COPYING in distribution for details.
-.TH MDMON 8 "" v3.0-rc1
+.TH MDMON 8 "" v3.0.2
.SH NAME
mdmon \- monitor MD external metadata arrays
@@ -15,11 +15,12 @@ occurs, like disk failures and clean-to-dirty transitions. The kernel, in
important cases, waits for user space to take action on these notifications.
.SH DESCRIPTION
-.P
-.B Metadata updates:
-.P
-To service metadata update requests a daemon, mdmon, is introduced.
-Mdmon is tasked with polling the sysfs namespace looking for changes in
+.SS Metadata updates:
+To service metadata update requests a daemon,
+.IR mdmon ,
+is introduced.
+.I Mdmon
+is tasked with polling the sysfs namespace looking for changes in
.BR array_state ,
.BR sync_action ,
and per disk
@@ -48,7 +49,9 @@ The safe mode timer has expired so set array state to clean to block writes to t
Clear the dirty bit for the volume
.TP
.B array_state \- read-only
-This is the initial state that all arrays start at. mdmon takes one of the three actions:
+This is the initial state that all arrays start at.
+.I mdmon
+takes one of the three actions:
.RS
.TP
1/
@@ -72,8 +75,8 @@ checkpoint resync.
.TP
.B sync_action \- recover\-to\-idle
A spare may have completed rebuilding so tell the metadata handler about the
-state of each disk. This is the metadata handler’s opportunity to clear any
-"out-of-sync" bits and clear the volume’s degraded status. If a recovery
+state of each disk. This is the metadata handler's opportunity to clear
+any "out-of-sync" bits and clear the volume's degraded status. If a recovery
process is idled before it completes this event allows the metadata handler to
checkpoint recovery.
.TP
@@ -81,10 +84,10 @@ checkpoint recovery.
A disk failure kicks off a series of events. First, notify the metadata
handler that a disk has failed, and then notify the kernel that it can unblock
writes that were dependent on this disk. After unblocking the kernel this disk
-is set to be removed* from the member array. Finally the disk is marked failed
+is set to be removed+ from the member array. Finally the disk is marked failed
in all other member arrays in the container.
.IP
-\* Note This behavior differs slightly from native MD arrays where
++ Note This behavior differs slightly from native MD arrays where
removal is reserved for a
.B mdadm --remove
event. In the external metadata case the container holds the final
@@ -93,8 +96,7 @@ reference on a block device and a
call is still required.
.RE
-.P
-.B Containers:
+.SS Containers:
.P
External metadata formats, like DDF, differ from the native MD metadata
formats in that they define a set of disks and a series of sub-arrays
@@ -106,7 +108,9 @@ each array can created be created with a subset of those partitions. The
supported external formats perform this disk carving internally.
.P
Container devices simply hold references to all member disks and allow
-tools like mdmon to determine which active arrays belong to which
+tools like
+.I mdmon
+to determine which active arrays belong to which
container. Some array management commands like disk removal and disk
add are now only valid at the container level. Attempts to perform
these actions on member arrays are blocked with error messages like:
@@ -125,14 +129,36 @@ CONTAINER
The
.B container
device to monitor. It can be a full path like /dev/md/container, a simple md
-device name like md127, or /proc/mdstat which tells mdmon to scan for
-containers and launch an mdmon instance for each one found.
+device name like md127, or /proc/mdstat which tells
+.I mdmon
+to scan for containers and launch an
+.I mdmon
+instance for each one found.
.TP
[NEWROOT]
-In order to support an external metadata raid array as the rootfs mdmon needs
-to be started in the initramfs environment. Once the initramfs environment
-mounts the final rootfs mdmon needs to be restarted in the new namespace. When
-NEWROOT is specified mdmon will terminate any mdmon instances that are running
-in the current namespace, chroot(2) to NEWROOT, and continue monitoring the
-container.
+In order to support an external metadata raid array as the rootfs
+.I mdmon
+needs to be started in the initramfs environment. Once the initramfs
+environment mounts the final rootfs
+.I mdmon
+needs to be restarted in the new namespace. When NEWROOT is specified
+.I mdmon
+will terminate any
+.I mdmon
+instances that are running in the current namespace,
+.IR chroot (2)
+to NEWROOT, and continue monitoring the container.
+.PP
+Note that
+.I mdmon
+is automatically started by
+.I mdadm
+when needed and so does not need to be considered when working with
+RAID arrays. The only times it is run other that by
+.I mdadm
+is when the boot scripts need to restart it after mounting the new
+root filesystem.
+.SH SEE ALSO
+.IR mdadm (8),
+.IR md (4).
diff --git a/mdmon.c b/mdmon.c
index 5e39437..31994d8 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -1,8 +1,8 @@
/*
* mdmon - monitor external metadata arrays
*
- * Copyright (C) 2007-2008 Neil Brown <neilb@suse.de>
- * Copyright (C) 2007-2008 Intel Corporation
+ * Copyright (C) 2007-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2007-2009 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -395,7 +395,7 @@ int mdmon(char *devname, int devnum, int scan, char *switchroot)
} else
pfd[0] = pfd[1] = -1;
- container = malloc(sizeof(*container));
+ container = calloc(1, sizeof(*container));
container->devnum = devnum;
container->devname = devname;
container->arrays = NULL;
diff --git a/mdmon.h b/mdmon.h
index e4904ba..7cfee35 100644
--- a/mdmon.h
+++ b/mdmon.h
@@ -1,8 +1,8 @@
/*
* mdmon - monitor external metadata arrays
*
- * Copyright (C) 2007-2008 Neil Brown <neilb@suse.de>
- * Copyright (C) 2007-2008 Intel Corporation
+ * Copyright (C) 2007-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2007-2009 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
diff --git a/mdopen.c b/mdopen.c
index 293ac25..d322cf4 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
diff --git a/mdstat.c b/mdstat.c
index 8de51cf..4d2f473 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -2,7 +2,7 @@
* mdstat - parse /proc/mdstat file. Part of:
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2002-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2002-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -20,12 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
/*
diff --git a/monitor.c b/monitor.c
index 66fea80..0cafc3a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,8 +1,8 @@
/*
* mdmon - monitor external metadata arrays
*
- * Copyright (C) 2007-2008 Neil Brown <neilb@suse.de>
- * Copyright (C) 2007-2008 Intel Corporation
+ * Copyright (C) 2007-2009 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2007-2009 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
diff --git a/platform-intel.c b/platform-intel.c
index 5160227..d568ca6 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -90,7 +90,7 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver)
list->path = canonicalize_file_name(path);
list->next = NULL;
}
-
+ closedir(driver_dir);
return head;
}
@@ -157,6 +157,7 @@ static int scan(const void *start, const void *end)
const struct imsm_orom *find_imsm_orom(void)
{
static int populated = 0;
+ unsigned long align;
/* it's static data so we only need to read it once */
if (populated)
@@ -184,7 +185,11 @@ const struct imsm_orom *find_imsm_orom(void)
return NULL;
/* scan option-rom memory looking for an imsm signature */
- if (probe_roms_init() != 0)
+ if (check_env("IMSM_SAFE_OROM_SCAN"))
+ align = 2048;
+ else
+ align = 512;
+ if (probe_roms_init(align) != 0)
return NULL;
probe_roms();
populated = scan_adapter_roms(scan);
diff --git a/probe_roms.c b/probe_roms.c
index 06ec3f5..a9a8638 100644
--- a/probe_roms.c
+++ b/probe_roms.c
@@ -32,6 +32,8 @@ static void *rom_mem = MAP_FAILED;
static int rom_fd = -1;
const static int rom_len = 0xf0000 - 0xc0000; /* option-rom memory region */
static int _sigbus;
+static unsigned long rom_align;
+
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
static void sigbus(int sig)
@@ -76,11 +78,20 @@ void probe_roms_exit(void)
}
}
-int probe_roms_init(void)
+int probe_roms_init(unsigned long align)
{
int fd;
int rc = 0;
+ /* valid values are 2048 and 512. 512 is for PCI-3.0 compliant
+ * systems, or systems that do not have dangerous/legacy ISA
+ * devices. 2048 should always be safe
+ */
+ if (align == 512 || align == 2048)
+ rom_align = align;
+ else
+ return -1;
+
if (signal(SIGBUS, sigbus) == SIG_ERR)
rc = -1;
if (rc == 0) {
@@ -208,6 +219,11 @@ int scan_adapter_roms(scan_fn fn)
return found;
}
+static unsigned long align(unsigned long addr, unsigned long alignment)
+{
+ return (addr + alignment - 1) & ~(alignment - 1);
+}
+
void probe_roms(void)
{
const void *rom;
@@ -220,7 +236,7 @@ void probe_roms(void)
/* video rom */
upper = adapter_rom_resources[0].start;
- for (start = video_rom_resource.start; start < upper; start += 2048) {
+ for (start = video_rom_resource.start; start < upper; start += rom_align) {
rom = isa_bus_to_virt(start);
if (!romsignature(rom))
continue;
@@ -239,7 +255,7 @@ void probe_roms(void)
break;
}
- start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
+ start = align(video_rom_resource.end + 1, rom_align);
if (start < upper)
start = upper;
@@ -255,7 +271,7 @@ void probe_roms(void)
}
/* check for adapter roms on 2k boundaries */
- for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) {
+ for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += rom_align) {
rom = isa_bus_to_virt(start);
if (!romsignature(rom))
continue;
@@ -273,7 +289,7 @@ void probe_roms(void)
adapter_rom_resources[i].start = start;
adapter_rom_resources[i].end = start + length - 1;
- start = adapter_rom_resources[i++].end & ~2047UL;
+ start = adapter_rom_resources[i++].end & ~(rom_align - 1);
}
}
diff --git a/probe_roms.h b/probe_roms.h
index 557e933..a1e291a 100644
--- a/probe_roms.h
+++ b/probe_roms.h
@@ -18,7 +18,7 @@
*/
void probe_roms_exit(void);
-int probe_roms_init(void);
+int probe_roms_init(unsigned long align);
typedef int (*scan_fn)(const void *start, const void *end);
int scan_adapter_roms(scan_fn fn);
void probe_roms(void);
diff --git a/restripe.c b/restripe.c
index 33548e9..e5ecd10 100644
--- a/restripe.c
+++ b/restripe.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2006-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
diff --git a/super-ddf.c b/super-ddf.c
index 77a481f..9bf08c2 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2006-2007 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2006-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -762,6 +762,9 @@ static int load_ddf_local(int fd, struct ddf_super *super,
static int load_super_ddf_all(struct supertype *st, int fd,
void **sbp, char *devname, int keep_fd);
#endif
+
+static void free_super_ddf(struct supertype *st);
+
static int load_super_ddf(struct supertype *st, int fd,
char *devname)
{
@@ -798,6 +801,8 @@ static int load_super_ddf(struct supertype *st, int fd,
return 1;
}
+ free_super_ddf(st);
+
if (posix_memalign((void**)&super, 512, sizeof(*super))!= 0) {
fprintf(stderr, Name ": malloc of %zu failed.\n",
sizeof(*super));
@@ -835,6 +840,18 @@ static int load_super_ddf(struct supertype *st, int fd,
return rv;
}
+ if (st->subarray[0]) {
+ struct vcl *v;
+
+ for (v = super->conflist; v; v = v->next)
+ if (v->vcnum == atoi(st->subarray))
+ super->currentconf = v;
+ if (!super->currentconf) {
+ free(super);
+ return 1;
+ }
+ }
+
/* Should possibly check the sections .... */
st->sb = super;
@@ -1166,13 +1183,24 @@ static void brief_examine_super_ddf(struct supertype *st, int verbose)
{
/* We just write a generic DDF ARRAY entry
*/
+ struct mdinfo info;
+ char nbuf[64];
+ getinfo_super_ddf(st, &info);
+ fname_from_uuid(st, &info, nbuf, ':');
+
+ printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
+}
+
+static void brief_examine_subarrays_ddf(struct supertype *st, int verbose)
+{
+ /* We just write a generic DDF ARRAY entry
+ */
struct ddf_super *ddf = st->sb;
struct mdinfo info;
int i;
char nbuf[64];
getinfo_super_ddf(st, &info);
fname_from_uuid(st, &info, nbuf, ':');
- printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
for (i=0; i<__be16_to_cpu(ddf->virt->max_vdes); i++) {
struct virtual_entry *ve = &ddf->virt->entries[i];
@@ -1495,17 +1523,6 @@ static int update_super_ddf(struct supertype *st, struct mdinfo *info,
return rv;
}
-__u32 random32(void)
-{
- __u32 rv;
- int rfd = open("/dev/urandom", O_RDONLY);
- if (rfd < 0 || read(rfd, &rv, 4) != 4)
- rv = random();
- if (rfd >= 0)
- close(rfd);
- return rv;
-}
-
static void make_header_guid(char *guid)
{
__u32 stamp;
@@ -2345,15 +2362,19 @@ static int __write_init_super_ddf(struct supertype *st, int do_close)
static int write_init_super_ddf(struct supertype *st)
{
+ struct ddf_super *ddf = st->sb;
+ struct vcl *currentconf = ddf->currentconf;
+
+ /* we are done with currentconf reset it to point st at the container */
+ ddf->currentconf = NULL;
if (st->update_tail) {
/* queue the virtual_disk and vd_config as metadata updates */
struct virtual_disk *vd;
struct vd_config *vc;
- struct ddf_super *ddf = st->sb;
int len;
- if (!ddf->currentconf) {
+ if (!currentconf) {
int len = (sizeof(struct phys_disk) +
sizeof(struct phys_disk_entry));
@@ -2372,14 +2393,14 @@ static int write_init_super_ddf(struct supertype *st)
len = sizeof(struct virtual_disk) + sizeof(struct virtual_entry);
vd = malloc(len);
*vd = *ddf->virt;
- vd->entries[0] = ddf->virt->entries[ddf->currentconf->vcnum];
- vd->populated_vdes = __cpu_to_be16(ddf->currentconf->vcnum);
+ vd->entries[0] = ddf->virt->entries[currentconf->vcnum];
+ vd->populated_vdes = __cpu_to_be16(currentconf->vcnum);
append_metadata_update(st, vd, len);
/* Then the vd_config */
len = ddf->conf_rec_len * 512;
vc = malloc(len);
- memcpy(vc, &ddf->currentconf->conf, len);
+ memcpy(vc, &currentconf->conf, len);
append_metadata_update(st, vc, len);
/* FIXME I need to close the fds! */
@@ -3587,6 +3608,7 @@ struct superswitch super_ddf = {
#ifndef MDASSEMBLE
.examine_super = examine_super_ddf,
.brief_examine_super = brief_examine_super_ddf,
+ .brief_examine_subarrays = brief_examine_subarrays_ddf,
.export_examine_super = export_examine_super_ddf,
.detail_super = detail_super_ddf,
.brief_detail_super = brief_detail_super_ddf,
diff --git a/super-intel.c b/super-intel.c
index d7383fb..07b0b90 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -64,7 +64,6 @@ struct imsm_disk {
#define SPARE_DISK __cpu_to_le32(0x01) /* Spare */
#define CONFIGURED_DISK __cpu_to_le32(0x02) /* Member of some RaidDev */
#define FAILED_DISK __cpu_to_le32(0x04) /* Permanent failure */
-#define USABLE_DISK __cpu_to_le32(0x08) /* Fully usable unless FAILED_DISK is set */
__u32 status; /* 0xF0 - 0xF3 */
__u32 owner_cfg_num; /* which config 0,1,2... owns this disk */
#define IMSM_DISK_FILLERS 4
@@ -247,6 +246,7 @@ struct intel_super {
int creating_imsm; /* flag to indicate container creation */
int current_vol; /* index of raid device undergoing creation */
__u32 create_offset; /* common start for 'current_vol' */
+ __u32 random; /* random data for seeding new family numbers */
struct intel_dev *devlist;
struct dl {
struct dl *next;
@@ -686,10 +686,9 @@ static void print_imsm_disk(struct imsm_super *mpb, int index, __u32 reserved)
snprintf(str, MAX_RAID_SERIAL_LEN + 1, "%s", disk->serial);
printf(" Disk%02d Serial : %s\n", index, str);
s = disk->status;
- printf(" State :%s%s%s%s\n", s&SPARE_DISK ? " spare" : "",
+ printf(" State :%s%s%s\n", s&SPARE_DISK ? " spare" : "",
s&CONFIGURED_DISK ? " active" : "",
- s&FAILED_DISK ? " failed" : "",
- s&USABLE_DISK ? " usable" : "");
+ s&FAILED_DISK ? " failed" : "");
printf(" Id : %08x\n", __le32_to_cpu(disk->scsi_id));
sz = __le32_to_cpu(disk->total_blocks) - reserved;
printf(" Usable Size : %llu%s\n", (unsigned long long)sz,
@@ -714,6 +713,7 @@ static void examine_super_imsm(struct supertype *st, char *homehost)
printf(" Magic : %s\n", str);
snprintf(str, strlen(MPB_VERSION_RAID0), "%s", get_imsm_version(mpb));
printf(" Version : %s\n", get_imsm_version(mpb));
+ printf(" Orig Family : %08x\n", __le32_to_cpu(mpb->orig_family_num));
printf(" Family : %08x\n", __le32_to_cpu(mpb->family_num));
printf(" Generation : %08x\n", __le32_to_cpu(mpb->generation_num));
getinfo_super_imsm(st, &info);
@@ -759,6 +759,23 @@ static void brief_examine_super_imsm(struct supertype *st, int verbose)
/* We just write a generic IMSM ARRAY entry */
struct mdinfo info;
char nbuf[64];
+ struct intel_super *super = st->sb;
+
+ if (!super->anchor->num_raid_devs) {
+ printf("ARRAY metadata=imsm\n");
+ return;
+ }
+
+ getinfo_super_imsm(st, &info);
+ fname_from_uuid(st, &info, nbuf, ':');
+ printf("ARRAY metadata=imsm UUID=%s\n", nbuf + 5);
+}
+
+static void brief_examine_subarrays_imsm(struct supertype *st, int verbose)
+{
+ /* We just write a generic IMSM ARRAY entry */
+ struct mdinfo info;
+ char nbuf[64];
char nbuf1[64];
struct intel_super *super = st->sb;
int i;
@@ -768,15 +785,13 @@ static void brief_examine_super_imsm(struct supertype *st, int verbose)
getinfo_super_imsm(st, &info);
fname_from_uuid(st, &info, nbuf, ':');
- printf("ARRAY metadata=imsm auto=md UUID=%s\n", nbuf + 5);
for (i = 0; i < super->anchor->num_raid_devs; i++) {
struct imsm_dev *dev = get_imsm_dev(super, i);
super->current_vol = i;
getinfo_super_imsm(st, &info);
fname_from_uuid(st, &info, nbuf1, ':');
- printf("ARRAY /dev/md/%.16s container=%s\n"
- " member=%d auto=mdp UUID=%s\n",
+ printf("ARRAY /dev/md/%.16s container=%s member=%d UUID=%s\n",
dev->volume, nbuf + 5, i, nbuf1 + 5);
}
}
@@ -1090,7 +1105,7 @@ static int match_home_imsm(struct supertype *st, char *homehost)
/* the imsm metadata format does not specify any host
* identification information. We return -1 since we can never
* confirm nor deny whether a given array is "meant" for this
- * host. We rely on compare_super and the 'family_num' field to
+ * host. We rely on compare_super and the 'family_num' fields to
* exclude member disks that do not belong, and we rely on
* mdadm.conf to specify the arrays that should be assembled.
* Auto-assembly may still pick up "foreign" arrays.
@@ -1118,7 +1133,7 @@ static void uuid_from_super_imsm(struct supertype *st, int uuid[4])
*/
/* imsm does not track uuid's so we synthesis one using sha1 on
* - The signature (Which is constant for all imsm array, but no matter)
- * - the family_num of the container
+ * - the orig_family_num of the container
* - the index number of the volume
* - the 'serial' number of the volume.
* Hopefully these are all constant.
@@ -1128,10 +1143,18 @@ static void uuid_from_super_imsm(struct supertype *st, int uuid[4])
char buf[20];
struct sha1_ctx ctx;
struct imsm_dev *dev = NULL;
+ __u32 family_num;
+ /* some mdadm versions failed to set ->orig_family_num, in which
+ * case fall back to ->family_num. orig_family_num will be
+ * fixed up with the first metadata update.
+ */
+ family_num = super->anchor->orig_family_num;
+ if (family_num == 0)
+ family_num = super->anchor->family_num;
sha1_init_ctx(&ctx);
sha1_process_bytes(super->anchor->sig, MPB_SIG_LEN, &ctx);
- sha1_process_bytes(&super->anchor->family_num, sizeof(__u32), &ctx);
+ sha1_process_bytes(&family_num, sizeof(__u32), &ctx);
if (super->current_vol >= 0)
dev = get_imsm_dev(super, super->current_vol);
if (dev) {
@@ -1257,7 +1280,11 @@ static void fixup_container_spare_uuid(struct mdinfo *inf)
struct supertype *_cst; /* container supertype */
_cst = array_list->st;
- _sst = _cst->ss->match_metadata_desc(inf->text_version);
+ if (_cst)
+ _sst = _cst->ss->match_metadata_desc(inf->text_version);
+ else
+ _sst = NULL;
+
if (_sst) {
memcpy(inf->uuid, array_list->uuid, sizeof(int[4]));
free(_sst);
@@ -1439,7 +1466,8 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
*/
if (first->anchor->num_raid_devs > 0 &&
sec->anchor->num_raid_devs > 0) {
- if (first->anchor->family_num != sec->anchor->family_num)
+ if (first->anchor->orig_family_num != sec->anchor->orig_family_num ||
+ first->anchor->family_num != sec->anchor->family_num)
return 3;
}
@@ -1469,17 +1497,17 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
dv->next = first->devlist;
first->devlist = dv;
}
- if (i <= sec->anchor->num_raid_devs) {
+ if (i < sec->anchor->num_raid_devs) {
/* allocation failure */
free_devlist(first);
fprintf(stderr, "imsm: failed to associate spare\n");
return 3;
}
- for (i = 0; i < sec->anchor->num_raid_devs; i++)
- imsm_copy_dev(get_imsm_dev(first, i), get_imsm_dev(sec, i));
-
first->anchor->num_raid_devs = sec->anchor->num_raid_devs;
+ first->anchor->orig_family_num = sec->anchor->orig_family_num;
first->anchor->family_num = sec->anchor->family_num;
+ for (i = 0; i < sec->anchor->num_raid_devs; i++)
+ imsm_copy_dev(get_imsm_dev(first, i), get_imsm_dev(sec, i));
}
return 0;
@@ -2168,8 +2196,10 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
if (st->subarray[0]) {
if (atoi(st->subarray) <= super->anchor->num_raid_devs)
super->current_vol = atoi(st->subarray);
- else
+ else {
+ free_imsm(super);
return 1;
+ }
}
*sbp = super;
@@ -2194,8 +2224,8 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
if (load_super_imsm_all(st, fd, &st->sb, devname, 1) == 0)
return 0;
#endif
- if (st->subarray[0])
- return 1; /* FIXME */
+
+ free_super_imsm(st);
super = alloc_super(0);
if (!super) {
@@ -2216,6 +2246,15 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
return rv;
}
+ if (st->subarray[0]) {
+ if (atoi(st->subarray) <= super->anchor->num_raid_devs)
+ super->current_vol = atoi(st->subarray);
+ else {
+ free_imsm(super);
+ return 1;
+ }
+ }
+
st->sb = super;
if (st->ss == NULL) {
st->ss = &super_imsm;
@@ -2405,13 +2444,16 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
"in a raid1 volume\n");
return 0;
}
+
+ map->raid_level = info->level;
if (info->level == 10) {
map->raid_level = 1;
map->num_domains = info->raid_disks / 2;
- } else {
- map->raid_level = info->level;
+ } else if (info->level == 1)
+ map->num_domains = info->raid_disks;
+ else
map->num_domains = 1;
- }
+
num_data_stripes = info_to_num_data_stripes(info, map->num_domains);
map->num_data_stripes = __cpu_to_le32(num_data_stripes);
@@ -2524,7 +2566,7 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk,
super->anchor->num_disks++;
}
set_imsm_ord_tbl_ent(map, dk->number, dl->index);
- dl->disk.status = CONFIGURED_DISK | USABLE_DISK;
+ dl->disk.status = CONFIGURED_DISK;
/* if we are creating the first raid device update the family number */
if (super->current_vol == 0) {
@@ -2534,8 +2576,10 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk,
*_dev = *dev;
*_disk = dl->disk;
- sum = __gen_imsm_checksum(mpb);
+ sum = random32();
+ sum += __gen_imsm_checksum(mpb);
mpb->family_num = __cpu_to_le32(sum);
+ mpb->orig_family_num = mpb->family_num;
}
return 0;
@@ -2590,7 +2634,7 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
size /= 512;
serialcpy(dd->disk.serial, dd->serial);
dd->disk.total_blocks = __cpu_to_le32(size);
- dd->disk.status = USABLE_DISK | SPARE_DISK;
+ dd->disk.status = SPARE_DISK;
if (sysfs_disk_to_scsi_id(fd, &id) == 0)
dd->disk.scsi_id = __cpu_to_le32(id);
else
@@ -2632,6 +2676,7 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose)
mpb->disk[0] = d->disk;
sum = __gen_imsm_checksum(mpb);
mpb->family_num = __cpu_to_le32(sum);
+ mpb->orig_family_num = 0;
sum = __gen_imsm_checksum(mpb);
mpb->check_sum = __cpu_to_le32(sum);
@@ -2666,6 +2711,12 @@ static int write_super_imsm(struct intel_super *super, int doclose)
generation++;
mpb->generation_num = __cpu_to_le32(generation);
+ /* fix up cases where previous mdadm releases failed to set
+ * orig_family_num
+ */
+ if (mpb->orig_family_num == 0)
+ mpb->orig_family_num = mpb->family_num;
+
mpb_size += sizeof(struct imsm_disk) * mpb->num_disks;
for (d = super->disks; d; d = d->next) {
if (d->index == -1)
@@ -2709,17 +2760,16 @@ static int write_super_imsm(struct intel_super *super, int doclose)
}
-static int create_array(struct supertype *st)
+static int create_array(struct supertype *st, int dev_idx)
{
size_t len;
struct imsm_update_create_array *u;
struct intel_super *super = st->sb;
- struct imsm_dev *dev = get_imsm_dev(super, super->current_vol);
+ struct imsm_dev *dev = get_imsm_dev(super, dev_idx);
struct imsm_map *map = get_imsm_map(dev, 0);
struct disk_info *inf;
struct imsm_disk *disk;
int i;
- int idx;
len = sizeof(*u) - sizeof(*dev) + sizeof_imsm_dev(dev, 0) +
sizeof(*inf) * map->num_members;
@@ -2731,11 +2781,12 @@ static int create_array(struct supertype *st)
}
u->type = update_create_array;
- u->dev_idx = super->current_vol;
+ u->dev_idx = dev_idx;
imsm_copy_dev(&u->dev, dev);
inf = get_disk_info(u);
for (i = 0; i < map->num_members; i++) {
- idx = get_imsm_disk_idx(dev, i);
+ int idx = get_imsm_disk_idx(dev, i);
+
disk = get_imsm_disk(super, idx);
serialcpy(inf[i].serial, disk->serial);
}
@@ -2769,21 +2820,26 @@ static int _add_disk(struct supertype *st)
static int write_init_super_imsm(struct supertype *st)
{
+ struct intel_super *super = st->sb;
+ int current_vol = super->current_vol;
+
+ /* we are done with current_vol reset it to point st at the container */
+ super->current_vol = -1;
+
if (st->update_tail) {
/* queue the recently created array / added disk
* as a metadata update */
- struct intel_super *super = st->sb;
struct dl *d;
int rv;
/* determine if we are creating a volume or adding a disk */
- if (super->current_vol < 0) {
+ if (current_vol < 0) {
/* in the add disk case we are running in mdmon
* context, so don't close fd's
*/
return _add_disk(st);
} else
- rv = create_array(st);
+ rv = create_array(st, current_vol);
for (d = super->disks; d ; d = d->next) {
close(d->fd);
@@ -3404,8 +3460,6 @@ static struct mdinfo *container_content_imsm(struct supertype *st)
s = d ? d->disk.status : 0;
if (s & FAILED_DISK)
skip = 1;
- if (!(s & USABLE_DISK))
- skip = 1;
if (ord & IMSM_ORD_REBUILD)
skip = 1;
@@ -3626,8 +3680,9 @@ static int mark_failure(struct imsm_dev *dev, struct imsm_disk *disk, int idx)
return 0;
disk->status |= FAILED_DISK;
+ disk->status &= ~CONFIGURED_DISK;
set_imsm_ord_tbl_ent(map, slot, idx | IMSM_ORD_REBUILD);
- if (map->failed_disk_num == ~0)
+ if (~map->failed_disk_num == 0)
map->failed_disk_num = slot;
return 1;
}
@@ -3838,14 +3893,13 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
int idx = get_imsm_disk_idx(dev, slot);
struct imsm_super *mpb = super->anchor;
struct imsm_map *map;
- unsigned long long esize;
unsigned long long pos;
struct mdinfo *d;
struct extent *ex;
int i, j;
int found;
__u32 array_start;
- __u32 blocks;
+ __u32 array_end;
struct dl *dl;
for (dl = super->disks; dl; dl = dl->next) {
@@ -3897,15 +3951,14 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
j = 0;
pos = 0;
array_start = __le32_to_cpu(map->pba_of_lba0);
- blocks = __le32_to_cpu(map->blocks_per_member);
+ array_end = array_start +
+ __le32_to_cpu(map->blocks_per_member) - 1;
do {
/* check that we can start at pba_of_lba0 with
* blocks_per_member of space
*/
- esize = ex[j].start - pos;
- if (array_start >= pos &&
- array_start + blocks < ex[j].start) {
+ if (array_start >= pos && array_end < ex[j].start) {
found = 1;
break;
}
@@ -3919,9 +3972,8 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
free(ex);
if (i < mpb->num_raid_devs) {
- dprintf("%x:%x does not have %u at %u\n",
- dl->major, dl->minor,
- blocks, array_start);
+ dprintf("%x:%x does not have %u to %u available\n",
+ dl->major, dl->minor, array_start, array_end);
/* No room */
continue;
}
@@ -4023,6 +4075,7 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
di->data_offset = __le32_to_cpu(map->pba_of_lba0);
di->component_size = a->info.component_size;
di->container_member = inst;
+ super->random = random32();
di->next = rv;
rv = di;
num_spares++;
@@ -4189,6 +4242,15 @@ static void imsm_process_update(struct supertype *st,
set_imsm_ord_tbl_ent(map, u->slot, dl->index);
set_imsm_ord_tbl_ent(migr_map, u->slot, dl->index | IMSM_ORD_REBUILD);
+ /* update the family_num to mark a new container
+ * generation, being careful to record the existing
+ * family_num in orig_family_num to clean up after
+ * earlier mdadm versions that neglected to set it.
+ */
+ if (mpb->orig_family_num == 0)
+ mpb->orig_family_num = mpb->family_num;
+ mpb->family_num += super->random;
+
/* count arrays using the victim in the metadata */
found = 0;
for (a = st->arrays; a ; a = a->next) {
@@ -4502,6 +4564,7 @@ struct superswitch super_imsm = {
#ifndef MDASSEMBLE
.examine_super = examine_super_imsm,
.brief_examine_super = brief_examine_super_imsm,
+ .brief_examine_subarrays = brief_examine_subarrays_imsm,
.export_examine_super = export_examine_super_imsm,
.detail_super = detail_super_imsm,
.brief_detail_super = brief_detail_super_imsm,
diff --git a/super0.c b/super0.c
index 71b0324..b84db29 100644
--- a/super0.c
+++ b/super0.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#define HAVE_STDINT_H 1
@@ -318,9 +313,13 @@ static int match_home0(struct supertype *st, char *homehost)
{
mdp_super_t *sb = st->sb;
char buf[20];
- char *hash = sha1_buffer(homehost,
- strlen(homehost),
- buf);
+ char *hash;
+
+ if (!homehost)
+ return 0;
+ hash = sha1_buffer(homehost,
+ strlen(homehost),
+ buf);
return (memcmp(&sb->set_uuid2, hash, 8)==0);
}
diff --git a/super1.c b/super1.c
index 7683f1e..540c776 100644
--- a/super1.c
+++ b/super1.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -698,6 +693,8 @@ static int update_super1(struct supertype *st, struct mdinfo *info,
__u32 r[4] = {random(), random(), random(), random()};
memcpy(sb->device_uuid, r, 16);
}
+ if (rfd >= 0)
+ close(rfd);
sb->dev_roles[i] =
__cpu_to_le16(info->disk.raid_disk);
diff --git a/sysfs.c b/sysfs.c
index 1452939..5806fa7 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -2,7 +2,7 @@
* sysfs - extract md related information from sysfs. Part of:
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2006-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -786,3 +786,108 @@ int sysfs_unique_holder(int devnum, long rdev)
else
return found;
}
+
+#ifndef MDASSEMBLE
+
+static char *clean_states[] = {
+ "clear", "inactive", "readonly", "read-auto", "clean", NULL };
+
+int WaitClean(char *dev, int verbose)
+{
+ int fd;
+ struct mdinfo *mdi;
+ int rv = 1;
+ int devnum;
+
+ fd = open(dev, O_RDONLY);
+ if (fd < 0) {
+ if (verbose)
+ fprintf(stderr, Name ": Couldn't open %s: %s\n", dev, strerror(errno));
+ return 1;
+ }
+
+ devnum = fd2devnum(fd);
+ mdi = sysfs_read(fd, devnum, GET_VERSION|GET_LEVEL|GET_SAFEMODE);
+ if (!mdi) {
+ if (verbose)
+ fprintf(stderr, Name ": Failed to read sysfs attributes for "
+ "%s\n", dev);
+ close(fd);
+ return 0;
+ }
+
+ switch(mdi->array.level) {
+ case LEVEL_LINEAR:
+ case LEVEL_MULTIPATH:
+ case 0:
+ /* safemode delay is irrelevant for these levels */
+ rv = 0;
+
+ }
+
+ /* for internal metadata the kernel handles the final clean
+ * transition, containers can never be dirty
+ */
+ if (!is_subarray(mdi->text_version))
+ rv = 0;
+
+ /* safemode disabled ? */
+ if (mdi->safe_mode_delay == 0)
+ rv = 0;
+
+ if (rv) {
+ int state_fd = sysfs_open(fd2devnum(fd), NULL, "array_state");
+ char buf[20];
+ fd_set fds;
+ struct timeval tm;
+
+ /* minimize the safe_mode_delay and prepare to wait up to 5s
+ * for writes to quiesce
+ */
+ sysfs_set_safemode(mdi, 1);
+ tm.tv_sec = 5;
+ tm.tv_usec = 0;
+
+ /* give mdmon a chance to checkpoint resync */
+ sysfs_set_str(mdi, NULL, "sync_action", "idle");
+
+ FD_ZERO(&fds);
+
+ /* wait for array_state to be clean */
+ while (1) {
+ rv = read(state_fd, buf, sizeof(buf));
+ if (rv < 0)
+ break;
+ if (sysfs_match_word(buf, clean_states) <= 4)
+ break;
+ FD_SET(state_fd, &fds);
+ rv = select(state_fd + 1, NULL, NULL, &fds, &tm);
+ if (rv < 0 && errno != EINTR)
+ break;
+ lseek(state_fd, 0, SEEK_SET);
+ }
+ if (rv < 0)
+ rv = 1;
+ else if (ping_monitor(mdi->text_version) == 0) {
+ /* we need to ping to close the window between array
+ * state transitioning to clean and the metadata being
+ * marked clean
+ */
+ rv = 0;
+ } else
+ rv = 1;
+ if (rv && verbose)
+ fprintf(stderr, Name ": Error waiting for %s to be clean\n",
+ dev);
+
+ /* restore the original safe_mode_delay */
+ sysfs_set_safemode(mdi, mdi->safe_mode_delay);
+ close(state_fd);
+ }
+
+ sysfs_free(mdi);
+ close(fd);
+
+ return rv;
+}
+#endif /* MDASSEMBLE */
diff --git a/tests/07testreshape5 b/tests/07testreshape5
index 44d5ddc..0360988 100644
--- a/tests/07testreshape5
+++ b/tests/07testreshape5
@@ -27,6 +27,7 @@ do
# test save
dd if=/dev/urandom of=$md0 bs=1024 count=$size
+ blockdev --flushbufs $md0 $devs
> /tmp/NewRand
$dir/test_stripe save /tmp/NewRand $disks $[chunk*1024] 5 $nlayout 0 $[size*1024] $devs
cmp -s -n $[size*1024] $md0 /tmp/NewRand || { echo cmp failed ; exit 2; }
diff --git a/util.c b/util.c
index c0c3f0c..f646bb9 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,12 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
@@ -933,6 +928,8 @@ void wait_for(char *dev, int fd)
return;
usleep(200000);
}
+ if (i == 25)
+ dprintf("%s: timeout waiting for %s\n", __func__, dev);
}
struct superswitch *superlist[] = { &super0, &super1, &super_ddf, &super_imsm, NULL };
@@ -1368,6 +1365,17 @@ int check_env(char *name)
return 0;
}
+__u32 random32(void)
+{
+ __u32 rv;
+ int rfd = open("/dev/urandom", O_RDONLY);
+ if (rfd < 0 || read(rfd, &rv, 4) != 4)
+ rv = random();
+ if (rfd >= 0)
+ close(rfd);
+ return rv;
+}
+
#ifndef MDASSEMBLE
int flush_metadata_updates(struct supertype *st)
{