summaryrefslogtreecommitdiff
path: root/mdadm.c
Commit message (Collapse)AuthorAge
* MISC: add --action option to set or abort check/repair.NeilBrown2014-05-22
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: improve support for "DEVICE" based restriction in mdadm.confNeilBrown2013-12-03
| | | | | | | | | | | | | | | | | --incremental currently fails if the device name passed does not textually match the names permitted by the DEVICE line in mdadm.conf. This is problematic when "mdadm -I" is run by udev as the name given can be a temp name. This patch makes two improvements: 1/ We generate a list of all existing devices that match the names in mdadm.conf, and allow rdev based matching 2/ We allows extra aliases to be provided on the command line, and perform textual matching on those. This is particularly suitable for udev usages as ${DEVLINKS} can be provided even though the links make not yet be created. Signed-off-by: NeilBrown <neilb@suse.de>
* Add support for --add-spareNeilBrown2013-10-31
| | | | | | | | | | --add-spare is like --add, but a --re-add is never attempted. So it is equivalent to two separate commands: --zero-metadata --add Signed-off-by: NeilBrown <neilb@suse.de>
* Give error if --incremental --scan also has a device name given.NeilBrown2013-09-15
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Make -IRs and --run work properly for containers.NeilBrown2013-09-13
| | | | | | | | We really need to make sure assemble_container_content() gets called to finished the assembly of these. Reported-by: Francis Moreau <francis.moro@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Release mdadm-3.3NeilBrown2013-09-03
| | | | | | (and various cosmetic fixes) Signed-off-by: NeilBrown <neilb@suse.de>
* Change "mdadm --run" to use the same code as "mdadm --IRs".NeilBrown2013-08-26
| | | | | | | | | | | Current "mdadm --run /dev/mdX" will not handle external metadata properly. mdmon won't be started etc. So use the code from "mdadm -IRs" instead - that already does all the right things. Reported-by: Francis Moreau <francis.moro@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't lie to systemd about mdadm's status.NeilBrown2013-08-01
| | | | | | | | | | | | Telling systemd that mdadm was started from the initrd is often a lie and never necessary. Now that the reshape monitoring thread handles SIGTERM gracefully it is OK for system to kill and mdadm that it finds running. mdmon still have a bit of a question mark over it so I won't remove the '@' from there just yet. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: allow "--add" with "--grow --level=??"NeilBrown2013-06-24
| | | | | | | This is useful for reshaping a RAID0 to a higher level. The recovery will happen at the same time as the reshape. Signed-off-by: NeilBrown <neilb@suse.de>
* test/00names: use appropriate mdadm.confNeilBrown2013-06-24
| | | | | | | Using non-numeric names needs an mdadm.conf setting, so make sure we have one. Signed-off-by: NeilBrown <neilb@suse.de>
* Remove lots of unnecessary white space.NeilBrown2013-06-19
| | | | | | | Now that I am using white-space mode in Emacs I can see all of this, and I don't like it :-) Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: allow "--stop" on kernel names.NeilBrown2013-06-19
| | | | | | | | | e.g. mdadm --stop md4 This works even if udev has become confused or killed. Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: split Manage_runstop into Manage_run and Manage_stopNeilBrown2013-06-19
| | | | | | | The two branches have virtually nothing in common, so it is simpler if they are separate. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: allow --update=revert-reshapeNeilBrown2013-05-28
| | | | This will cause a reshape to start going backwards.
* Assemble: --update=metadata converts v0.90 to v1.0NeilBrown2013-05-28
| | | | | | | | | | This allows the smooth conversion of legacy 0.90 arrays to 1.0 metadata. Old metadata is likely to remain but will be ignored. It can be removed with mdadm --zero-superblock --metadata=0.90 /dev/whatever Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: allow a reshape which only changes --data-offsetNeilBrown2013-05-22
| | | | | | Sometimes, that is all we want to do. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: --backup-file and --data-offset are incompatible.NeilBrown2013-05-22
| | | | | | | So report if both are given, and if --backup-file is given, don't try to update data-offset. Signed-off-by: NeilBrown <neilb@suse.de>
* Change some fprintf(stderrs to cont_err()NeilBrown2013-05-21
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change some "fprintf(stderr,"s to pr_err.NeilBrown2013-05-21
| | | | | | They just keep slipping in.. Signed-off-by: NeilBrown <neilb@suse.de>
* Add --dump / --restore functionality.NeilBrown2013-05-16
| | | | | | | | This allows the metadata on a device to be saved and later restored. This can be useful before experimenting on an array that is misbehaving. Suggested-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* misc_scan: don't trust the mapping file too much for device names.NeilBrown2013-05-13
| | | | | | | | | | | | misc_scan assumes that any device name found in the 'mapping' file is usable. Usually it is but sometimes not, such as for inactive devices. Depending on it isn't really robust, when a name is found, check that it exists. If not, fall back on map_dev. This will allow "--detail --scan" to notice inactive devices. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: default to bitmap=internal for large arrays.NeilBrown2013-03-05
| | | | | | | | Here, "large" means components are 100G or more. It is usually beneficial to have write-intent bitmaps on such arrays. They can be suppressed with --bitmap=none Signed-off-by: NeilBrown <neilb@suse.de>
* Discard devnum in favour of devnmNeilBrown2013-02-21
| | | | | | | | | | | | | | We widely use a "devnum" which is 0 or +ve for md%d devices and -ve for md_d%d devices. But I want to be able to use md_%s device names. So get rid of devnum (a number) and use devnm (a 32char string). eg. md0 md_d2 md_home Signed-off-by: NeilBrown <neilb@suse.de>
* Remove --offroot argument and default to always setting argv[0] to @Jes Sorensen2013-02-05
| | | | | | | | | | | We still allow --offroot to be given - for compatibility with scripts - but ignore it. The whole point of --offroot is to get systemd to not auto-kill mdmon, and we always want that. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* MISC: Add --examine-badblocks optionNeilBrown2012-12-05
| | | | | | This will list the contents of the bad-blocks log, if one is present. Signed-off-by: NeilBrown <neilb@suse.de>
* Add support for --replace and --withNeilBrown2012-10-23
| | | | | | | | | --replace can be used to replace a device without completely failing it. Once the replacement completes the device will be failed. --with can indicate which of several spares to use. Signed-off-by: NeilBrown <neilb@suse.de>
* Allow data-offset to be specified per-device for createNeilBrown2012-10-04
| | | | | | | | | mdadm --create /dev/md0 .... /dev/sda1:1024 /dev/sdb1:2048 ... The size is in K unless a suffix: K M G is given. The suffix 's' means sectors. Signed-off-by: NeilBrown <neilb@suse.de>
* Add --data-offset flag for Create and GrowNeilBrown2012-10-04
| | | | | | | | | | This can be used to over-ride the automatic assignment of data offset. For --create, it is useful to re-create old arrays where different defaults applied. For --grow it may be able to force a reshape in the reverse direction. Signed-off-by: NeilBrown <neilb@suse.de>
* Allow parse_size to return 0.NeilBrown2012-10-04
| | | | | | | | | | | We will shortly introduce --data-offset= which is allowed to be zero. We will want to use parse_size() so it needs to be able to return '0' without it being an error. So define INVALID_SECTORS to be an impossible value (currently '1') and return and test for it consistently. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Allow to specify controller for --detail-platform.Maciej Naruszewicz2012-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually, 'mdadm --detail-platform -e imsm' scans all the controllers looking for IMSM capabilities. This patch provides the possibility to specify a controller to scan, enabling custom usage by other processes - especially with the --export switch. $ mdadm --detail-platform Platform : Intel(R) Matrix Storage Manager Version : 9.5.0.1037 RAID Levels : raid0 raid1 raid10 raid5 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : not supported Max Disks : 7 Max Volumes : 2 per array, 4 per controller I/O Controller : /sys/devices/pci0000:00/0000:00:1f.2 (SATA) $ mdadm --detail-platform /sys/devices/pci0000:00/0000:00:1f.2 Platform : Intel(R) Matrix Storage Manager Version : 9.5.0.1037 RAID Levels : raid0 raid1 raid10 raid5 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : not supported Max Disks : 7 Max Volumes : 2 per array, 4 per controller I/O Controller : /sys/devices/pci0000:00/0000:00:1f.2 (SATA) $ mdadm --detail-platform /sys/devices/pci0000:00/0000:00:1f.2 --export MD_FIRMWARE_TYPE=imsm IMSM_VERSION=9.5.0.1037 IMSM_SUPPORTED_RAID_LEVELS=raid0 raid1 raid10 raid5 IMSM_SUPPORTED_CHUNK_SIZES=4k 8k 16k 32k 64k 128k IMSM_2TB_VOLUMES=yes IMSM_2TB_DISKS=no IMSM_MAX_DISKS=7 IMSM_MAX_VOLUMES_PER_ARRAY=2 IMSM_MAX_VOLUMES_PER_CONTROLLER=4 $ mdadm --detail-platform /sys/devices/pci0000:00/0000:00:1f.0 # This isn't an IMSM-capable controller mdadm: no active Intel(R) RAID controller found under /sys/devices/pci0000:00/0000:00:1f.0 Signed-off-by: Maciej Naruszewicz <maciej.naruszewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Allow --update to add or remove space for a bad block list.NeilBrown2012-10-03
| | | | | | | | --update=bbl will add a bad block list to each device. --update=no-bblk will remove the bad block list providing that it is empty. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Add --export option for --detail-platformMaciej Naruszewicz2012-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option will provide most of information we can get via mdadm --detail-platform [-e format] in the key=value format. Example output: $ mdadm --detail-platform Platform : Intel(R) Matrix Storage Manager Version : 9.5.0.1037 RAID Levels : raid0 raid1 raid10 raid5 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : not supported Max Disks : 7 Max Volumes : 2 per array, 4 per controller I/O Controller : /sys/devices/pci0000:00/0000:00:1f.2 (SATA) $ mdadm --detail-platform --export MD_FIRMWARE_TYPE=imsm IMSM_VERSION=9.5.0.1037 IMSM_SUPPORTED_RAID_LEVELS=raid0 raid1 raid10 raid5 IMSM_SUPPORTED_CHUNK_SIZES=4k 8k 16k 32k 64k 128k IMSM_2TB_VOLUMES=yes IMSM_2TB_DISKS=no IMSM_MAX_DISKS=7 IMSM_MAX_VOLUMES_PER_ARRAY=2 IMSM_MAX_VOLUMES_PER_CONTROLLER=4 Signed-off-by: Maciej Naruszewicz <maciej.naruszewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Use new struct context and struct shape for Grow_addbitmapNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Use new struct context and struct shape in Grow_reshapeNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Use new 'struct shape' to pass args to CreateNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Use new 'struct shape' to pass args to BuildNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Create new 'struct shape' to pass around array details.NeilBrown2012-07-09
| | | | | | | This collects to together many of the args given to create/build/grow Signed-off-by: NeilBrown <neilb@suse.de>
* change array_size to be unsigned and use the new MAX_SIZENeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change the values for "max size" from -1 to 1.NeilBrown2012-07-09
| | | | | | | | Both are impossible, and '1' allows size to be unsigned, which is neater. Also #define MAX_SIZE to be '1' to make it all more explicit. Signed-off-by: NeilBrown <neilb@suse.de>
* Change Incremental and related functions to take struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change Monitor to take a struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change Detail and misc_scan to take a struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* change Examine to take a struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Examine: split 'verbose' out from 'brief'.NeilBrown2012-07-09
| | | | | | | | | | The value of 'verbose' is sometimes mixed into 'brief', particularly for Examine. This is messy and confusing. So keep them separate. 'brief' still gets assumed when 'scan' is set, unless we are very verbose. Signed-off-by: NeilBrown <neilb@suse.de>
* Change Create to take a struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change Build to take a struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Change misc_list to take struct contextNeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Convert Assemble() to take a context rather than a list of options.NeilBrown2012-07-09
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Discard 'quiet' context variable.NeilBrown2012-07-09
| | | | | | Just use negative verbose, now that we are ready for that. Signed-off-by: NeilBrown <neilb@suse.de>
* Convert 'quiet' to 'not verbose' in various places.NeilBrown2012-07-09
| | | | | | | | If we change some functions to accept 'verbose', where <0 means to be quiet, in place of 'quiet', then we will be able to merge 'quiet' and 'verbose' together for simplicity. Signed-off-by: NeilBrown <neilb@suse.de>