File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,16 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
123
123
finish := float64 (0 )
124
124
pct := float64 (0 )
125
125
recovering := strings .Contains (lines [syncLineIdx ], "recovery" )
126
+ reshaping := strings .Contains (lines [syncLineIdx ], "reshape" )
126
127
resyncing := strings .Contains (lines [syncLineIdx ], "resync" )
127
128
checking := strings .Contains (lines [syncLineIdx ], "check" )
128
129
129
130
// Append recovery and resyncing state info.
130
- if recovering || resyncing || checking {
131
+ if recovering || resyncing || checking || reshaping {
131
132
if recovering {
132
133
state = "recovering"
134
+ } else if reshaping {
135
+ state = "reshaping"
133
136
} else if checking {
134
137
state = "checking"
135
138
} else {
Original file line number Diff line number Diff line change @@ -283,6 +283,21 @@ func TestFS_MDStat(t *testing.T) {
283
283
BlocksSyncedFinishTime : 0.2 ,
284
284
BlocksSyncedSpeed : 114176 ,
285
285
Devices : []string {"sda3" , "sdb3" }},
286
+ "md42" : {
287
+ Name : "md42" ,
288
+ ActivityState : "reshaping" ,
289
+ DisksActive : 2 ,
290
+ DisksTotal : 3 ,
291
+ DisksFailed : 0 ,
292
+ DisksDown : 1 ,
293
+ DisksSpare : 1 ,
294
+ BlocksTotal : 1953381440 ,
295
+ BlocksSynced : 1096879076 ,
296
+ BlocksToBeSynced : 1953381440 ,
297
+ BlocksSyncedPct : 56.1 ,
298
+ BlocksSyncedFinishTime : 1868.1 ,
299
+ BlocksSyncedSpeed : 7640 ,
300
+ Devices : []string {"sda1" , "sdd1" , "sde1" }},
286
301
}
287
302
288
303
if want , have := len (refs ), len (mdStats ); want != have {
Original file line number Diff line number Diff line change @@ -2253,7 +2253,7 @@ Lines: 1
2253
2253
Mode: 444
2254
2254
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2255
2255
Path: fixtures/proc/mdstat
2256
- Lines: 60
2256
+ Lines: 65
2257
2257
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
2258
2258
2259
2259
md3 : active raid6 sda1[8] sdh1[7] sdg1[6] sdf1[5] sde1[11] sdd1[3] sdc1[10] sdb1[9] sdd1[10](S) sdd2[11](S)
@@ -2313,6 +2313,11 @@ md120 : active linear sda1[1] sdb1[0]
2313
2313
md101 : active (read-only) raid0 sdb[2] sdd[1] sdc[0]
2314
2314
322560 blocks super 1.2 512k chunks
2315
2315
2316
+ md42 : active raid5 sda1[3](S) sdd1[0] sde1[1]
2317
+ 1953381440 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/2] [UU_]
2318
+ [===========>.........] reshape = 56.1% (1096879076/1953381440) finish=1868.1min speed=7640K/sec
2319
+ bitmap: 4/15 pages [16KB], 65536KB chunk
2320
+
2316
2321
unused devices: <none>
2317
2322
Mode: 644
2318
2323
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You can’t perform that action at this time.
0 commit comments