Knowledge Base - FAQ

Question: How do I add / remove a sata drive?

To get the serial number of the drive in question use:
smartctl -a /dev/sdb

To fail a drive out of the array, use:
mdadm -f /dev/md0 /dev/sdb1
then
mdadm -r /dev/md0 /dev/sdb1

After replacing the bad drive,
At the device level to force a rescan on a scsi bus (each sata port appears as a scsi bus) and find new drives:
echo "0 0 0" >/sys/class/scsi_host/hostXX/scan (where XX is the bus number)

To put the new drive back into the array, use:
sfdisk -d /dev/sda | sfdisk  /dev/sdb
mdadm -a /dev/md0 /dev/sdb1

Dont forget to lilo after the array has rebuilt.  Using "at" can help:

# at 20:00
warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh
at> lilo
at> <EOT>
job 1 at 2011-12-06 20:00


Last Modified: Dec 06, 2011


Select a category
Search:

Kattare is Trustwave Certified and Safe Harbor Certified | Rated Safe For Kids by ICRA | All Rights Reserved Worldwide
Copyright © 1997 - 2012 Kättare Internet Services | Processed in 0.014 seconds by webmail in Corvallis, Oregon