Hardware RAID 1 on Ubuntu
November 26, 2007 4 Comments
The system I was trying to install RAID 1 had an Adaptec 2500S hardware RAID card installed on it. Therefore, I did not need to deal with software RAID. The system had two Pentium III processors, 3 GB memory, and two SCSI hard drives with approximately 20 GB on each of them. Since it was a hand-me-down system, the hardware card had been installed and configured already. Let’s call this computer ‘raidtest‘.
When raidtest boots up, the user gets an option to hit Control+A to enter the RAID setup utility. There I deleted the previous configuration and created a new one. This one now had two drives and these were set up for RAID 1. The process was quite simple and without any fuss. However, I was unable to set up the option of drives being removable because I could see no way how to. I would have liked to set this option and test what it did and how it did. If you can help us out here, it would be appreciated.
RAID on CentOS
I intended to install CentOS on it because I wanted to learn to use it as well. However, CentOS 5 was unable to recognize the RAID at all. It just said ‘no’. So I downloaded CentOS 3.9 server and popped it in. It was able to recognize the hardware and said it was going to load the driver. But this is where the installation just hung up and would not get out of its stuck state. Even CTRL+ALT+DEL would not work. So I just gave up CentOS.
RAID on Ubuntu Server
I also did an installation of the Ubuntu 6.06.1 Server LTS on the same machine. However, upon successful installation, the boot up process would hang up saying that I2O was already in use. Research (wrong /etc/fstab when installing on RAID using Adaptec 2100S) showed that this problem existed in Debian where installation and boot names for the same devices were different. I even tried out the install image but it did not work for me. So I gave up the thought of either Debian or Ubuntu Server.
RAID on Ubuntu Desktop
I used the ‘alternate’ installation CD for Ubuntu 7.10 (Gutsy Gibbon) since the ‘desktop’ version would not boot properly. I have no idea why. Ubuntu not only recognized the RAID hardware as a single disk, but also installed fine. I installed it as if it was a single disk as well using guided partitioning.
During the first boot process after the installation, I saw some weird error messages saying I2O could not be configured (or something like that) but the computer worked fine. I restarted the machine a few times and everything was working.
I knew that the BIOS (?) setup of the RAID did not enable drives to be ‘removable’. However, I needed to test what would happen if one of the drives failed. So I took one drive out while the system was running. The system ran fine so I put the drive back in. However, the drive I had pulled out would not work. All reads and writes on the disk were being done on the drive which had been left untouched. I expected the RAID controller to rebuild the failed drive automatically but could see no evidence of it.
I then turned off the computer, took out the working drive, put in the ‘failed’ drive, and booted up. No luck. Ubuntu would not boot. So I put in the working drive, took out the ‘failed’ drive, and booted up. Ubuntu worked flawlessly. Even now the RAID array was not being rebuilt. I had to do something.
Cold-Boot RAID Array Rebuild
I rebooted the computer and hit CTRL+A at boot time to enter the Adaptec RAID configuration utility. There I saw that the ‘untouched’ drive’s status was ‘optimal’ while the ‘failed’ drive said something else (I forgot what it was but it indicated that there was some problem). So from one of the menus of the configuration utility I chose to rebuild the array. Suddenly activity lights for both drives began to blink in unison and the status on the configuration utility showed a progress bar of the rebuild process. Once it was done, the computer worked well off both drives, together or individually.
Online RAID Array Rebuild Using
I came across an Ubuntu package called raidutils. It contains I2O RAID management utilities. So I installed it by
sudo apt-get install raidutils
Once it was installed, I had no idea how to use it. So a few web pages helped me out. Manpage of RAIDUTIL was the first. This showed me that although the package is named raidutils, the command actually is
raidutil; notice the absence of ‘s’ from the name of the command. So I ran the following
raidutil -L physical
But I got an error; Engine connect failed: Open. So I tried the following
sudo raidutil -L physical
Which produced a whole new error; Engine connect failed: COMPATIBILITY number. This is where I2O on Linux – FAQ was very helpful. I ran the following two commands
sudo mknod /dev/i2o/ctl c 10 166
sudo modprobe i2o_config
And then I ran the first command again
sudo raidutil -L physical
Now I did not get any errors and saw the physical devices of the RAID system. However, I wanted to get a way to be able to rebuild an array while the system was running. Here again a web page was extremely helpful. Monitoring RAID with NetSaint had useful commands. I used them as follows:
sudo raidutil -L logical
The RAID was ‘optimal’. So I took one drive out of the system again and ran the command again.
sudo raitutil -L logical
This time the status was ‘degraded’. I put the drive back in and ran the command yet again.
sudo raitutil -L logical
Alas, the status was still degraded. To reconstruct RAID, all I had to do was run the following command
sudo raidutil -a rebuild d0b0t0d0
Where d0b0t0d0 was the Address of the RAID system. Yours could be different. But how did I get this piece of information? From the command
sudo raitutil -L logical. So I ran this command periodically and it showed the status of the RAID reconstruction. Once the process was completed, activity lights on both disks blinked together which I took to mean the process was successful.
I then restarted raidtest and what do I see? I am unable to run the raidutil command without getting the error: Engine connect failed: COMPATIBILITY number. So I look on the Internet and find a post (What directory to drivers go into) which tells me to modify the
/etc/modules file. So I did just that, using the following process:
sudo vim /etc/modules
Add the following at the end of the file, on its own line, of course
Then save the file. I restarted and ran the
raidutil command. It gave me results immediately and successfully. What did I learn? You have to load the
i2o_config module at startup to be able to use
raidutil. Otherwise you have to manually do it every time your computer reboots.
Testing the RAID
It is a very unscientific test but BitTorrent is fairly disk-use intensive. So I just downloaded a BitTorrent client: Deluge.
sudo apt-get install deluge-torrent
And then I started a few torrents of Ubuntu and CentOS ISOs to make sure the drives were working together and working well. I intend to put the new system through its paces before trusting it enough for everyday use.
My experience with hardware-based RAID has shown that it is quite simple to use and troubleshoot. Whatever I have seen of software RAID looks simple enough. Maybe one day I will try that as well.
The following tips should help you out:
- Make sure that the controller you use is well supported by Linux and also by the distribution of your choice.
- Make sure that you know how to configure it at the BIOS level. This also includes reconstructing an array.
- Find out what utilities are available from Linux to monitor and manage the RAID.
- Test your system for failures and how to recover from them.
- Once everything is working fine, test the whole system by doing some disk intensive tasks.