summaryrefslogtreecommitdiffstats
path: root/mdadm.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Allow WRITEMOSTLY to be cleared on --readd using --readwrite.NeilBrown2008-10-251-15/+6
| | | | | | | | | | | | | | | | Previously it was possible to set the WRITEMOSTLY flag when adding a device to an array, but not to clear the flag when re-adding. This is now possible with --readwrite. Signed-off-by: NeilBrown <neilb@suse.de>
* | quiet WaitClean()Dan Williams2008-10-151-1/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Allow --config in --incremental mode.NeilBrown2008-09-181-0/+1
| |
* | 'mdadm --wait-clean' wait for array to be marked cleanDan Williams2008-09-151-0/+4
| | | | | | | | | | | | | | | | | | For use in distro shutdown scripts with a RAID root file system. Returns immediately if the array is 'readonly', or not an externally managed array. It is up to the distro's scripts to make sure no new writes hit the device after this returns 'true'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into from-stableNeilBrown2008-08-071-2/+2
|\| | | | | | | | | | | | | Conflicts: Create.c Manage.c
| * Cosmetic cleanup of some messages.NeilBrown2008-08-011-2/+2
| | | | | | | | | | | | | | | | e.g. --raid-disks is preferred over --raid-devices. Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net> Signed-off-by: NeilBrown <neilb@suse.de>
* | Stop managed arrays more carefully.Neil Brown2008-07-181-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | If an array is being managed by mdmon, then just write "inactive" to stop it, and let mdmon do the final "clear". This makes sure mdmon has a chance to read the final state and update the metadata properly. After writing "inactive" with use "ping_monitor" to synchronise with mdadm, then STOP the array just in case it is still running, else we will get into an infinite loop in "mdadm -Ss". Signed-off-by: Neil Brown <neilb@suse.de>
* | Improve shutdown for container-based arrays.Neil Brown2008-07-121-0/+10
| | | | | | | | | | | | | | 1/ close a race where multiple arrays disappear at once and monitor isn't woken up to find out that the last one has gone. 2/ "mdadm -Ss" needs to pause briefly for mdmon to exit.
* | Merge branch 'master' into devel-3.0Neil Brown2008-06-191-2/+4
|\| | | | | | | | | | | Conflicts: Makefile
| * Fix autoassemble for stack arrays.Neil Brown2008-05-201-2/+4
| | | | | | | | | | | | | | | | If you have stacked arrays, then mdadm -As --homehost=fred should work but doesn't. It gets into an infinite loop! So write some tests, and fix the bugs.
* | Change write_init_super to be called only once.Neil Brown2008-05-151-1/+2
|/ | | | | | | | | | | | | | | | | | | | | The current model for creating arrays involves writing a superblock to each device in the array. With containers (as with DDF), that model doesn't work. Every device in the container may need to be updated for an array made from just some the devices in a container. So instead of calling write_init_super for each device, we call it once for the array and have it iterate over all the devices in the array. To help with this, ->add_to_super now passes in an 'fd' and name for the device. These get saved for use by write_init_super. So add_to_super takes ownership of the fd, and write_init_super will close it. This information is stored in the new 'info' field of supertype. As part of this, write_init_super now removes any old traces of raid metadata rather than doing this in common code.
* Set LOG_PID for syslogHans Lambermont2008-05-121-1/+1
| | | | From: Hans Lambermont <hans.lambermont@newtec.eu>
* add --export option to --examineKay Sievers2008-05-061-1/+3
| | | | | | | From: Kay Sievers <kay.sievers@vrfy.org> Cc: David Zeuthen <david@fubar.dk> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* let '-a' be specified for Incremental modeDan Williams2008-05-051-1/+3
| | | | | | From: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-141-14/+14
|
* Reject '--bitmap none' for build and create.Neil Brown2007-07-231-1/+7
| | | | | We don't want to create a file called 'none', and it isn't needed, so just reject it.
* Allow "--write-behind=" to be done in grow mode.Ian Dall2007-07-091-0/+1
| | | | | | | | | From: Ian Dall <ian@beware.dropbear.id.au> I have a small patch to mdadm which allows the write-behind amount to be set a array grow time (instead of currently only at grow or create time). I have tested this fairly extensively on some arrays built out of loop back devices, and once on a real live array.
* Fix parsing of "-a" in various contexts.Doug Ledford2007-07-091-3/+5
| | | | | | | | | | | | From: Doug Ledford <dledford@redhat.com> This one fixes a bug where once manage mode is set, the -a short option is no longer parsed correctly (true of grow mode as well). This happens because when you switch the short opts to the bitmap_auto version, it specifies that the argument must follow a, yet the loop expects to get an undecorated option and parse it as the disk dev instead of trying to parse optarg. So, create a new short opt array that is used for manage and grow that doesn't list a as having an argument.
* Improve error message for adding bitmap to a level that cannot support it.Neil Brown2007-05-211-0/+10
| | | | Also give error on --build if no devices given.
* Add --auto-detect for in-kernel autodetect.Neil Brown2007-05-211-0/+7
| | | | This is equivalent to raidautorun that some distros provide.
* Add --export option to --detail to use key=value pairs.Kay Sievers2007-05-081-2/+10
| | | | | | | | udev likes to get information about a device as key=value pairs so it can create disk/by-id links etc. So add --export flag which causes the output of --detail to easily parsable. From: Kay Sievers <kay.sievers@novell.com>
* Send help text to stdout rather than stderr.Neil Brown2007-05-081-9/+17
| | | | This helps with piping to a pager for example.
* Add new mode: --incrementalNeil Brown2006-12-211-0/+39
| | | | | --incremental allows arrays to be assembled one device at a time. This is expected to be used with udev.
* Support --uuid= with --create to choose your own UUID.Neil Brown2006-12-141-0/+2
|
* --wait or -W will wait for resync activity to finish on the given devices.Neil Brown2006-12-141-1/+4
|
* Support --update=devicesize for cases where the underlying device can change ↵Neil Brown2006-12-141-2/+4
| | | | size.
* Support --examine --brief --verbose properlyNeil Brown2006-10-231-0/+2
| | | | | Similar to -Esv, this combination should print out the 'devices=' line in the otherwise --breif output.
* Improve error message when wrong --update option is given.Neil Brown2006-10-231-1/+7
|
* Don't trigger and error on -As if all arrays are already started.Luca Berra2006-10-161-1/+1
| | | | | | | From: Luca Berra <bluca@comedia.it> Put another way, if we find any active arrays, then assume things are going as planned.