Status: ok Improve messages when starting an array without all devices. Instead of required the array to be full, we only require it has as many active devices as last time. ----------- Diffstat output ------------ ./Assemble.c | 39 +++++++++++++++++++++++++++++++++------ ./ChangeLog | 3 +++ 2 files changed, 36 insertions(+), 6 deletions(-) diff ./Assemble.c~current~ ./Assemble.c --- ./Assemble.c~current~ 2003-07-29 10:11:21.000000000 +1000 +++ ./Assemble.c 2003-07-29 10:11:17.000000000 +1000 @@ -109,6 +109,7 @@ int Assemble(char *mddev, int mdfd, int *best = NULL; /* indexed by raid_disk */ int bestcnt = 0; int devcnt = 0, okcnt, sparecnt; + int req_cnt; int i; int most_recent = 0; int chosen_drive; @@ -365,8 +366,11 @@ int Assemble(char *mddev, int mdfd, * as they don't make sense */ if (first_super.level != -4) - if (!(devices[j].state & (1<= devices[most_recent].events) { devices[j].uptodate = 1; @@ -535,6 +539,17 @@ This doesnt work yet change = 0; } + /* count number of in-sync devices according to the superblock. + * We must have this number to start the array without -s or -R + */ + req_cnt = 0; + for (i=0; i= req_cnt || start_partial_ok) + ))) { if (ioctl(mdfd, RUN_ARRAY, NULL)==0) { fprintf(stderr, Name ": %s has been started with %d drive%s", mddev, okcnt, okcnt==1?"":"s"); + if (okcnt < first_super.raid_disks) + fprintf(stderr, " (out of %d)", first_super.raid_disks); if (sparecnt) fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s"); fprintf(stderr, ".\n"); @@ -596,8 +613,18 @@ This doesnt work yet mddev, okcnt, okcnt==1?"":"s"); return 0; } - fprintf(stderr, Name ": %s assembled from %d drive%s - not enough to start it (use --run to insist).\n", - mddev, okcnt, okcnt==1?"":"s"); + fprintf(stderr, Name ": %s assembled from %d drive%s", mddev, okcnt, okcnt==1?"":"s"); + if (sparecnt) + fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s"); + if (!enough(first_super.level, first_super.raid_disks, okcnt)) + fprintf(stderr, " - not enough to start the array.\n"); + else { + if (req_cnt == first_super.raid_disks) + fprintf(stderr, " - need all %d to start it", req_cnt); + else + fprintf(stderr, " - need %d of %d to start", req_cnt, first_super.raid_disks); + fprintf(stderr, " (use --run to insist).\n"); + } return 1; } else { /* The "chosen_drive" is a good choice, and if necessary, the superblock has diff ./ChangeLog~current~ ./ChangeLog --- ./ChangeLog~current~ 2003-07-29 10:11:21.000000000 +1000 +++ ./ChangeLog 2003-07-29 10:11:21.000000000 +1000 @@ -19,6 +19,9 @@ Changes Prior to this release - Ignore chunksize if raid1 or multipath. - Explicit statement in man page that raid-disks cannot be changed after array is created. + - Improve message when attempting to start an array with + insufficient devices. Instead of required the array to be full, + we only require it has as many active devices as last time. Changes Prior to 1.2.0 release - Fix bug where --daemonise required an argument.