SCSI and RAID

Author: John M. Gabriele
Date: May 2007
Back to:homepage

Contents

Hardware

Besides using a hardware RAID controller, it's also possible to have Linux manage the RAID array in software. However, that's not a task I'm interested in here -- these notes are strictly about using hardware RAID on machines with SCSI drives (one RAID controller, one SCSI controller).

Also, I know next to nothing about the Linux "LVM" (logical volume manager). I just make my disk partitions the old-fashioned way. :)

The SCSI controller and the RAID controller are usually integrated. The SCSI chipset actually talks to the disks -- the RAID chipset talks to the SCSI chipset. Your OS talks to the RAID (as does the motherboard BIOS), which provides the abstraction of logical drives. As far as Linux is concerned, it thinks it's talking to individual SCSI drives named /dev/sda, /dev/sdb, etc.

Linux --> RAID controller --> SCSI controller --> hard disks

On most servers, the drives are hot-swappable. This is a feature of the SCSI chipset you (well, your RAID chipset) is using. A very high-performance SCSI drive is a 10,000 RPM Ultra320 (i.e. SCSI-3).

Each physical SCSI device in your system will have its own SCSI ID (including the SCSI controller (usually ID#6)). The bays on your server may be labeled (or else you'll want to label them) scsi0, scsi1, and so on. You have exactly 7 SCSI ID's available per SCSI controller, and it's uncommon to have more than one SCSI controller in your system.

You can do a "soft-reboot" by hitting Ctrl-Alt-Delete. This is quite a bit faster than hitting the power button on the front of the unit to get a hard restart.

BIOS/firmware

On most server-class machines there's usually more than one "BIOS". That is, any complex chipset that has configurable settings will also likely have firmware that you can access. You get to it at boot-time by hitting some key combination which is hopefully shown on-screen during the boot process. Most firmware utilities are interactive, and look and work somewhat like what you're already used to seeing in the motherboard BIOS.

For example, most Dell rackmount servers have 4 different boot-time utils. The order you'll see them in is:

  1. Motherboard BIOS -- (F2) the one you've seen many times before.
  2. The Intel boot agent -- (Ctrl-s) for configuring PXE network booting.
  3. The RAID setup program -- (Ctrl-m) configure your logical RAID drives here.
  4. The BMC ("baseboard management controller) -- (Ctrl-e) this gets you into some sort of hardware management util called "IPMI".

Note that even though all your hard disks are very probably SCSI, you still very likely have an IDE CD drive (and also a floppy drive for that matter).

Your motherboard BIOS may refer to 2 RAID "channels". Channel A and B. If it does, this just means your RAID chipset has two parallel ways to talk to the SCSI chipset.

Incidentally, you may even be able to (if you like) configure your mobo BIOS to tell the RAID chipset to simply step aside and let you just have plain SCSI devices (effectively no RAID) -- a sort of "pass-through" mode. It's most common that, if you do have two RAID channels, and two logical drives, you put one logical drive on one channel, and one on the other.

Some RAID chipsets will support LVD ("low voltage differential") SCSI devices. That is, it provides an LVD power bus for the SCSI chipset (? XXX). For the drives themselves?

Finally note that Dells come with a "Utility Mode" (hit F10 at boot-time) which starts up what looks like a stripped down MS Windows dialog box giving you the options of running some Dell diagnostics, running a memory test util, and rebooting. I believe this Utility Mode is burned into the BIOS and not on any disk.

The RAID firmware

You use the RAID firmware to set up your RAID array. The two most common logical drive types are RAID 1 (mirrored) and RAID 5. (RAID 5 requires at least 3 physical drives). I suppose you could have more than one logical drive for a given physical array, but I like to keep things simple and just use 1 logical drive <--> 1 physical array.

Each logical drive will be a /dev/sd<x> device. Using your partitioning software of choice, you partition each sd<x> device into logical partitions (ex. /dev/sda1, /dev/sda2).

Typically, you might have 5 or 6 SCSI drives in a given server, with a setup as follows:

Physical arrays
inaccesible from Linux        logical drives
-----------------------      ----------------

physical array 0:
physical drive (scsi_0)  \___ logical drive 0   \
physical drive (scsi_1)  /     (/dev/sda)        \
                                                  |
physical array 1:                                 |--- RAID array
physical drive (scsi_2)  \                       /
physical drive (scsi_3)   |--- logical drive 1  /
physical drive (scsi_4)  /      (/dev/sdb)

The drives making up your RAID 5 are usually the bigger ones. 300 GB is a large SCSI drive. The other drives are usually smaller, and hold only the OS. A big one here would be 73 GB. Note that Debian does not take up 73 GB. :)

If there's a 6th drive, you may configure that in the RAID BIOS to be a "failover" drive (aka, a "hot spare"). This drive is plugged into the SCSI chain (and so would be scsi_5), but it's not part of any physical array or logical drive. It only gets used if one of the other drives fails -- and the changeover is supposed to automatic (and temporary, since you're then supposed to replace the one that failed, and let the failover drive get back to being a failover drive).

If you've only got 5 bays, you might consider simply installing your OS on scsi_0, and leave scsi_5 as the failover. Or you can forego the failover altogether.

Summary of terms

Here's some terms you may come across, mostly when dealing with your RAID firmware:

physical drive
An actual SCSI hard disk. They're referred to by their SCSI id's: scsi_0, scsi_1, etc.
array
An ambiguous term to mean either a physical array or the RAID array.
physical array
A bunch of physical drives controlled by the RAID controller. You usually divide up all your physical drives (remember, you can have up to 6 of them) into either one or two physical arrays. Note, it's simplest and most common to have exactly one logical drive per physical array.
RAID array
Your collection of logical drives.
logical drive
A partition (usually just one big one) on a physical array. A logical drive will usually span all the physical drives in a given physical array. In the RAID firmware, they're usually referred to by number: LD0, LD1, etc. Linux will see these as devices /dev/sda, /dev/sdb, etc. -- just as if they were regular physical SCSI drives.
container
Another name for logical drive. AKA, RAID container.
partition
This term has two meanings: (1) is for when you use the RAID firmware to divide a physical array into logical drives, and (2) is when you use fdisk to divide a hard disk or logical drive, say /dev/sda, into /dev/sda1, /dev/sda2, /dev/sda3, /dev/sda4, /dev/sda5. You create these logical (or extended) partitions for mounting, say, your /, /usr, /var, /tmp, and /home directories.
adding a configuration
This may be your firmware's tongue-tied way of allowing you to create physical arrays and logical drives.
initialize
Evidently, after you configure a phsical array as a logical drive, you then need to "initialize" it. I think it's analagous to writing a partition map.
clear
Your firmware may offer an option to "clear data on the hard disk". No idea what this is supposed to mean. Seems to be different from "Clear Configuration". XXX (?)
rebuild
Rebuilding is what happens after a drive fails, you pull it, and then hot-swap another new fresh one in its place. The data that was on the bad drive gets "rebuilt" on the new one you just replaced it with.
hot spare
A physical drive, not part of any logical drive, powered-up and spinning, configured in the RAID firmware to be automatically hot-swapped in in case another physical drive fails. If you don't have a hot spare, and you have a drive failure, you'll have to manually hot-swap in a spare drive.
reconstruct
This option is for changing the RAID level of a given logical drive.
check consistency
If you're using a RAID level other than zero, you've got some data redundancy. "Check consistency" checks that all redundant data "matches up".
background initialization
Total misnomer used by some firmware. After creating a new logical drive, the firmware may automatically do a consistency check in the background, which may be referred to as a "background initialization".
scrub
Possibly an older term? XXX
adapter
The RAID controller. AKA, "host controller".
channel
A connection from your RAID chipset to your SCSI chipset. Typical to see single or dual channel RAID controllers. Note: Regardless of whether your RAID controller has 1 or 2 channels between it and the SCSI controller, you still have only those 6 available SCSI ID's for your one SCSI controller.

Partitioning

Once you're done setting up your logical RAID drives (which Linux will recognize as /dev/sda, /dev/sdb, etc.), from then on Debian only sees what look like regular SCSI drives.

Your sdb will probably just be one big partition and will likely be mounted as either /opt or /data.

You'll probably want to dice up your sda like you would normally for an OS install. Possibly something like:

sda        
partition #1 sda1 / (root) 3 GB primary
partition #2 sda2 swap 500 MB primary
partition #3 sda3 (extended) (remaining space) extended
partition #5 sda5 /usr 6 GB logical
partition #6 sda6 /var 20 GB logical
partition #7 sda7 /tmp 2 GB logical
partition #8 sda8 /home 50 GB logical

(Recall that logical partitions start at #5 for old reasons. Also, you don't need to manually create extended partition #3 -- as soon as you create your logical partition for /usr, the Debian Installer partitioning tool automatically creates partition #3 for you.)

Managing your RAID array

... to do. (aacraid?)