This last week I had to rebuild my home desktop. It’s a long story, but after combining parts from various desktops around my house and replacing a bad power supply, it just felt like I should go ahead and tackle getting Linux to work with my NVidia Software RAID. And like most tech guys, I went for a high geek factor and chose RAID 0. Yeah, I like walking on the edge!
First, I did some googling around to find some basic instructions. I found this great wiki page on Ubuntu’s site.
Of course, I started by installing Windows XP first. This was simple enough–I had long ago slip-streamed a Windows XP CD with Service Pack 3 and the necessary NVidia RAID drivers. I must admit, a clean install of Windows XP is fast. It booted in under 20 seconds and felt great once logged in. Too bad it won’t stay that way.
Next, I booted my Kubuntu 9.04 64-bit Live CD. I’m still up in the air on Gnome and KDE 4. I love some of the innovation in KDE4, but boy, it can be squirrely. Still, I was up for a change. Needless to say, I had to boot using the safe graphics mode to avoid lockups on the live CD.
Once in KDE, it was time to activate the software RAID using the handy dandy dmraid. Open a terminal and type the following commands:
apt-get install dmraid
dmraid -ay
ls -l /dev/mapper/
Assuming your RAID chip is supported, you should see it detect and activate your RAID devices. In my case, I had the following devices:
nvidia_bbadaehe
nvidia_bbadaehe1
The first entry is the RAID drive. The second is the first RAID partition for Windows XP.
I should note that there was one thing that threw me off from the HowTo on Ubuntu’s site. In their examples, they had the following for the RAID device:
Rest assured, it’s accurate–no fault of the tutorial. But the _five threw me off. I think my sub-conscious mind assumed it was referring to the partition and not the RAID device itself. I know, it was silly, but it caused me problems as you will see later.
With the devices now available, proceed with the install of Kubuntu using the Install icon. This is where things will deviate from the HowTo: the KDE installer does not appear to have the option of skipping the boot loader installation as described on the Wiki Ubuntu. I ignored this fact and let her rip. Because of this, the KDE installer WILL CRASH at the end of the install, but have no fear, we’ll fix it. If anyone knows how to get the installer to skip the boot loader install, please comment.
When you create your partitions during the install, make sure you create them on the RAID device and not on /dev/sda.
In my case, I ended up with the following partitions:
- nvidia_bbadaehe1 – Windows XP
- nvidia_bbadaehe5 – swap
- nvidia_bbadaehe6 – /
- nvidia_bbadaehe7 – /home
Note that 2, 3 and 4 were used for extended partitions, etc.
After the KDE installer crashes, it is time to manually install grub per the HowTo. I executed the following commands:
mount /dev/mapper/nvidia_bbadaehe6 /target/
mount --bind /dev /target/dev/
mount -t proc proc /target/proc/
mount -t sysfs sys /target/sys/
cp /etc/resolv.conf /target/etc/resolv.conf
chroot /target/
I’ll stop here because there was a step missing from the wiki that was necessary for the apt-get update step. I had to do this to avoid errors with dbus:
No you can proceed with the wiki steps:
apt-get install -y dmraid
apt-get install -y grub
mkdir /boot/grub
cp /usr/lib/grub/x86_64-pc/* /boot/grub/
grub --no-curses
Now, this is where my little brain fart above caused me grief. The first step once into grub is:
I, however, incorrectly used /dev/mapper/nvidia_bbadaehe6, and naturally started getting Error 15 messages and complaints about the partition table. So I walked away instead of smashing my keyboard (which is my favorite thing to do).
When I returned, it was painfully obvious that I need to use nvidia_bbadaehe. So my (working) commands were:
root hd(0,5)
setup (hd0)
quit
Once back to the prompt, we update grub with:
Next, I updated my menu.lst file as suggest on the Wiki. I won’t repeat those instructions, but everything there seemed to be accurate.
What followed next was extreme frustration. This is where the Wiki derails considerably. On the Wiki, they have you add dm-raid4-5 to /etc/initramfs-tools/modules. However, I found I needed to add dmraid instead.
Further, AND THIS IS VERY IMPORTANT, there remains a bug in the dmraid module whereby it does not correctly add the devices as part of the boot process. A script is needed. Before rebooting, you will need to create the script:
The contents of the script should be:
PREREQ="udev"
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
/sbin/udevadm settle --timeout=30
modprobe -Q dm-mod
modprobe -Q dm-mirror
[ -x /sbin/dmraid ] && /sbin/dmraid -ay
Save the script and chmod the file to be executable. You can now reboot and enjoy Software RAID 0 and blazing boot times.
As a final note, I highly recommend creating a backup image of your partitions once you have them the way you want them. I use sysrecuecd and partimage. It works great and I was able to backup all my partitions to a USB drive. And, of course, a daily backup process is recommend with RAID 0.
Once I’ve received some feedback, I’ll circle back around to the Wiki and add my comments. So please, comment and let me know where I’ve got it all wrong.