HBAs and RAID controllers
Video 052 of 140 in Virtualization Foundations, in the unit “Storage devices, buses and network cards”. 4:02, with English and Hindi audio.
Many servers reach their disks through an extra card called a controller. Two common kinds are the host bus adapter, or HBA, and the RAID controller. They sound alike, but they do different jobs. One passes disks through as they are. The other joins disks together so that the array can survive a failure. This article explains each one, and shows how a controller changes what Linux sees.
What you will learn
- An HBA connects a server to storage and passes disks through as they are.
- A RAID controller joins disks into one logical disk, using mirrors or parity.
- RAID is not a backup, because damaged data is copied to every disk.
- Linux may show one disk for a whole array, so check the controller's own tool.
- Act on the first controller alert, and watch for a degraded array.
The host bus adapter passes disks through
A host bus adapter, or HBA, is a card that connects a server to storage. It does not hide the disks or join them together. In plain mode, each disk reaches Linux as it really is.
A Fibre Channel HBA reaches a storage area network, which is a separate network built for disks. A SAS HBA reaches disk shelves.
RAID joins disks into one logical disk
A RAID controller joins several disks into one logical disk, which is the single disk the system sees. Its aim is to survive a failure without losing data. Each RAID level trades some space for protection.
- RAID 1 keeps a full mirror. Either copy can fail, and the data survives.
- RAID 5 spreads data and parity across the disks, and covers one failed disk.
- RAID 6 keeps two parity shares, so it covers two failed disks.
Parity is extra data, worked out from the rest, that lets lost data be rebuilt. The controller rebuilds it onto a new disk after a failure.
Check what Linux sees
Use lspci to find the storage controller cards in the server. The filter keeps only the lines for RAID, SAS and Fibre Channel cards. The make and model tell you which management tool to use.
lspci | grep -i -E 'raid|serial attached|fibre'Then list the disks. If the controller builds an array, Linux may show one large disk, sized as the whole array, and not the physical disks behind it.
lsblk -d -o NAME,SIZE,TYPE,MODELNote: A failed physical disk can stay hidden from Linux. The controller's own management tool shows the status of each disk.
What goes wrong with RAID arrays
- Hidden disks: a RAID array can hide each disk's health from Linux.
- Second failure: a second disk that fails during a rebuild can lose the whole array.
- Cache without protection: the write cache holds writes before they reach the disks, and it needs a working battery or capacitor. When that part fails, the cache is often turned off, and writes slow down a lot.
You notice a degraded array, a long rebuild, or controller alerts. Act on the first alert, not the last.
Note: RAID is not a backup. If data is deleted or corrupted, that damage is copied to every disk.
Try it yourself
You need a Linux server with storage controllers. You will find the controller cards, then list the disks Linux sees and their sizes.
Find the RAID, SAS and Fibre Channel controller cards in the server.
lspci | grep -i -E 'raid|serial attached|fibre'What you should see: Shows the controller card, with its make and model.
List the disks and their sizes. A RAID array may appear as one large disk.
lsblk -d -o NAME,SIZE,TYPE,MODELWhat you should see: A RAID array can appear as one disk, sized as the whole array.
Terms
- HBA
- A host bus adapter, a card that connects a server to storage and passes disks through.
- RAID
- A way of joining several disks into one logical disk that can survive a failure.
- Parity
- Extra data, worked out from the rest, that lets lost data be rebuilt.
- Degraded array
- A RAID array that is running without one of its disks, while its data is rebuilt from parity or mirror copies.
- Write cache
- Memory that holds writes before they reach the disks.
Check yourself
What does a RAID controller give the system?
One logical disk that can survive a failure, using mirrors or parity.
Why is RAID not a backup?
Deleted or corrupted data is copied to every disk, so the damage spreads, and RAID cannot restore it.
Why might lsblk show one large disk for a RAID array?
The controller presents the whole array as one disk, so Linux does not see the physical disks behind it.
Previous: What a network card is. Next: What makes a server different from a PC?.