[NBLUG/talk] How to re-attach a RAID device?

Lincoln Peters sampln at sbcglobal.net
Fri Jan 7 23:00:28 PST 2005


I've set up my root filesystem as a software RAID-1 array, with one
device being the first partition on my primary master hard disk
(/dev/hda1) and the second being the first partition on an external USB
hard disk (/dev/sdc1).  However, since the kernel seems unable to detect
the USB hard disk upon loading, when the array initializes, it is usable
but degraded.

I was able to re-attach the USB device using the command:
mdadm --manage --add /dev/md0 /dev/sdc1

However, this had the result of the partition on the USB drive being
completely rebuilt, which was completely unnecessary (and might even
reduce the lifespan of the drive if done every time I restart the
computer).


So, what I would like to do is either:

1. Cause mdadm to not activate the array until all devices have had time
to come online (maybe 15 seconds or when all devices are present,
whichever is sooner).  Can I do this by adding a "sleep" command
to /etc/init.d/mdadm-raid?

2. If I can't do #1, find some way to reduce the amount of work that the
array needs to do when the USB partition comes online.  I don't know
enough about RAID to know how this might be done.

(In case anyone's wondering why I'm using external USB hard drives for
something like this, it's so that I can move as many of the noisiest
parts of the system as possible into a cabinet I've prepared to muffle
the noise produced by them.  Theoretically I could use SCSI, but it
would be too expensive for my budget.)

---
Lincoln Peters
<sampln at sbcglobal.net>

"The only way for a reporter to look at a politician is down."
-- H.L. Mencken





More information about the talk mailing list