Skip to content

Commit 23165d5

Browse files
Update smr-check.sh
Change disk to drive
1 parent aeddf42 commit 23165d5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

smr-check.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DeviceWidth=7
55
ModelWidth=12
66
SerialWidth=17
77

8-
# Gather disk information and populate arrays
8+
# Gather drive information and populate arrays
99
midclt call disk.query | jq -S '.[] | {devname: .devname, model: .model, serial: .serial}' > tmp.json
1010

1111
declare -a "Device=($(<tmp.json jq -r '.devname | @sh'))"
@@ -23,7 +23,7 @@ name=$1[@]
2323
SMR=("${!name}")
2424
unset TMP
2525

26-
# For each disk
26+
# For each drive
2727
for ((i=0;i<${#Device[@]};i++)); do
2828
# Is this manufacturer prefix in the model name?
2929
if [[ "${Model[$i]:0:6}" == *"${SMR[0]}"* ]]; then
@@ -111,40 +111,40 @@ TO04=("HDWL" "110" "120" "EZSTA") #1 #7 L200(2.5) 1TB 2TB
111111
TO05=("HDWL" "110" "120" "UZSVA") #1 #7 L200(2.5) 1TB 2TB
112112
TO06=("HDWD" "240" "260" "UZSVA") #1 #7 P300(3.5) 4TB 6TB
113113

114-
# To test this script when you have no SMR disks, configure and temporarily uncomment one of the the TEST arrays below with a valid CMR disk on your system.
114+
# To test this script when you have no SMR drives, configure and temporarily uncomment one of the the TEST arrays below with a valid CMR drives on your system.
115115
# TEST=("WDC WD" "30" "EFRX")
116116
# TEST=("ST" "6000" "VN0041")
117117
# Now uncomment the TEST lines below (there should bbe two of them), and run the script. Remeber to comment oall TEST lines again when you've finished.
118118

119-
# Quiet detection phase. If an SMR disk is detected flag f will be set.
119+
# Quiet detection phase. If an SMR drive is detected flag f will be set.
120120
f=0
121121

122-
# Detect Western Digital SMR disks
122+
# Detect Western Digital SMR drives
123123
for k in {01..10}; do
124124
DetectSMR WD"$k" q
125125
done
126126

127-
# Detect Seagate SMR disks
127+
# Detect Seagate SMR drives
128128
for k in {01..31}; do
129129
DetectSMR ST"$k" q
130130
done
131131

132-
# Detect Toshiba SMR disks
132+
# Detect Toshiba SMR drives
133133
for k in {01..6}; do
134134
DetectSMR TO"$k" q
135135
done
136136

137137
# DetectSMR TEST q
138138

139-
# If the flag f is still unset, no SMR disk was detected. :)
139+
# If the flag f is still unset, no SMR drive was detected. :)
140140
if [[ "$f" == 0 ]]; then
141141
echo
142-
echo -e "\e[1;32mNo known SMR disks detected.\e[0m"
142+
echo -e "\e[1;32mNo known SMR drives detected.\e[0m"
143143
echo
144144
else
145-
# otherwise, one or more SMR disks were detected so diplay all SMR disks in a table :(
145+
# otherwise, one or more SMR drives were detected so diplay all SMR drives in a table :(
146146
echo
147-
echo -e "\e[1;31mKnown SMR disk(s) detected.\e[0m"
147+
echo -e "\e[1;31mKnown SMR drive(s) detected.\e[0m"
148148
echo
149149

150150
fmt="%${DeviceWidth}s | %${ModelWidth}s | %${SerialWidth}s |\n"
@@ -153,17 +153,17 @@ else
153153
s=$(printf "%-$((DeviceWidth+ModelWidth+SerialWidth+8))s" "-")
154154
echo "${s// /-}"
155155

156-
# Detect Western Digital SMR disks
156+
# Detect Western Digital SMR drives
157157
for k in {01..10}; do
158158
DetectSMR WD"$k"
159159
done
160160

161-
# Detect Seagate SMR disks
161+
# Detect Seagate SMR drives
162162
for k in {01..31}; do
163163
DetectSMR ST"$k"
164164
done
165165

166-
# Detect Toshiba SMR disks
166+
# Detect Toshiba SMR drives
167167
for k in {01..6}; do
168168
DetectSMR TO"$k"
169169
done

0 commit comments

Comments
 (0)