Deecting luns - Any explaination for the command
I recently had an opportunity to see how luns are scanned. Just need help in understanding the below command.
# echo "- - -" > /sys/class/scsi_host/host1/scan I am not sure what "- - -" explains? Anyone? |
The /sys folder in Linux is special in that the files in the structure are intended to provide an interface with the Linux kernel directly.
As such, when you are writing "- - -" to the /sys/class/scsi_host/host1/scan special file, you are sending a request to the Linux kernel to scan the scsi connections on the scsi bus "host1" |
Thanks a lot. And, what if we give "1" instead of "- - -". Does it make any difference?
|
I would imagine that the kernel developers decided to use "- - -" specifically and that it would not accept other input.
|
Each SCSI controller can have a number of buses, each bus can serve a number of devices, and each device can have one or more Logical Units.
The dashes act as wildcards. "- - -" simply means "scan all buses, all devices and all LUNs". The string "0 - -" would mean "scan all devices and LUNs on bus 0", while "- - 0" would mean "scan LUN 0 on all devices on all buses". If you try to reference a non-existent bus/device/LUN, echo will return "write error: Invalid argument". |
Thank you very much.
|
All times are GMT -5. The time now is 08:48 PM. |