diff --git a/HISTORY b/HISTORY index f7982760..088db439 100644 --- a/HISTORY +++ b/HISTORY @@ -20,6 +20,8 @@ SnapRAID HISTORY * Adds new "smart" command to print a SMART report of the array. * Adds new "up" and "down" commands to spin up and down the disks of the array. + * Adds new "devices" command to print the devices associations in + the array. * Changes the log handling. If no log file is specified, all the warnings and not fatal errors messages goes to stderr. If a log file is specified, only fatal error messages are printed on the screen. diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index b5e97c6d..4787011c 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -755,7 +755,7 @@ int main(int argc, char* argv[]) operation = OPERATION_SPINUP; } else if (strcmp(argv[optind], "down") == 0) { operation = OPERATION_SPINDOWN; - } else if (strcmp(argv[optind], "test-devices") == 0) { + } else if (strcmp(argv[optind], "devices") == 0) { operation = OPERATION_DEVICES; } else if (strcmp(argv[optind], "smart") == 0) { operation = OPERATION_SMART; diff --git a/snapraid.1 b/snapraid.1 index c413c2a0..be8e40e0 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -50,7 +50,7 @@ snapraid [\-c, \-\-conf CONFIG] .PD 0 .PP .PD - status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|rehash + status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|devices|rehash .PD 0 .PP .PD @@ -820,15 +820,30 @@ subdirectories are deleted and replaced with the new view of the array. Any other regular file is left in place. .PP Nothing is modified outside the pool directory. +.SS devices +Prints the low level devices used by the array. +.PP +This command prints the devices associations in place in the array, +and it\'s mainly intended as a script interface. +.PP +The first two columns are the low level device id and path. +The next two columns are the high level device id and path. +The latest column if the disk name in the array. +.PP +In most cases you have one low level device for each disk in the +array, but in some more complex configurations, you may have multple +low level devices used by a single disk in the array. +.PP +Nothing is modified. .SS rehash Schedules a rehash of the whole array. .PP -This option can be used to change the hash kind used, -typically when upgrading from a 32 bits system to a 64 -bits one, to switch from MurmurHash3 to the faster SpookyHash. +This command changes the hash kind used, typically when upgrading +from a 32 bits system to a 64 bits one, to switch from +MurmurHash3 to the faster SpookyHash. .PP If you are already using the optimal hash, this command -do nothing and tells you that nothing has to be done. +does nothing and tells you that nothing has to be done. .PP The rehash isn\'t done immediately, but it takes place progressively during \[dq]sync\[dq] and \[dq]scrub\[dq]. diff --git a/snapraid.d b/snapraid.d index 9389632a..ae1c6727 100644 --- a/snapraid.d +++ b/snapraid.d @@ -14,7 +14,7 @@ Synopsis : [-S, --start BLKSTART] [-B, --count BLKCOUNT] : [-L, --error-limit NUMBER] : [-v, --verbose] [-q, --quiet] - : status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|rehash + : status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|devices|rehash :snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT] @@ -560,15 +560,31 @@ Commands Nothing is modified outside the pool directory. + devices + Prints the low level devices used by the array. + + This command prints the devices associations in place in the array, + and it's mainly intended as a script interface. + + The first two columns are the low level device id and path. + The next two columns are the high level device id and path. + The latest column if the disk name in the array. + + In most cases you have one low level device for each disk in the + array, but in some more complex configurations, you may have multple + low level devices used by a single disk in the array. + + Nothing is modified. + rehash Schedules a rehash of the whole array. - This option can be used to change the hash kind used, - typically when upgrading from a 32 bits system to a 64 - bits one, to switch from MurmurHash3 to the faster SpookyHash. + This command changes the hash kind used, typically when upgrading + from a 32 bits system to a 64 bits one, to switch from + MurmurHash3 to the faster SpookyHash. If you are already using the optimal hash, this command - do nothing and tells you that nothing has to be done. + does nothing and tells you that nothing has to be done. The rehash isn't done immediately, but it takes place progressively during "sync" and "scrub". diff --git a/snapraid.txt b/snapraid.txt index f9821ccb..dda4b6cc 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -18,7 +18,7 @@ snapraid [-c, --conf CONFIG] [-S, --start BLKSTART] [-B, --count BLKCOUNT] [-L, --error-limit NUMBER] [-v, --verbose] [-q, --quiet] - status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|rehash + status|smart|up|down|diff|sync|scrub|fix|check|list|dup|up|down|pool|devices|rehash snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT] @@ -612,17 +612,35 @@ view of the array. Any other regular file is left in place. Nothing is modified outside the pool directory. -5.15 rehash +5.15 devices +------------ + +Prints the low level devices used by the array. + +This command prints the devices associations in place in the array, +and it's mainly intended as a script interface. + +The first two columns are the low level device id and path. +The next two columns are the high level device id and path. +The latest column if the disk name in the array. + +In most cases you have one low level device for each disk in the +array, but in some more complex configurations, you may have multple +low level devices used by a single disk in the array. + +Nothing is modified. + +5.16 rehash ----------- Schedules a rehash of the whole array. -This option can be used to change the hash kind used, -typically when upgrading from a 32 bits system to a 64 -bits one, to switch from MurmurHash3 to the faster SpookyHash. +This command changes the hash kind used, typically when upgrading +from a 32 bits system to a 64 bits one, to switch from +MurmurHash3 to the faster SpookyHash. If you are already using the optimal hash, this command -do nothing and tells you that nothing has to be done. +does nothing and tells you that nothing has to be done. The rehash isn't done immediately, but it takes place progressively during "sync" and "scrub".