diff options
author | Neil Brown <neilb@suse.de> | 2005-12-05 05:54:48 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-12-05 05:54:48 +0000 |
commit | 47d79ef8e5bb59f2c3207d04806d3a823a733820 (patch) | |
tree | 03035e0446e36517d4578e0f5fc312ed64b24554 | |
parent | c06487ce2061b7acfe6bc40bea7ad12393b0e4c6 (diff) | |
download | mdadm-47d79ef8e5bb59f2c3207d04806d3a823a733820.tar.gz mdadm-47d79ef8e5bb59f2c3207d04806d3a823a733820.tar.xz mdadm-47d79ef8e5bb59f2c3207d04806d3a823a733820.zip |
Support --assume-clean for --create
Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | Create.c | 6 | ||||
-rw-r--r-- | mdadm.8 | 9 | ||||
-rw-r--r-- | mdadm.c | 2 | ||||
-rw-r--r-- | mdadm.h | 2 |
5 files changed, 13 insertions, 7 deletions
@@ -9,6 +9,7 @@ Changes Prior to this release 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 Changes Prior to 2.1 release - Fix assembling of raid10 array when devices are missing. @@ -35,7 +35,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, int chunk, int level, int layout, unsigned long size, int raiddisks, int sparedisks, char *name, int subdevs, mddev_dev_t devlist, - int runstop, int verbose, int force, + int runstop, int verbose, int force, int assume_clean, char *bitmap_file, int bitmap_chunk, int write_behind, int delay) { /* @@ -288,7 +288,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, * as missing, so that a reconstruct happens (faster than re-parity) * FIX: Can we do this for raid6 as well? */ - if (force == 0 && first_missing >= raiddisks) { + if (assume_clean==0 && force == 0 && first_missing >= raiddisks) { switch ( level ) { case 5: insert_point = raiddisks-1; @@ -318,6 +318,8 @@ int Create(struct supertype *st, char *mddev, int mdfd, (insert_point < raiddisks || first_missing < raiddisks) ) || ( level == 6 && missing_disks == 2) + || + assume_clean ) array.state = 1; /* clean, but one+ drive will be missing */ else @@ -476,9 +476,12 @@ which means to choose the largest size that fits on all current drives. .BR --assume-clean Tell .I mdadm -that the array pre-existed and is known to be clean. This is only -really useful for Building RAID1 array. Only use this if you really -know what you are doing. This is currently only supported for --build. +that the array pre-existed and is known to be clean. It can be useful +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 - while normally safe - is not +recommended. Use this ony if you really know what you are doing. .TP .BR -N ", " --name= @@ -1002,7 +1002,7 @@ int main(int argc, char *argv[]) rv = Create(ss, devlist->devname, mdfd, chunk, level, layout, size<0 ? 0 : size, raiddisks, sparedisks, ident.name, - devs_found-1, devlist->next, runstop, verbose-quiet, force, + devs_found-1, devlist->next, runstop, verbose-quiet, force, assume_clean, bitmap_file, bitmap_chunk, write_behind, delay); break; case MISC: @@ -250,7 +250,7 @@ extern int Create(struct supertype *st, char *mddev, int mdfd, int chunk, int level, int layout, unsigned long size, int raiddisks, int sparedisks, char *name, int subdevs, mddev_dev_t devlist, - int runstop, int verbose, int force, + int runstop, int verbose, int force, int assume_clean, char *bitmap_file, int bitmap_chunk, int write_behind, int delay); extern int Detail(char *dev, int brief, int test); |