Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



QNAP - See RAID reb...
 
Share:
Notifications
Clear all

[Solved] QNAP - See RAID rebuild progress from command line (SSH)

3 Posts
1 Users
0 Reactions
129 Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2705
Topic starter  

To speed up the rebuild of a RAI volume, I usually stop/disable as many applications and services (including network sharing) as I can, and I do not access the QNAP through the webUI - just to save resources. This really makes a huge differences, especially when you give the rebuild the highest priority (Resync First).

Now the challenge is how to monitor progress.

First thing I did is adding a rule to the Notification Center, so I get a notification when a rebuild was completed.
But I'm antsy at times and really want to know how far we are with the rebuild.

With SSH you can execute this to see your progress ...

cat /proc/mdstat

You'll see something like this (I removed the less relevant info), where it shows we're at 38.5%:

...      
md2 : active raid6 sdj3[9] sdi3[13] sdd3[12] sdc3[10] sde3[11] sdf3[8] sdh3[0] sdg3[1]
      23382380544 blocks super 1.0 level 6, 512k chunk, algorithm 2 [8/7] [UU_UUUUU]
      [=======>.............]  recovery = 38.5% (1502218752/3897063424) finish=733.2min speed=54433K/sec
      bitmap: 5/30 pages [20KB], 65536KB chunk
...

Hope this is helpful to anyone 😁 


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2705
Topic starter  

If you're impatient, like me, then you can run this, which

- opens an ssh connection,
- executes cat /proc/mdstat | grep recovery,
- and closes the SSH connection (exit).

ssh username@ip-of-your-qnap 'cat /proc/mdstat | grep recovery; exit'

So for example:

~ $ ssh admin@192.168.1.100 'cat /proc/mdstat | grep recovery; exit'
      [===========>.........]  recovery = 55.0% (2144721408/3897063424) finish=320.5min speed=91109K/sec
~ $ 

(all this under the assumption that you have SSH to your QNAP setup to login with an SSH Key - so no password is needed)


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2705
Topic starter  

Same trick can be applied when looking for the status of a resync when you expand a pool:

ssh admin@192.168.1.100 'cat /proc/mdstat | grep resync; exit'

   
ReplyQuote
Share: