Koozali.org: home of the SME Server

Adding RAID Hot Spare after install?

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Adding RAID Hot Spare after install?
« on: August 03, 2007, 11:26:34 AM »
SME7.2

It appears that installing with three drives makes one a hot spare.

How do you add a hot spare after you have installed with two drive?

What 'triggers' a fall over to the spare and how automatic is it?
Regards,
William

IF I give advise.. It's only if it was me....

Offline Gert

  • ****
  • 208
  • +0/-0
    • http://www.huge.co.za
Adding RAID Hot Spare after install?
« Reply #1 on: August 04, 2007, 10:15:04 PM »

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Adding RAID Hot Spare after install?
« Reply #2 on: August 05, 2007, 02:49:23 AM »
Thanks Gert.

I was looking for a "one click" solution within SME.

Next best is the add_drive_to_raid command. I'm not sure how it works with a 'hot' spare though. Time to play in a VM.

Code: [Select]
[root@tiger ~]# cat /sbin/e-smith/add_drive_to_raid
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# add_drive_to_raid: Add spare disk to existing raid arrays
#----------------------------------------------------------------------
# Copyright (C) 2005 Gordon Rowell <gordonr@gormand.com.au>
# Copyright (C) 2006 Shad L. Lords <slords@mail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#----------------------------------------------------------------------
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Adding RAID Hot Spare after install?
« Reply #3 on: August 05, 2007, 02:55:57 AM »
Oh.. one more question,

Does drive interface affect hot spare operation?
Regards,
William

IF I give advise.. It's only if it was me....

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Adding RAID Hot Spare after install?
« Reply #4 on: August 05, 2007, 04:54:36 AM »
Quote from: "william_syd"
Does drive interface affect hot spare operation?
No, but size does matter (ie. the new drive has to be => existing, if > anly the existing size will be used).

Also the script looks to do all the right things (although it fails on trying to put grub info on the new disk - but I don't think this is a problem in a hot-spare....).
Quote from: "william_syd"
What 'triggers' a fall over to the spare and how automatic is it?
A failure of any of the other drives in the raid group. And it is totally automagic (if you have a spare :-)).

Trevor B

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Adding RAID Hot Spare after install?
« Reply #5 on: August 05, 2007, 09:47:45 AM »
Thanks Trevor.

Looks like that script does the trick...
Code: [Select]
[root@sme-raid ~]# mdadm -Ebsc partitions
ARRAY /dev/md1 level=raid1 num-devices=2 spares=1 UUID=b6a6096f:a8585d75:d3aaaffb:e42ad2e2
ARRAY /dev/md2 level=raid1 num-devices=2 spares=1 UUID=253ff517:44d4b41c:edf3babe:5b5d62d1
[root@sme-raid ~]#
Regards,
William

IF I give advise.. It's only if it was me....