Hi, I've just began using raidtools and I'm really impressed.. Anyway there were three not-really-important, but still annoying issues which disturbed me, and attached are patches which fix them (The patches are against v1.00.3): 1. raidtools-raidstart.patch: Adds some stuff to the --help screen a. Shows the different usage line for raidhotadd and friends b. Gives nicer help screen (also explains each flag, just like gnu ls) I know it's not THAT important, but I think it makes raidtools looks more professional, with the patch. I hope my texts are correct. I wasn't sure why there's an asterisk in the end of the usage line, so I left it there. 2. raidtools-Makefile.patch: renames the 'clean' target to 'distclean' and adds a standard 'clean' target, which only cleans the binaries and not the config.h and the others. First time I see that 'make clean' also cleans config.h. 3. raid-mkraid: gcc 3.2.3 complains about multi-line function arguments (in our case the warning message in printf()) being a deprecated feature, so I've made it the way gcc wants it, so this warning will be gone. If you have comments please reply.. - Oren
--- raidtools-1.00.3/mkraid.c 2003-01-15 10:58:25.000000000 +0200 +++ raidtools-1.00.3/mkraid.c.new 2003-02-18 23:10:32.000000000 +0200 @@ -171,31 +171,31 @@ if (old_force_flag && (func == mkraid)) { fprintf(stderr, -" - WARNING! - - NOTE: if you are recovering a double-disk error or some other failure mode - that made your array unrunnable but data is still intact then it's strongly - recommended to use the lsraid utility and to read the lsraid HOWTO. - - If your RAID array holds useful and not yet backed up data then --force - and the hot-add/hot-remove functionality should be used with extreme care! - If your /etc/raidtab file is not in sync with the real array configuration, - then --force might DESTROY ALL YOUR DATA. It's especially dangerous to use - -f if the array is in degraded mode. - - If your /etc/raidtab file matches the real layout of on-disk data then - recreating the array will not hurt your data, but be aware of the risks - of doing this anyway: freshly created RAID1 and RAID5 arrays do a full - resync of their mirror/parity blocks, which, if the raidtab is incorrect, - the resync will wipe out data irrecoverably. Also, if your array is in - degraded mode then the raidtab must match the degraded config exactly, - otherwise you'll get the same kind of data destruction during resync. - (see the failed-disk raidtab option.) You have been warned! - - [ If your array holds no data, or you have it all backed up, or if you - know precisely what you are doing and you still want to proceed then use - the --really-force (or -R) flag. ] +"\n\ + WARNING!\n\ +\n\ + NOTE: if you are recovering a double-disk error or some other failure mode\n\ + that made your array unrunnable but data is still intact then it's strongly\n\ + recommended to use the lsraid utility and to read the lsraid HOWTO.\n\ +\n\ + If your RAID array holds useful and not yet backed up data then --force\n\ + and the hot-add/hot-remove functionality should be used with extreme care!\n\ + If your /etc/raidtab file is not in sync with the real array configuration,\n\ + then --force might DESTROY ALL YOUR DATA. It's especially dangerous to use\n\ + -f if the array is in degraded mode.\n\ +\n\ + If your /etc/raidtab file matches the real layout of on-disk data then\n\ + recreating the array will not hurt your data, but be aware of the risks\n\ + of doing this anyway: freshly created RAID1 and RAID5 arrays do a full\n\ + resync of their mirror/parity blocks, which, if the raidtab is incorrect,\n\ + the resync will wipe out data irrecoverably. Also, if your array is in\n\ + degraded mode then the raidtab must match the degraded config exactly,\n\ + otherwise you'll get the same kind of data destruction during resync.\n\ + (see the failed-disk raidtab option.) You have been warned!\n\ +\n\ + [ If your array holds no data, or you have it all backed up, or if you\n\ + know precisely what you are doing and you still want to proceed then use\n\ + the --really-force (or -R) flag. ]\n\ "); return EXIT_FAILURE; }
--- raidtools-1.00.3/Makefile.in 2003-01-15 10:58:25.000000000 +0200 +++ raidtools-1.00.3/Makefile.in.new 2003-02-18 23:10:28.000000000 +0200 @@ -70,6 +70,9 @@ $(CC) -o $@ $< $(INTERNAL_LIBS) $(LDFLAGS) clean: + rm -f $(BINARIES) $(LINKS) *.o core *~ + +distclean: rm -f $(BINARIES) $(LINKS) *.o core *~ config.status config.cache Makefile config.h config.log realclean: clean
--- raidtools-1.00.3/raidstart.c 2003-01-15 10:58:25.000000000 +0200 +++ raidtools-1.00.3/raidstart.c.new 2003-02-18 23:10:43.000000000 +0200 @@ -31,7 +31,19 @@ void usage(unsigned char *arg) { - printf("usage: %s [--all] [--configfile] [--help] [--version] [-achv] </dev/md?>*\n", arg); + if (strcmp(arg, "raidsetfaulty") == 0 || + strcmp(arg, "raidhotgenerateerror") == 0 || + strcmp(arg, "raidhotadd") == 0 || + strcmp(arg, "raidhotremove") == 0) + printf("usage: %s [OPTIONS] <md-device> <hd-device>\n", arg); + else + printf("usage: %s [OPTIONS] <md-device>*\n", arg); + + printf("\nOPTIONS may be:\n\ +-a, --all apply to all devices specified in config file\n\ +-c, --configfile filename use filename as config file (/etc/raidtab is default)\n\ +-h, --help this help screen\n\ +-v, --version display a short version message, then exit\n"); } int main (int argc, char *argv[]) {