Comments (6)
Would something like 'if sg_inq $DEVICE | grep -q -i "PQual=0" ' work in this situation?
from sg3_utils.
it works:
testoneline() {
……
sg_turs /dev/$SGDEV >/dev/null 2>&1
RC=$?
# Handle in progress of becoming ready and unit attention
while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le 30 ] ; do
if [ $RC = 2 ] && [ "$RMB" != "1" ] && [ sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ]; then
echo -n "."
let LN+=1
sleep 1
else
sleep 0.02
fi
let ctr+=1
sg_turs /dev/$SGDEV >/dev/null 2>&1
RC=$?
……
}
from sg3_utils.
sg3_utils revision 972 (subversion, as show in ChangeLog file) uploaded with the above change in it. Could you test it?
from sg3_utils.
I'm so sorry and embarrassed for #24 (comment). it has a code error - we should not add "[ ]".
from sg3_utils.
I'm so sorry and embarrassed for #24 (comment). it has a code error - we should not add "[ ]", I wrote it wrong.
it should be like this:
if [ $RC = 2 ] && [ "$RMB" != "1" ] && sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ; then
and I tested this shell with "scsi-rescan -a -r ",there are two iscsi links on my server, as we expected, one link reduced 30 seconds。
after modificated:
real 0m12.165s
user 0m2.853s
sys 0m2.450s
before modificated:
real 1m12.874s
user 0m2.732s
sys 0m2.353s
from sg3_utils.
Subversion revision 973, now mirrored here, has the above fix. Perhaps you might recheck it has been done properly. Also that revision contains the patch discussed in the issue #22 .
from sg3_utils.
Related Issues (13)
- The sorting order of the output numeric part is out of order HOT 3
- shared library SONAME HOT 2
- rescan_scsi_bus.sh: Why it's pointless to do a target scan on FC ? HOT 3
- rescan-scsi-bus.sh: function "findremapped" is too slow when there is 1K luns on server,is there any way to solve it? HOT 5
- Identify device output for SATA on big endian HOT 11
- Strange behavior of sg_inq -HH option HOT 2
- invalid VPD response; probably a STANDARD INQUIRY response HOT 2
- Regression in sgp_dd command HOT 4
- Input parameter handling for sg_wr_mode fails... HOT 3
- sg_logs: output for Device Statistics page (14h), serial numbers should be strings? HOT 5
- rescan-scsi-bus.sh: -r flag unmounts active root disk HOT 3
- Something weird happened in windows... please help me understand. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sg3_utils.