Verifying spare drive, best practices
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.
mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good. How should one best :
1) Verify the hot spare is still available.
2) Verify that the hot spare is healthy?
Signature · 8 lines
With our best regards, //Maurice W. Hilarius Telephone: 01-780-456-9771/ /Hard Data Ltd. FAX: 01-780-456-9772/ /11060 - 166 Avenue email:[email protected]/ /Edmonton, AB, Canada http://www.harddata.com// / T5X 1Y3/ /
Maurice Hilarius ([email protected]) wrote on 20 March 2008 22:35:
Quoted 11 lines
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good.
How should one best :
1) Verify the hot spare is still available.
2) Verify that the hot spare is healthy?
I usually do a dd if=/dev/zero of=/dev/spare to write to all sectors and give the drive a chance to remap bad blocks. Then run smartctl with a long test, and smartctl -a to see the results.
If there are partitions I use sfdisk -d /dev/disk-in-array |sfdisk -f /dev/spare to copy the partition table from one of the other disks to the spare, or any other (non-manual...) method to restore the partitioning.
This can be easily included in the routine array checks.
Quoted 13 lines · Carlos Carvalho
Maurice Hilarius ([email protected]) wrote on 20 March 2008 22:35:
Quoted 11 lines
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good.
How should one best :
1) Verify the hot spare is still available.
2) Verify that the hot spare is healthy?
Quoted 5 lines
I usually do a dd if=/dev/zero of=/dev/spare to write to all sectors and give the drive a chance to remap bad blocks. Then run smartctl with a long test, and smartctl -a to see the results.
I hope you disable use as a spare before doing this... If you were so "lucky" as to have a failure in the array and start using the drive as a spare while writing zeros to it, you might have an unexpected learning experience.
Quoted 5 lines
If there are partitions I use sfdisk -d
/dev/disk-in-array|sfdisk -f/dev/spareto copy the partition table from one of the other disks to the spare, or any other (non-manual...) method to restore the partitioning.This can be easily included in the routine array checks.
Signature · 3 lines
Bill Davidsen <[email protected]> "Woe unto the statesman who makes war without a reason that will still be valid when the war is over..." Otto von Bismark
Quoted 10 lines · On Thursday March 20, [email protected] wrote:
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good.
How should one best :
1) Verify the hot spare is still available.
- On the relevant line in mdadm.conf, put "spares=1"
- have a daily cron job that runs
mdadm --montor --scan --oneshot
It will report every day with a "SparesMissing" event if the right number of spares is not present.
Quoted 1 line
2) Verify that the hot spare is healthy?
Others have answered this.
NeilBrown
Quoted 13 lines · Neil Brown
Quoted 10 lines · On Thursday March 20, [email protected] wrote:
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good. How should one best :
1) Verify the hot spare is still available.
Quoted 7 lines
- On the relevant line in mdadm.conf, put "spares=1"
- have a daily cron job that runsmdadm --montor --scan --oneshotIt will report every day with a "SparesMissing" event if the right number of spares is not present.
But that will wakeup the spare-drive ? So i have to put them aspleep again with "hdparm -y" ?
Quoted 13 lines · Neil Brown
Quoted 10 lines · On Thursday March 20, [email protected] wrote:
Given this situation:
7 disks in total
RAID5 of 6 disks, and a hot spare.mdadm show the 6 disks, but not the spare.
As a maintenance question, where one wants to periodically ensure that the hot spare is both available and good. How should one best :
1) Verify the hot spare is still available.
Quoted 7 lines
- On the relevant line in mdadm.conf, put "spares=1"
- have a daily cron job that runsmdadm --montor --scan --oneshotIt will report every day with a "SparesMissing" event if the right number of spares is not present.
Another case for raid4e ;-)
Signature · 3 lines
Bill Davidsen <[email protected]> "Woe unto the statesman who makes war without a reason that will still be valid when the war is over..." Otto von Bismark