summaryrefslogtreecommitdiffstats
path: root/mdadm.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git://github.com/djbw/mdadmNeilBrown2010-07-061-2/+45
|\
| * Merge branch 'fixes' into for-neilDan Williams2010-07-011-1/+0
| |\
| * | Rename subarray v2Dan Williams2010-06-221-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the name of the array stored in the metadata to be updated. In some cases the metadata format may not be able to support this rename without modifying the UUID. In these cases the request will be blocked. Otherwise we allow the rename to take place, even for active arrays. This assumes that the user understands the difference between the kernel node name, the device node symlink name, and the metadata specific name. Anticipating further need to modify subarrays in-place, introduce the ->update_subarray() superswitch method. A future potential use case is setting storage pool (spare-group) identifiers. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Kill subarray v2Dan Williams2010-06-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for deleting a subarray out of a container. When all subarrays are deleted the component devices are converted back into spares, a --zero-superblock is still needed to kill the remaining metadata at this point. This operation is blocked when the subarray is active and may also be blocked by the metadata handler when deleting the subarray might change the uuid of other active subarrays. For example, with imsm, deleting subarray 'n' may change the uuid of subarrays with indexes > n. Deleting a subarray needs to be a container wide event to ensure disks that record the modified subarray list perceive other disks that did not receive this change as out of date. Notes: The st->subarray parsing in super-intel.c and super-ddf.c is updated to be more strict now that we are reading user supplied subarray values. Offline container modification shares actions that mdmon typically handles so promote is_container_member() and version_to_superswitch() (formerly find_metadata_methods()) to generic utility functions for the cases where mdadm performs the operation. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | Add --test option to --re-add and similarNeilBrown2010-07-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --test can be given in Manage mode. This can be used when there is an attempt to fail or remove 'faulty', 'failed' or 'detached' devices, or to re-add 'missing' devices. If no devices were failed, removed, or re-added, then mdadm will exit with status '2'. Signed-off-by: NeilBrown <neilb@suse.de>
* | | Add -fail support to --incrementalNeilBrown2010-06-301-0/+12
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This can be used for hot-unplug. When a device has been remove, udev can call mdadm --incremental --fail sda and mdadm will find the array holding sda and remove sda from the array. Based on code from Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Revert "Incremental: honor --no-degraded to delay assembly"Dan Williams2010-05-261-1/+0
|/ | | | | | | | | | | | | | This reverts commit fdb482f99b9ad2ef8cd1724902fdfeedaa8796a1. Now that containers can report state for ->container_enough we can automatically determine when the array can be started, and no longer need the --no-degraded hammer. Conflicts: Incremental.c Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Assemble: Handle assembling from config file which is out of order.NeilBrown2010-02-241-15/+33
| | | | | | | | | | | | Currently "mdadm -As" will process the entries in the config file in order. If any array is a component or member of a preceding array, that array will not be assembled. So if there are any failures during assembly, retry those arrays, and look until everything is assembled, or nothing more can be assembled. Signed-off-by: NeilBrown <neilb@suse.de>
* Add test for "are we running as root".NeilBrown2010-02-011-0/+6
| | | | | | | | | | | Most operations require root access. Rather than ensure we generate the right error message when something fails because we aren't root, check early. Note that "--examine" does not necessarily require root, so test for that first. Resolves-Debian-bug: 396570 Signed-off-by: NeilBrown <neilb@suse.de>
* Kill: fix when zeroing busy devices.Artur Wojcik2010-01-291-1/+1
| | | | | | | | | mdadm should not wait indefinitely when it trys to reset superblock on device which is busy (cannot be opened). Acked-by: Andre Noll <maan@systemlinux.org> Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Tidy up some argument parsing, particularly for -bNeilBrown2010-01-291-7/+6
| | | | | | | -b only means --brief in MISC mode, elsewhere it is --bitmap. Resolves-debian-bug: 427777 Signed-off-by: NeilBrown <neilb@suse.de>
* Various fixes for --killNeilBrown2009-11-241-1/+10
| | | | | | | | | - When --kill-superblock is used with --metadata, find every different superblock if there are several and kill them all. - When creating a new array, kill off any old metadata. The code to do this was already present but has become broken over time. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: do not allow size changes with other changes.NeilBrown2009-11-061-0/+9
| | | | | | | | | | | A change the reduces the size of an array always happens before any other change. So it can cause data to be lost. By themselves these changes are reversible. But once another change has started, the data would be permanently lost. So recommend data integrity be checked between a size change and any other change. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.1NeilBrown2009-10-221-3/+20
|\
| * Detail: list containers before members.NeilBrown2009-10-191-0/+8
| | | | | | | | | | | | | | To allow "--assemble --scan" to have a chance, list containers before members in --detail --scan output. Signed-off-by: NeilBrown <neilb@suse.de>
| * Monitor: add option to specify rebuild incrementsZdenek Behan2009-10-191-1/+10
| | | | | | | | | | | | | | | | | | | | ie. the percent increments after which RebuildNN event is generated This is particulary useful when using --program option, rather than (only) syslog for alerts. Signed-off-by: Zdenek Behan <rain@matfyz.cz> Signed-off-by: NeilBrown <neilb@suse.de>
| * mdmon: preserve socket over chrootDan Williams2009-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | Connect to the monitor in the old namespace and use that connection for WaitClean requests when stopping the victim mdmon instance. This allows ping_monitor() to work post chroot(). Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into devel-3.1NeilBrown2009-10-011-8/+17
|\| | | | | | | | | Conflicts: mdadm.8
| * Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-021-7/+2
| | | | | | | | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
| * Monitor: reduce default poll interval if mdstat is pollable.NeilBrown2009-06-021-0/+7
| | | | | | | | | | | | | | | | | | Since 2.6.16, mdstat responds to select/poll. So in that case, increase the default poll interval to about 15 minutes. This ensures that the background load is insignificant. Signed-off-by: NeilBrown <neilb@suse.de>
| * mdadm.8: Man page updatesNeilBrown2009-06-021-1/+8
| | | | | | | | General review and update of mdadm.8
* | Handle extra 'grow' variations.NeilBrown2009-08-111-12/+16
| | | | | | | | UNFINISHED
* | Grow: --size improvements.NeilBrown2009-07-141-2/+4
| | | | | | | | | | | | | | 1/ allow --size to be given with 'G' or 'T' suffix. 2/ allow size to exceed 32bits, and in that case write through sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: pass layout as a string rather than a number.NeilBrown2009-07-141-7/+18
| | | | | | | | | | | | | | | | This allows the layout to be parsed after the current level of the array is know, so that the level doesn't need to be given (otherwise pointlessly) on the command line. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove Manage_reconfing in favour of Grow_reshapeNeilBrown2009-07-141-3/+1
| | | | | | | | | | | | | | | | Bother Manage_reconfig and Grow_reshape provide for changing the 'layout' of a faulty array. This is no necessary. So discard Manage_reconfig and just use Grow_reshape Signed-off-by: NeilBrown <neilb@suse.de>
* | main: factor out code to parse layout for raid10 and faulty.NeilBrown2009-07-141-22/+5
| | | | | | | | | | | | This will soon be called from multiple places. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: support --array-size changesNeilBrown2009-07-131-1/+42
|/ | | | | | | | | With 2.6.30 it is possible to tell the md driver to clip an array to a size smaller than the real size of the array. This option gives access to that feature. The size change does not persist across restarts. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.0NeilBrown2009-05-111-2/+3
|\ | | | | | | | | | | | | | | Conflicts: Build.c mdadm.c mdadm.h super1.c
| * mdadm: allow build to use --sizePaul Clements2009-04-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the --size parameter for build operations. Without this, if you have a raid1, for instance, where the 2 disks are not the exact same size, and you need to build the array but one of the disks is not available right at the moment (maybe it's USB and it's unplugged, or maybe it's a network disk and it's unavailable), then you have to play some weird games to get the array to size correctly (that is, to the size of the smaller of the two components or less). There may be other uses for this too... -- Paul Signed-off-by: NeilBrown <neilb@suse.de>
* | mapfile: allow the path name to the device to be empty.NeilBrown2009-05-111-1/+2
| | | | | | | | | | | | | | Allowing an empty name and coping with it is less confusing than seeing "/empty" appear. Signed-off-by: NeilBrown <neilb@suse.de>
* | Allow homehost to be largely ignored when assembling arrays.NeilBrown2009-05-111-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If mdadm.conf contains HOMEHOST <ignore> or commandline contains --homehost=<ignore> then the check that array metadata mentions the given homehost is replace by a check that the name recorded in the metadata is not already used by some other array mentioned in mdadm.conf. This allows more arrays to use their native name rather than having an _NN suffix added. This should only be used during boot time if all arrays required for normal boot are listed in mdadm.conf. If auto-assembly is used to find all array during boot, then the HOMEHOST feature should be used to ensure there is no room for confusion in choosing array names, and so it should not be set to <ignore>. Signed-off-by: NeilBrown <neilb@suse.de>
* | config: support "ARRAY <ignore> ..." lines in mdadm.confNeilBrown2009-05-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes we want to ensure particular arrays are never assembled automatically. This might include an array made of devices that are shared between hosts. To support this, allow ARRAY lines in mdadm.conf to use the word "ignore" rather than a device name. Arrays which match such lines are never automatically assembled (though they can still be assembled by explicitly giving identification information on the mdadm command line. Signed-off-by: NeilBrown <neilb@suse.de>
* | Detail: use meaningful names with --scan.NeilBrown2009-04-061-2/+9
| | | | | | | | | | | | | | | | | | | | | | When reporting "--detail --scan", use names like /dev/md/foo where available rather than /dev/md/127 This is particularly needed for containers where the member arrays will report "container=/dev/md/foo" and we want the container to have the same name. Signed-off-by: NeilBrown <neilb@suse.de>
* | Support new raid6 layouts needed for DDFNeilBrown2009-03-091-1/+8
| | | | | | | | | | | | | | | | DDF raid6 layouts are subtly different from the standard 'md' layouts. From 2.6.30 the kernel knows about these. Teach mdadm about them, and also allow 'ddf' to set an appropriate default. Signed-off-by: NeilBrown <neilb@suse.de>
* | Incremental: honor --no-degraded to delay assemblyDan Williams2009-02-241-0/+1
| | | | | | | | | | | | | | | | | | | | Currently Incremental_container is being called after adding each disk. In the imsm case where spares are not tracked in the raid_disks field we can use --no-degraded to block premature assembly. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into scratch-3.0NeilBrown2009-01-081-0/+2
|\| | | | | | | | | | | | | Conflicts: Assemble.c config.c
| * Free mdstat data structures properly.NeilBrown2009-01-081-0/+2
| | | | | | | | | | | | | | In one case we called 'free' instead of 'mdstat_free'. In others we didn't free at all. Signed-off-by: NeilBrown <neilb@suse.de>
| * Allow --config in --incremental mode.NeilBrown2008-12-011-0/+1
| |
* | introduce --detail-platform to display platform raid capabilitiesDan Williams2008-12-081-0/+4
| | | | | | | | | | | | | | Metadata formats like imsm work in concert with platform firmware and hardware, so provide a way for mdadm to display this info to the user. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Support --wait-clean --scanDan Williams2008-11-271-4/+12
| | | | | | | | | | | | | | Its cumbersome to determine which devices to wait for in a system shutdown script, so hook up --scan. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Assemble: don't auto-assemble if any arrays are listed in mdadm.confNeilBrown2008-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-assembly and planned assembly don't really work well together, it can be confusing. In particular in mkinitrd or similar creates an mdadm.conf to assemble a particular array, we shouldn't go assembling any other arrays as well. If you want auto assembly, you need to give mdadm a config file with no ARRAY lines. mdadm -Ascpartitions can do this. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: allow members of containers to be assembled and auto-assembled.NeilBrown2008-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | Try to treat members of containers much like other arrays for assembly. We still look through the list of devices for a match (it will be the container), then find the relevant 'info' and try to assemble the array. Signed-off-by: NeilBrown <neilb@suse.de>
* | Always set 'homehost' if not specified.NeilBrown2008-11-041-1/+1
| | | | | | | | | | The default for 'homehost' is now '<system>' rather than unspecified.
* | config: Don't require an array to have a device name.NeilBrown2008-11-041-10/+0
| | | | | | | | | | | | | | | | | | | | i.e. in mdadm.conf you can have a line like ARRAY uuid=whatever and it will use auto-name-generation to give a name to the array at assemble-time. The is different from blind auto-assembly in that the array will be treated as 'local'.
* | Delay creation of array devices for assemble/build/createNeilBrown2008-11-041-42/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | We will shortly be feeding more information into the process of creating array devices, so delay the creation. Still open them early if the device already exists. This involves making sure the autof flag is in the right place so that it can be found at creation time. Also, Assemble, Build, and Create now always close 'mdfd'. Signed-off-by: NeilBrown <neilb@suse.de>
* | Avoid opening md device twice in particular '--assemble' instance.NeilBrown2008-11-041-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When mdadm --assemble /dev/whatever is given, mdadm will treat it as though '--scan' were given, even though it wasn't. In this case, the code opens /dev/whatever twice, which is pointless. We already know /dev/whatever is open at this point, so remove the 'open' and the tests, and make sure it is always closed afterwards. Signed-off-by: NeilBrown <neilb@suse.de>
* | Introduce new open_mddev which just does an open.NeilBrown2008-11-041-4/+5
| | | | | | | | | | | | | | Some cases we aren't interested in creating the mddev, just opening it. Make those more explicit. Signed-off-by: NeilBrown <neilb@suse.de>
* | Rename open_mddev to create_mddevNeilBrown2008-11-041-6/+6
| | | | | | | | | | | | | | This reflect that fact that more often than not it is creating things in /dev, and allows for a new open_mddev which does just that. Signed-off-by: NeilBrown <neilb@suse.de>
* | Initialise ->container and ->member properly.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | Now that we are using these values, we need to initialise them properly. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-271-15/+6
|\| | | | | | | | | | | | | Conflicts: Create.c Manage.c