Koozali.org: home of the SME Server

RAID - need clarification on adding a spare

Offline dmcguire

  • *
  • 32
  • +0/-0
RAID - need clarification on adding a spare
« on: October 07, 2009, 11:00:13 AM »
Hi All,

I was given a retired Dell Powervault 745n NAS device with 4 x 250Gb SATA disks. I was able to replace Windows with SME7 using the PXE Boot/Thinclient contrib on my main SME server thanks to TrevorB. (Thanks Trevor!)

Unfortunately for me, I couldn't work out how to slipstream the "nospare" switch with the install. I left the server to sync up the raid overnight, and this morning I was searching the forums for "use hot spare" and I found this post from Stefano which suggests I will have to re-install from scratch;
http://forums.contribs.org/index.php/topic,38401.msg173871.html#msg173871

I know from Stefano's posts that he is an expert in SME, so it would save me a lot of time if anyone can tell me whether it is possible to merge the spare disk into a healthy array?

There is no option to utilise the spare disk in the Admin/console menu.

For information, here are some command outputs from my server;
Code: [Select]
[root@pv745 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                      458G  1.4G  433G   1% /
/dev/md1               99M   14M   81M  14% /boot
none                  252M     0  252M   0% /dev/shm

Code: [Select]
[root@pv745 ~]# cat /proc/mdstat
Personalities : [raid1] [raid5]
md2 : active raid5 sda2[0] sdd2[2] sdc2[3] sdb2[1]
      488070144 blocks level 5, 256k chunk, algorithm 2 [3/3] [UUU]

md1 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      104320 blocks [3/3] [UUU]

unused devices: <none>

Code: [Select]
[root@pv745 ~]# mdadm --detail /dev/md2                                         /dev/md2:
        Version : 00.90.01
  Creation Time : Tue Oct  6 19:25:39 2009
     Raid Level : raid5
     Array Size : 488070144 (465.46 GiB 499.78 GB)
    Device Size : 244035072 (232.73 GiB 249.89 GB)
   Raid Devices : 3
  Total Devices : 4
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Wed Oct  7 09:54:21 2009
          State : clean
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 256K

           UUID : 217f79a4:bf04bc95:7ace19a8:6510bf3e
         Events : 0.13305

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       2       8       50        2      active sync   /dev/sdd2

       3       8       34        -      spare   /dev/sdc2

If there is an madm command to utilise the spare as part of the live array, can anyone tell me what it is?


Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: RAID - need clarification on adding a spare
« Reply #1 on: October 07, 2009, 11:28:26 AM »
hi.. thank you for the "expert".. :-) however, I'm not an expert

NOTE: I never tested it, so please, make a backup of your data

Code: [Select]
mdadm --grow /dev/md2 --raid-devices=4
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root

let us know.. if it works, I will update the wiki page

HTH

Offline dmcguire

  • *
  • 32
  • +0/-0
Re: RAID - need clarification on adding a spare
« Reply #2 on: October 07, 2009, 11:36:35 AM »
Thanks for the reply. Compared to me, you are an expert!

Code: [Select]
[root@pv745 ~]# mdadm --grow /dev/md2 --raid-devices=4
mdadm: Cannot set device size/shape for /dev/md2: Invalid argument

Sorry! I hit the post button a bit too soon there...

There's no data on the server, clean build of 7.4 from the CD.
Code: [Select]
[root@pv745 ~]#  mdadm --grow /dev/md2 --raid-devices=4 pvresize /dev/md2 lvresize -l +100%FREE main/root ext2online -C0 /dev/main/root
mdadm: invalid raid level: +100%FREE
« Last Edit: October 07, 2009, 11:44:00 AM by dmcguire »

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: RAID - need clarification on adding a spare
« Reply #3 on: October 07, 2009, 11:48:08 AM »
ok.. found the problem.. the grow command is implemented only in newer kernel.. from 2.6.17 onward..

sorry, I think you can't do it

Offline dmcguire

  • *
  • 32
  • +0/-0
Re: RAID - need clarification on adding a spare
« Reply #4 on: October 07, 2009, 11:50:51 AM »
OK well at least I know, so I can go back to the PXE boot and work out how to "no spare" it!

Thanks for your help, much appreciated.

Offline dmcguire

  • *
  • 32
  • +0/-0
Re: RAID - need clarification on adding a spare
« Reply #5 on: October 07, 2009, 02:52:12 PM »
Figured out the PXE sufficiently to get the server booting to a prompt on PXE Boot, did "sme nospare" and the install ran OK.

Code: [Select]
[root@pv745 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                      687G  1.3G  651G   1% /
/dev/md1               99M   14M   81M  14% /boot
none                  252M     0  252M   0% /dev/shm

And the array sync is in progress...

Code: [Select]
[root@pv745 ~]# cat /proc/mdstat
Personalities : [raid1] [raid5]
md2 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]
      732105216 blocks level 5, 256k chunk, algorithm 2 [4/3] [UUU_]
      [=========>...........]  recovery = 47.2% (115202708/244035072) finish=44.6min speed=48111K/sec
md1 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      104320 blocks [4/4] [UUUU]

unused devices: <none>

Seems to be pulling the "spare" disk into line...

Code: [Select]
[root@pv745 ~]# mdadm --detail /dev/md2
/dev/md2:
        Version : 00.90.01
  Creation Time : Wed Oct  7 12:45:21 2009
     Raid Level : raid5
     Array Size : 732105216 (698.19 GiB 749.68 GB)
    Device Size : 244035072 (232.73 GiB 249.89 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Wed Oct  7 13:53:11 2009
          State : clean, degraded, recovering
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 256K

 Rebuild Status : 52% complete

           UUID : dec3d96c:8559ab08:796696e6:2a98e54b
         Events : 0.15335

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       2       8       34        2      active sync   /dev/sdc2
       3       0        0        -      removed

       4       8       50        3      spare rebuilding   /dev/sdd2

Thanks again Stefano, you've saved me a lot of searching headaches today.

« Last Edit: October 07, 2009, 02:55:44 PM by dmcguire »