File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 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) {
123123 finish := float64 (0 )
124124 pct := float64 (0 )
125125 recovering := strings .Contains (lines [syncLineIdx ], "recovery" )
126+ reshaping := strings .Contains (lines [syncLineIdx ], "reshape" )
126127 resyncing := strings .Contains (lines [syncLineIdx ], "resync" )
127128 checking := strings .Contains (lines [syncLineIdx ], "check" )
128129
129130 // Append recovery and resyncing state info.
130- if recovering || resyncing || checking {
131+ if recovering || resyncing || checking || reshaping {
131132 if recovering {
132133 state = "recovering"
134+ } else if reshaping {
135+ state = "reshaping"
133136 } else if checking {
134137 state = "checking"
135138 } else {
Original file line number Diff line number Diff line change @@ -283,6 +283,21 @@ func TestFS_MDStat(t *testing.T) {
283283 BlocksSyncedFinishTime : 0.2 ,
284284 BlocksSyncedSpeed : 114176 ,
285285 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" }},
286301 }
287302
288303 if want , have := len (refs ), len (mdStats ); want != have {
Original file line number Diff line number Diff line change @@ -2432,7 +2432,7 @@ Lines: 1
24322432Mode: 444
24332433# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24342434Path: fixtures/proc/mdstat
2435- Lines: 60
2435+ Lines: 65
24362436Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
24372437
24382438md3 : active raid6 sda1[8] sdh1[7] sdg1[6] sdf1[5] sde1[11] sdd1[3] sdc1[10] sdb1[9] sdd1[10](S) sdd2[11](S)
@@ -2492,6 +2492,11 @@ md120 : active linear sda1[1] sdb1[0]
24922492md101 : active (read-only) raid0 sdb[2] sdd[1] sdc[0]
24932493 322560 blocks super 1.2 512k chunks
24942494
2495+ md42 : active raid5 sda1[3](S) sdd1[0] sde1[1]
2496+ 1953381440 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/2] [UU_]
2497+ [===========>.........] reshape = 56.1% (1096879076/1953381440) finish=1868.1min speed=7640K/sec
2498+ bitmap: 4/15 pages [16KB], 65536KB chunk
2499+
24952500unused devices: <none>
24962501Mode: 644
24972502# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You can’t perform that action at this time.
0 commit comments