Monitor Linux/MD RAID Rebuild

watch -n 5 -d cat /proc/mdstat

3
By: wwest4
2009-03-03 21:38:50

These Might Interest You

  • Shows the IO of the raid sync


    2
    iotop -a -p $(sed 's, , -p ,g' <<<`pgrep "_raid|_resync|jbd2"`)
    AskApache · 2012-05-17 19:45:02 0
  • Works in Ubuntu, I hope it will work on all Linux machines. For Unixes, tail should be capable of handling more than one file with '-f' option. This command line simply take log files which are text files, and not ending with a number, and it will continuously monitor those files. Putting one alias in .profile will be more useful.


    6
    find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f
    mohan43u · 2009-06-03 09:47:08 7
  • The old version (--metadata=0.90) is useful when you want to use kernel raid autodetect and not an initrd image.


    0
    mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-devices=3 --spare-devices=3 /dev/sdb[5-9] /dev/sdb10
    Edoard · 2013-09-06 12:14:33 0
  • (WARN) This will absolutely not work on all systems, unless you're running large, high speed, hardware RAID arrays. For example, systems using Dell PERC 5/i SAS/SATA arrays. If you have a hardware RAID array, try it. It certainly wont hurt. You may be can test the speed disk with some large file in your system, before and after using this: time dd if=/tmp/disk.iso of=/dev/null bs=256k To know the value of block device parameter known as readahead. blockdev --getra /dev/sdb And set the a value 1024, 2048, 4096, 8192, and maybe 16384... it really depends on the number of hard disks, their speed, your RAID controller, etc. (see sample) Show Sample Output


    2
    blockdev --setra 1024 /dev/sdb
    starchox · 2009-02-18 16:27:01 1

What Others Think

Or, you can watch them with more detail on each device. For /dev/md0: mdadm -D /dev/md0
atoponce · 481 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: