summaryrefslogtreecommitdiffstats
path: root/ReadMe.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mdadm: Add --write-zeros option for CreateLogan Gunthorpe2023-03-131-0/+2
| | | | | | | | | | | | | | | | | | | | | Add the --write-zeros option for Create which will send a write zeros request to all the disks before assembling the array. After zeroing the array, the disks will be in a known clean state and the initial sync may be skipped. Writing zeroes is best used when there is a hardware offload method to zero the data. But even still, zeroing can take several minutes on a large device. Because of this, all disks are zeroed in parallel using their own forked process and a message is printed to the user. The main process will proceed only after all the zeroing processes have completed successfully. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Acked-by: Kinga Tanska <kinga.tanska@linux.intel.com> Reviewed-by: Xiao Ni <xni@redhat.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* mdadm: Add option validation for --update-subarrayMateusz Kusiak2023-01-041-0/+31
| | | | | | | | | Subset of options available for "--update" is not same as for "--update-subarray". Define maps and enum for update options and use them instead of direct comparisons. Add proper error message. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* ReadMe: fix command-line helpMariusz Tkaczyk2022-09-161-1/+1
| | | | | | | | | | Make command-line help consistent with manual page. Copied from Debian. Cc: Felix Lechner <felix.lechner@lease-up.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: remove symlink optionMariusz Tkaczyk2022-08-231-1/+0
| | | | | | | The option is not used. Remove it from code. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: Fix mdadm -r remove option regressionLogan Gunthorpe2022-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit noted below globally adds a parameter to the -r option but missed the fact that -r is used for another purpose: --remove. After that commit, a command such as: mdadm /dev/md0 -r /dev/loop0 will do nothing seeing the device parameter will be consumed as a argument to the -r option; thus, there will only be one device seen one the command line, devs_found will only be 1 and nothing will happen. This caused the 01r5integ and 01raid6integ tests to hang indefinitely as mdadm did not remove the failed device. With the device not removed, it would not be readded. Then the loop waiting for the array status to change would loop forever. This commit was recently reverted, but the legitimate fix for the monitor operations was still not fixed. So add specific monitor short ops to re-fix the --monitor -r option. Fixes: 546047688e1c ("mdadm: fix coredump of mdadm --monitor -r") Fixes: 190dc029b141 ("Revert "mdadm: fix coredump of mdadm --monitor -r"") Cc: Wu Guanghao <wuguanghao3@huawei.com> Cc: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* Revert "mdadm: fix coredump of mdadm --monitor -r"Nigel Croxon2022-06-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 546047688e1c64638f462147c755b58119cabdc8. The change from commit mdadm: fix coredump of mdadm --monitor -r broke the printing of the return message when passing -r to mdadm --manage, the removal of a device from an array. If the current code reverts this commit, both issues are still fixed. The original problem reported that the fix tried to address was: The --monitor -r option requires a parameter, otherwise a null pointer will be manipulated when converting to integer data, and a core dump will appear. The original problem was really fixed with: 60815698c0a Refactor parse_num and use it to parse optarg. Which added a check for NULL in 'optarg' before moving it to the 'increments' variable. New issue: When trying to remove a device using the short argument -r, instead of the long argument --remove, the output is empty. The problem started when commit 546047688e1c was added. Steps to Reproduce: 1. create/assemble /dev/md0 device 2. mdadm --manage /dev/md0 -r /dev/vdxx Actual results: Nothing, empty output, nothing happens, the device is still connected to the array. The output should have stated "mdadm: hot remove failed for /dev/vdxx: Device or resource busy", if the device was still active. Or it should remove the device and print a message: mdadm: set /dev/vdd faulty in /dev/md0 mdadm: hot removed /dev/vdd from /dev/md0 The following commit should be reverted as it breaks mdadm --manage -r. commit 546047688e1c64638f462147c755b58119cabdc8 Author: Wu Guanghao <wuguanghao3@huawei.com> Date: Mon Aug 16 15:24:51 2021 +0800 mdadm: fix coredump of mdadm --monitor -r -Nigel Signed-off-by: Nigel Croxon <ncroxon@redhat.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: Update ReadMeLukasz Florczak2022-04-051-5/+6
| | | | | | | | | | Instead of hardcoded config file path give reference to config manual. Add missing monitordelay and homecluster parameters. Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.2mdadm-4.2Jes Sorensen2021-12-301-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.2-rc3mdadm-4.2-rc3Jes Sorensen2021-11-041-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: fix coredump of mdadm --monitor -rWu Guanghao2021-10-081-3/+3
| | | | | | | | | | | The --monitor -r option requires a parameter, otherwise a null pointer will be manipulated when converting to integer data, and a coredump will appear. Segmentation fault (core dumped) Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com> Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.2-rc2mdadm-4.2-rc2Jes Sorensen2021-08-021-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.2-rc1mdadm-4.2-rc1Jes Sorensen2021-04-141-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Makefile: add EXTRAVERSION supportTkaczyk Mariusz2020-05-151-1/+4
| | | | | | | | | Add optional EXTRAVERSION parameter to Makefile and allow to mark version by user friendly label. It might be useful when creating custom spins of mdadm, or labeling some instance in between major releases. Signed-off-by: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: add --no-devices to avoid component devices detail informationColy Li2019-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When people assemble a md raid device with a large number of component deivces (e.g. 1500 DASD disks), the raid device detail information generated by 'mdadm --detail --export $devnode' is very large. It is because the detail information contains information of all the component disks (even the missing/failed ones). In such condition, when udev-md-raid-arrays.rules is triggered and internally calls "mdadm --detail --no-devices --export $devnode", user may observe systemd error message ""invalid message length". It is because the following on-stack raw message buffer in systemd code is not big enough, systemd/src/libudev/libudev-monitor.c _public_ struct udev_device *udev_monito ... struct ucred *cred; union { struct udev_monitor_netlink_header nlh; char raw[8192]; } buf; Even change size of raw[] from 8KB to larger size, it may still be not enough for detail message of a md raid device with much larger number of component devices. To fix this problem, an extra option '--no-devices' is added (the original idea is proposed by Neil Brown). When printing detailed information of a md raid device, if '--no-devices' is specified, then all component devices information will not be printed, then the output message size can be restricted to a small number, even with the systemd only has 8KB on-disk raw buffer, the md raid array udev rules can work correctly without failure message. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.1mdadm-4.1Jes Sorensen2018-10-011-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Release mdadm-4.1-rc2mdadm-4.1-rc2Jes Sorensen2018-08-031-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: 4.1-rc1mdadm-4.1-rc1Jes Sorensen2018-03-221-2/+2
| | | | Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* mdadm: fixes some trivial typos in commentsZhilong Liu2017-10-021-1/+1
| | | | | | | fix some trivial typos in comments. Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Grow: support consistency policy changeArtur Paszkiewicz2017-03-291-22/+24
| | | | | | | | | | | Extend the --consistency-policy parameter to work also in Grow mode. Using it changes the currently active consistency policy in the kernel driver and updates the metadata to make this change permanent. Currently this supports only changing between "ppl" and "resync" policies, that is enabling or disabling PPL at runtime. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
* Generic support for --consistency-policy and PPLArtur Paszkiewicz2017-03-291-24/+27
| | | | | | | | | | | | | Add a new parameter to mdadm: --consistency-policy=. It determines how the array maintains consistency in case of unexpected shutdown. This maps to the md sysfs attribute 'consistency_policy'. It can be used to create a raid5 array using PPL. Add the necessary plumbing to pass this option to metadata handlers. The write journal and bitmap functionalities are treated as different policies, which are implicitly selected when using --write-journal or --bitmap options. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
* Release mdadm-4.0mdadm-4.0Jes Sorensen2017-01-091-2/+5
| | | | | | My first release! Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
* Add failfast support.NeilBrown2016-11-281-0/+2
| | | | | | | | | | | | | Allow per-device "failfast" flag to be set when creating an array or adding devices to an array. When re-adding a device which had the failfast flag, it can be removed using --nofailfast. failfast status is printed in --detail and --examine output. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
* Release mdadm-3.4mdadm-3.4NeilBrown2016-01-281-3/+3
| | | | | | My last release! Signed-off-by: NeilBrown <neilb@suse.com>
* recreate journal in mdadmSong Liu2015-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This patch tries recreates missing/faulty journal in mdadm. Example: ./mdadm --fail /dev/md1 /dev/sdb2 mdadm: set /dev/sdb2 faulty in /dev/md1 ./mdadm --stop /dev/md1 mdadm: stopped /dev/md1 ./mdadm -A --scan --force mdadm: Journal is missing or stale, starting array read only. mdadm: /dev/md/1 has been started with 15 drives. ./mdadm --add-journal /dev/md1 /dev/sdb2 mdadm: added /dev/sdb2 Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
* Add help message and man entry for --write-journalSong Liu2015-10-191-0/+1
| | | | | | Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
* Enable create array with write journal (--write-journal DEVICE).Song Liu2015-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | Specify the write journal device with --write-journal DEVICE ./mdadm --create -f /dev/md0 --assume-clean -c 32 --raid-devices=4 --level=5 /dev/sd[c-f] --write-journal /dev/sdb1 mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. Only one journal device is allowed. If multiple --write-journal are given, mdadm will use the first and ignore others ./mdadm --create -f /dev/md0 --assume-clean -c 32 --raid-devices=4 --level=5 /dev/sd[c-f] --write-journal /dev/sdb1 --write-journal /dev/sdx mdadm: Please specify only one journal device for the array. mdadm: Ignoring --write-journal /dev/sdx... mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
* Merge branch 'mdadm-3.3.x'NeilBrown2015-08-031-2/+2
|\
| * Release mdadm-3.3.4mdadm-3.3.4NeilBrown2015-08-031-2/+2
| | | | | | | | | | | | Important bugfix release. Signed-off-by: NeilBrown <neilb@suse.com>
* | Merge branch 'cluster'NeilBrown2015-07-271-0/+3
|\ \ | |/ |/| | | | | | | Now that 3.3.3 is out, it is time to include the cluster-support code. Signed-off-by: NeilBrown <neilb@suse.com>
| * mdadm: change the num of cluster nodeGuoqing Jiang2015-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This extends nodes option for assemble mode, make the num of cluster node could be change by user. Before that, it is necessary to ensure there are enough space for those nodes, calc_bitmap_size is introduced to calculate the bitmap size of each node. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * Add a new clustered diskGuoqing Jiang2015-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A clustered disk is added by the traditional --add sequence. However, other nodes need to acknowledge that they can "see" the device. This is done by --cluster-confirm: --cluster-confirm SLOTNUM:/dev/whatever (if disk is found) or --cluster-confirm SLOTNUM:missing (if disk is not found) The node initiating the --add, has the disk state tagged with MD_DISK_CLUSTER_ADD and the one confirming tag the disk with MD_DISK_CANDIDATE. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * Set home-cluster while creating an arrayGuoqing Jiang2015-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The home-cluster is stored in the bitmap super block of the array. The device can be assembled on a cluster with the cluster name same as the one recorded in the bitmap. If home-cluster is not specified, this is auto-detected using dlopen corosync cmap library. neilb: allow code to compile when corosync-devel is not installed. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * Add nodes option while creating mdGuoqing Jiang2015-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | Specifies the maximum number of nodes in the cluster that may use this device simultaneously. This is equivalent to the number of bitmaps created in the internal superblock (patches to follow). Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Release mdadm-3.3.3mdadm-3.3.3NeilBrown2015-07-241-3/+3
|/ | | | Signed-off-by: NeilBrown <neilb@suse.com>
* Change way of printing name of a processPawel Baldysiak2015-02-121-1/+1
| | | | | | | | | | | | | Sometimes mdadm prints messages with wrong name "mdmon", and vice versa. This patch solves this problem by changing method of determining process name. Now "Name" will be set in const at start of a program, previously was hardcoded as #define. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Release mdadm-3.3.2mdadm-3.3.2NeilBrown2014-08-211-2/+2
| | | | | | Minor bugfix/stability release. Signed-off-by: NeilBrown <neilb@suse.de>
* Release mdadm-3.3.1mdadm-3.3.1NeilBrown2014-06-051-3/+3
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* MISC: add --action option to set or abort check/repair.NeilBrown2014-05-221-0/+2
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Add support for --add-spareNeilBrown2013-10-311-0/+1
| | | | | | | | | | --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>
* Release mdadm-3.3mdadm-3.3NeilBrown2013-09-031-3/+3
| | | | | | (and various cosmetic fixes) Signed-off-by: NeilBrown <neilb@suse.de>
* Change version to 3.3-rc2mdadm-3.3-rc2NeilBrown2013-07-251-2/+2
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Makefile/version: use version/date from .git if possible.NeilBrown2013-06-251-1/+7
| | | | | | | | If being built from a git tree, use the version and date information from the top commit rather than the hard-coded values. Signed-off-by: NeilBrown <neilb@suse.de>
* Add --dump / --restore functionality.NeilBrown2013-05-161-0/+3
| | | | | | | | 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>
* Remove --offroot argument and default to always setting argv[0] to @Jes Sorensen2013-02-051-4/+0
| | | | | | | | | | | 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-051-0/+3
| | | | | | 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-231-0/+7
| | | | | | | | | --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>
* Replace a lot of leading spaces with tabs.NeilBrown2012-10-101-2/+2
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Add --data-offset flag for Create and GrowNeilBrown2012-10-041-0/+4
| | | | | | | | | | 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>
* imsm: Add --export option for --detail-platformMaciej Naruszewicz2012-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Assemble: allow arrays to be assembled read-only.NeilBrown2012-07-091-0/+1
| | | | | | The option was there, but never used. Signed-off-by: NeilBrown <neilb@suse.de>