loseby.net

articles and projects by Chad Loseby

3ware RAID setup

We (the VTC Computer Club) recently added a mirrored RAID 1 array to our FreeBSD server, solstice. Our hardware consists of one 3ware 8006-2LP SATA RAID controller card and two Seagate Barracuda 400GB SATA drives. Here are the steps we took:

  1. Physically install the controller card and drives.
    Things got interesting here - in Dell's infinite wisdom, our PowerEdge 1500SC has only 5.25" drive bays and special slots for SCSI hard drives, which are prohibitively expensive. What we ended up doing is mounting our two drives in removable drive racks and then placing them in the empty 5.25" bays. It's not the ideal solution, but it looks good and saves us from having hard drives rolling around loose in the server's case.

  2. Configure the array in the RAID BIOS.
    If you watch for it, as the machine boots you will see a prompt for the 3ware RAID BIOS - when you see it, hit Alt-3. This will bring you into the RAID BIOS, which will easily allow you to configure the drives in your manner of choosing. In our case, we chose to place the drives in a mirrored RAID-1 configuration, so that there will be no system interruption or data loss if one of the drives fails. Once you have finished configuring the array, press F8 to save your changes and reboot.

  3. Boot back into FreeBSD and install the 3ware tools.
    This step is not necessary, but it is highly recommended. Installing the 3ware CLI tools will allow you to view the health of your array, which is important in a RAID 1 configuration because you will be otherwise unaware if one of the drives in the array fails. The 3ware CLI tools are in ports, located at /usr/ports/sysutils/tw_cli.
    [closeby@solstice] ~$ cd /usr/ports/sysutils/tw_cli/
    [closeby@solstice] /usr/ports/sysutils/tw_cli$ sudo make install clean
    
    Once the tools have been successfully installed, you should be able to run the following command and view the state of your array:
    [closeby@solstice] /usr/ports/sysutils/tw_cli$ sudo tw_cli info c0
    
    Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
    ------------------------------------------------------------------------------
    u0    RAID-1    OK             -       -       -       372.61    ON     -      
    
    Port   Status           Unit   Size        Blocks        Serial
    ---------------------------------------------------------------
    p0     OK               u0     372.61 GB   781422768     6QG0RMKW            
    p1     OK               u0     372.61 GB   781422768     6QG0XTW1
    Before you continue, you should make sure that your array is in the OK state.

  4. Partition and label the "drive".
    Due to the nature of the hardware RAID controller, FreeBSD should see the array as a single drive, in our case twed0. I used the sysinstall utility to partition the drive:
    1. Run sysinstall as root
    2. Choose Configure > Fdisk > twed0
    3. Select A = Use Entire Disk
    4. Select W = Write Changes
    5. Since this is not the boot drive, select "Do not install an MBR"
    Once that is complete, the drive can be labeled and mounted. In our case, we mounted it temporarily at /mnt.
    1. Go back to the sysinstall main menu
    2. Choose Configure > Label > twed0
    3. Select C = Create
    4. Use all space, mount at /mnt
    5. Select W = Write Changes
    Ta-da! The array is now partitioned, formatted, and mounted at /mnt. Keep in mind that it will not stay mounted after the next boot, so you will need to add an entry to /etc/fstab to mount it at every boot.

In our case, the next step is to migrate our home directories onto the new array.