Monday, May 16, 2011

Raid Tips & Tricks

Increasing the rebuild speed

Sometimes when you’re quite lazy or bored and don’t like the noticeable amount of free resources on your server, you may like to increase the raid building and resyncing process speed.

# echo 250000 > /proc/sys/dev/raid/speed_limit_max
# echo 250000 > /proc/sys/dev/raid/speed_limit_min

And this would spin up the hards faster to their maximum extent saving almost half of the time!
Defaults were:

# cat /proc/sys/dev/raid/speed_limit_max 200000
# cat /proc/sys/dev/raid/speed_limit_min 1000

And looks like my hards have 100M/s speed.

#hddtemp /dev/sda

/dev/sda: ST3750330AS: 31°C

# hdparm -t /dev/sda

Timing buffered disk reads:  280 MB in  3.01 seconds =  93.09 MB/sec

Checking and repairing

The larger the hard drive is the greater the probability of having its blocks corrupted. Its better to check for consistency against any bad blocks or md superblocks.

# cat /sys/block/md0/md/sync_action 
# echo check > /sys/block/md0/md/sync_action

And if there are any, repair them.

# echo repair > /sys/block/md0/md/sync_action

etting up RAID alerts to send emails about any errors

Red Hat family distros come with built in service daemon mdmonitor which runs ‘mdadm –monitor’ in a daemon mode.

# mdadm --detail --scan >> /etc/mdadm.conf
# echo "MAILADDR some-email-address" >> /etc/mdadm.conf
# chkconfig mdmonitor on
# service mdmonitor restart

Remember to add “DEVICE partitions” or partitions being components of an md array to top of file /etc/mdadm.conf.

Monitoring all RAID events and changing default email template

No comments :

Post a Comment