[olug] The "other" raid utility usage
Matthew G. Marsh
mgm at midwestlinux.com
Tue Apr 22 19:12:59 UTC 2003
On Tue, 22 Apr 2003, Phil Brutsche wrote:
> A long time ago, in a galaxy far, far way, someone said...
>
> > Hmm, interesting. Hot swapping with a hardware RAID controller is old
> > news, but I've never heard of doing it with software RAID on linux. I'd
> > be scared to pull a drive out of a running array for fear of what
> > bizarre conniptions the SCSI driver would have. Did you have to use a
> > special utility to deactivate the drive first?
>
> Yes, it possible. You need to:
>
> 1) use raidhotremove to remove the drive from the array (important!)
Yes! Actually I am glad Phil brought this up as rereading my original
email I think I was not entirely clear on the actual steps needed to
replace a faulty drive in an array (I will assume SCSI here as I am not
brave enough to try the IDE removal)
1. Virtually Fail the drive from the array
"Fail" means telling the array that the drive is bad
mdadm /dev/md0 -f /dev/sdc1
2. Virtually remove the failed drive from the array
mdadm /dev/md0 -r /dev/sdc1
> 2) use the sgutils Matt mentioned to stop the drive (and remove it from
> Linux' knowledge)
sg_start /dev/sg2 0
Cool note - In kernel 2.5 these utils will allow you to use the regular
block device eg: 'sg_start /dev/sdc 0'
Then after I "replace" the drive you spin it back up:
sg_start /dev/sg2 1
Partition it (I used partitions but you don't have to)
fdisk /dev/sdc
Then add the drive back in
mdadm /dev/md0 -a /dev/sdc1
and cat /proc/mdstat or mdadm -D /dev/md0 to check on the progress.
Really cool thing about mdadm is the "Monitor" mode where it will run as a
daemon and report on array status and messages including emailing you if
there is any type of "Fail" message.
> before you remove it. You reverse those steps to when you put the drive
> (or the replacement, if it went bad) back in the system.
>
> This will also work for any IDE RAID controller that works through the
> SCSI bus, like the 3ware Escalade.
>
> Note that you can't do this with pure IDE controllers, such as the Promise
> - I hard locked 2.4.21-preX trying to do that (reset button wouldn't
> recover the system properly, had to cold boot).
>
> --
>
> Phil Brutsche
> phil at brutsche.us
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
>
--------------------------------------------------
Matthew G. Marsh, President
Paktronix Systems LLC
1506 North 59th Street
Omaha NE 68104
Phone: (402) 553-2288
Email: mgm at midwestlinux.com
WWW: http://www.midwestlinux.com
--------------------------------------------------
More information about the OLUG
mailing list