With an expanding music collection I wanted to avoid the chore of backing up to multiple DVDs by building a RAID server so that at least a hard drive failure would not compromise the collection. This has not been as simple as I had hoped.
Mistake 1: I bought a motherboard specifically because it supported RAID5, but then decided I could not afford 3 disks and ended up using RAID 1. And anyway Linux can use software RAID rather than the Windows driver-based version supported by the motherboard.
I tried a number of approaches before this particular combination worked for me. I am sure there are other more elegant ways of achieving the same end, but hopefully my experience will save somebody else some time.
This is a completely new system which has never been formatted. The key components for the installation are
- 2 identical 500GB SATA drives
- 64-bit PC (AMD64) alternate install CD for Xubuntu 7.1
- motherboard with AMD 4400+ processor and 1GB DD2 RAM
The main trick was to persuade the installer to give the options to set up the RAID array during installation. To get the options
- boot from the alternate installation disk
- at the main menu hold down F6 (options) until you get the choice of Normal and Expert mode
- choose Expert mode
- it can be worth a “dry run” in normal mode to get used to the principal installation options, but I could not see how to install a RAID system that way
- start the installation
- the console-based system is pretty tedious and I accepted the defaults for every step except …
- when offered the choice to load additional modules choose the MD multi disk option
- I am writing this from cryptic notes taken during the process so I am not sure of the exact names, but the key one is the multidisk option
- The configuration I chose does not use LVM but I did selectLVM at this stage. I am not sure if it was ever used.
- when the partitioner starts choose manual
- My configuration was to create a single big partition on both disks, for the RAID and a small swap partition on both disks which are left “un-RAID-ed”. This is not completely fault tolerant, but should be pretty easy to recover
- select the disk to partition
- create the main partition and set the Use As option to “Physical Volume for RAID” and set to be bootable
- create the swap partition and set Use As option to “swap”
- (the following is what I noted down, but may be because I did not read the screen properly)
- after specifying the partitions on both disks choose the option to write the changes to disk
- a warning message was displayed that there was no active partition
- choose continue
- the partition manager page is displayed again but with a new option at the top to build the Software RAID
- Software RAID installation is done through the MD administration module you added to the installation earlier. The options I chose were
- RAID 1
- as /dev/md0
- 2 drives
- no spares
- sda1 and sdb1
- When complete the MD administration returns you to the partitioner but there is now a new device to partition, a “RAID device.” Partition this as usual
- file system ext3
- mount at /
- (the bootable option is not available)
- Write the changes to disk in Partitioner and this time there is no warning
- The installation process continues as usual
- When the GRUB installation page came up I chose the default option, i.e. install in the master boot file of hd0.
- This means the the RAID array will probably not boot if /dev/sda fails
- If /dev/sda does fail the plan is to rewire /dev/sdb as /dev/sda (i.e. switch the connectors) and make it bootable with a rescue disk.
- The RAID array would have to be rebuilt manually after adding a replacement /dev/sdb
- The Xubuntu system now boots as normal with md0 as the active partition
The installation now appears to be operating properly and I have begun setting it up as a our local server. Running cat /proc/mdstat suggests that RAID1 is working fine, and df shows a root partition on /dev/md0 which is the right size, but otherwise it is completely transparent.
As I have explained, the procedure above was the result of several abortive attempts to install a RAID filesystem and get it to boot. During these experiments through to my eventual success I used the following pages and posts that provided help, reassurance and inspiration, even if I was not always able to follow their advice. Thanks to all those who took the trouble to share what worked for them.
- Setting up software RAID in Ubuntu Server which showed that the key was getting the partitioner to so what I needed rather than just of “normal” mode options (this might suggest I should have used the ubuntu distribution installer not xubuntu)
- Software RAID HOWTO – Ubuntu 6.10 (Edgy Eft) which shows how to install RAID as the data portion of the server rather than the root partition (now that might have been a better option).
- Software Raid on Ubuntu and Debian which has also advice on getting GRUB to work (but I have not experimented further with this)
- Installation/LVMOnRaid the Ubuntu Community Documentation page that most closely matched what I wanted to do, but it was not a very good match