Add the "devices" command as an official one

This commit is contained in:
Andrea Mazzoleni 2015-04-06 17:11:27 +02:00
parent 36a05fe53a
commit 55ad36d1a5
5 changed files with 68 additions and 17 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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].

View file

@ -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".

View file

@ -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".