How to assign a spare disk to raid array on a HP server on Ubuntu

To make changes to a HP raid array while the server is running you need to first install the HP PSP pack. Instructions for installing this are : located here. You then need to use the “HP Array Configuration Utility CLI” called hpacucli.

hpacucli

To show all raid array’s setup

==> ctrl slot=0 pd all show

I have a HP server with two raid arrays.  To explain what is shown below: array A has two disks plus a spare and array B has four disks and no spare. Here is how it looks before I add the new disk.

Smart Array P410i in Slot 0 (Embedded)

   array A

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 72 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 72 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK, spare)

   array B

      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SATA, 1 TB, OK)
      physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SATA, 1 TB, OK)
      physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SATA, 1 TB, OK)
      physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SATA, 1 TB, OK)

I then pop the drive in bay 4 and it looks like this – notice the unassigned disk:

Smart Array P410i in Slot 0 (Embedded)

   array A

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 72 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 72 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK, spare)

   array B

      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SATA, 1 TB, OK)
      physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SATA, 1 TB, OK)
      physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SATA, 1 TB, OK)
      physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SATA, 1 TB, OK)

   unassigned

      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SATA, 1 TB, OK)

I want to add the unassigned disk to Array B as a spare. (Note: you can’t mix SAS and SATA disks in HP arrays). So enter the following command:

==> ctrl slot=0 array A add spares=allunassigned

And finally, I get this:

Smart Array P410i in Slot 0 (Embedded)

   array A

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 72 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 72 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK, spare)

   array B

      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SATA, 1 TB, OK)
      physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SATA, 1 TB, OK)
      physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SATA, 1 TB, OK)
      physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SATA, 1 TB, OK)
      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SATA, 1 TB, OK, spare)

I hope this help. I also found this really good cheat sheet for doing this here:

http://www.datadisk.co.uk/html_docs/redhat/hpacucli.htm

2 thoughts to “How to assign a spare disk to raid array on a HP server on Ubuntu”

  1. if i don’t have spare disk what would happen to the rest if in case there are failures for example i have 5 disk and all 3 failed so the rest of the drive has the backup data am i right?

Leave a Reply to carl Cancel reply