FreeBSD Adaptec 2100S RAID

Date: 02 April 2005

Setting up the 2100S is actually pretty simple. Here’s how I did it.

Configure your Kernel

The 2100S uses the asr driver which is included in the GENERIC kernel, however, I take that out of my custom kernels since most of my machine do not have a RAID controller at all, so I added this line to my kernel config and rebuilt.

device          asr             # DPT SmartRAID V, VI and Adaptec SCSI RAID

Install the Adaptec RAID Control Software

The CD that comes with the controller includes some software to control and configure the RAID. What bugs me is that, be default, it want’s to install itself into /usr/dpt and I’m not really thrilled with installing third-party software in /usr. That’s OK though, it’s easy enough to install it in /usr/ local by using the -p option to pkg_add.

mount /cdrom
pkg_add -p /usr/local/dpt /cdrom/package/FreeBSD/apps/sm/adptfbsd_314.tgz
umount /cdrom

Configure the RAID

Now is the time to stop and make sure that you have your HDDs installed and ready. The drives need to be pristine, i.e. they cannot have any existing partitions, etc. and cannot have the same SCSI ID as the controller. (The 2100S uses ID 7 by default.)

It’s probably a good idea to disable kern.securelevel before proceeding as well, as it may prevent the controller from accessing the drives properly.

Now that everything is ready, it’s time to create the array. Let’s pretend that we have eight HDDs with IDs 1-6, 8 and 9 (remember, the controller is using ID 7), and we want to build a RAID-10 array.

Note: I used raidutil to do the setup because I don’t have X installed on that server. Feel free to use Storage Manager or Storage Manager Pro.

Identify the Controller Address

We need the Adaptec address for the controller we’re using for the RAID. In my case, the ID is d0. The ID will be used to tell raidutil which controller we’re creating the RAID on.

bash-2.05b# ./raidutil -L controller
#  b0 b1 b2  Controller     Cache  FW    NVRAM     Serial     Status
---------------------------------------------------------------------------
d0 --        ADAP2100S      16MB   370F  CHNL 1.1  BBXXXXXXXXXOptimal

Get the Adaptec Addresses for the HDDs

raidutil requires that you refer to your HDDs by their Adaptec addresses. You can get the the HDD addresses with the physical parameter to -L. Note: -c d0 is what tells raidutil which controller to look at. Remember, d0 is the ID we got above.

bash-2.05b# ./raidutil -c d0 -L physical
Address    Type              Manufacturer/Model         Capacity  Status
---------------------------------------------------------------------------
d0b0t1d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t2d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t3d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t4d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t5d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t6d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t8d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t9d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal

Build the RAID-10

Now it’s time to build the RAID. The setup below creates the stripe across mirrored pairs. The + between addresses denotes the mirroring. You can mirror the drives in any order. What seemed a little weird to me was setting the RAID level (-l) to 1 but it works.

Note: The raidutil man page that came on my CD seems to have an error when discussing RAID-10 configutation. From the man page:

To create a RAID 10 configuration specify groups in pairs as follows:
         raidutil -c c1 -l 1 -g c1t1d0,c1t2d0,c1t3d0,c1t4d0

Notice that there are no + signs anywhere in that command to denote drive pairs.

Note: -g must be the last option to the command. If it is not, your other options will not be applied.

./raidutil -c d0 -l 1 -z 64 -g d0b0t1d0+d0b0t2d0,d0b0t3d0+d0b0t4d0,d0b0t5d0+d0b0t6d0,d0b0t8d0+d0b0t9d0

You can use -L raid to watch the controller build the RAID. When it’s done, you should see something like this.

bash-2.05b# ./raidutil -c d0 -L raid   
Address       Type              Manufacturer/Model      Capacity  Status
---------------------------------------------------------------------------
d0b0t1d0      RAID 0 (Striped)  ADAPTEC  RAID-10        70007MB   Optimal
  d0b0t1d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Optimal
   d0b0t1d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t2d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t3d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Optimal
   d0b0t3d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t4d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t5d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Optimal
   d0b0t5d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t6d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t8d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Optimal
   d0b0t8d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t9d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal

You’re Done

Congratulations! You now have a working RAID. The RAID should be available as /dev/da0. You can now label and partition the RAID as you would for any other drive.

Replacing a Failed Drive

I recently came in to the tune of the RAID controller’s alarm going off. The server just kept chugging way without a hitch. I’m beginning to like RAID.

cd /usr/local/dpt
root@accounts dpt# ./raidutil -A
#  b0 b1 b2    Controller      Alarm Status  Alarm Enable
---------------------------------------------------------------------------
d0 --          2100S           On            Enabled

root@accounts dpt# ./raidutil -L physical | less
Address    Type              Manufacturer/Model         Capacity  Status
---------------------------------------------------------------------------
d0b0t1d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Failed drive
d0b0t2d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t3d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t4d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t5d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t6d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal
d0b0t8d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Failed drive
d0b0t9d0   Disk Drive (DASD) IBM      IC35L018UCPR15-0  17501MB   Optimal

It looks like I lost two drives. That’s not good at all. However, this is still survivable. Replace the drives then run:

./raidutil -c d0 -a rebuild d0b0t1d0

Now when you run raidutil -L raid you should be something like this:

root@accounts dpt# ./raidutil -c d0 -L raid
Address       Type              Manufacturer/Model      Capacity  Status
---------------------------------------------------------------------------
d0b0t1d0      RAID 0 (Striped)  ADAPTEC  RAID-10        70007MB   Reconstruct 6%
  d0b0t1d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Reconstruct
   d0b0t1d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Replaced Drive
   d0b0t2d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t3d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Reconstruct
   d0b0t3d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t4d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t5d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Reconstruct
   d0b0t5d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
   d0b0t6d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal
  d0b0t8d0     RAID 1 (Mirrored) ADAPTEC  RAID-1         17501MB   Reconstruct
   d0b0t8d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Replaced Drive
   d0b0t9d0    Disk Drive (DASD) IBM      IC35L018UCPR15-17501MB   Optimal

This will eventually finish and you should be good to go again.