appliance

Software-Raid

Using software RAID in trixbox

Setting up software RAID in trixbox is simple:
1. Install 2 identical SATA or SCSI drives in your server.
2. Disable any onboard RAID features in your motherboards bios if it has them.
3. Boot from the trixbox CD (2.x or higher)
4. Type sataraid at the installer prompt and press Enter
5. All data is erased and trixbox is installed - DONE!!!
If you have IDE check out this thread

Verifying RAID status

Verify your RAID by installing webmin (yum install webmin at the console) and going to:
http://trixboxIP:10000 - login as root, then click Hardware>>Linux RAID

or you can type cat /proc/mdstat at the linux console and it should show 3 partitions as 2/2 if they are all in working order.

Rebuilding

You installed trixbox with the sataraid option, and think you have lost a drive:

Background info- Here is how your partition structure is laid out:

100mb Boot Partition: /dev/md0 = /dev/sda1 + /dev/sdb1
1 or 2GB Swap Partition: /dev/md1 = /dev/sda2 + /dev/sdb2
Root Partition (aka- rest of the drive): /dev/md2 = /dev/sda3 + /dev/sdb3

sda and sdb are your first and second sata or scsi drives, if this is ide they will be hda and hdb, then the numbers equate to partitions on those drives.


Step 1. Lets check status of your drives:
Login to webmin as root http://trixboxIP:10000
Go to Hardware>Linux RAID and click on /dev/md2 - this will show your root partition and you will see:
Partitions in RAID: SCSI device A partition 3
SCSI device B partition 3
(but one of these will be missing if there has been a hardware failure)

Step 2. If there is a drive missing, look at the sata ports on your motherboard and find the labels, if you lost drive A, you most likely need to replace the drive plugged into SATA port 0, or for drive B, Port 1.

Sometimes you may not need to replace the drive(a sudden power outage could break an array without damaging drives), but simply put the partitions back in the array (See Step 4).

Step 3. If you have a blank drive that you need to rebuild from you can easily create the partitions in Webmin:

In Webmin go to: Hardware>Partitions on Local Disks

Click "Add primary partition" on the empty drive, the type needs to be Linux RAID. Add 3 partitions with sizes equal to your existing.

Step 4. Go to Hardware>Linux RAID in Webmin and add the new partitions back into the md groups. Just click on each md device and you will have the option to add partitions into the array. Just make sure to match the appropriate sdxx partition with the right mdx group as shown in the structure above. Start with md0 and work your way up, the first 2 will rebuild within seconds, and root will take anywhere from 20 minutes to 3-4 hours.

You can then watch the rebuild status from the console if you like:
watch cat /proc/mdstat

Since it is software raid, a little more work is involved, but its still fairly easy.

This can all be done from the command line as well, anyone having tried it feel free to post a guide.

Tips on Software RAID

This should be good for installs having 1-40 simultaneous calls, if you plan on having anymore you would most likely want to use a Hardware RAID controller as they are more robust in terms of drive recovery and put no load on your server. While software RAID may easily handle 50-80 simultaneous calls without hiccups- its just not a good practice.

Hardware RAID means a physical card in your server, not an onboard controller that is built in to the motherboard - 99% of these onboard controllers are actually software RAID cards that use a driver (normally only available for Windows OS) which performs most of the RAID functions using the systems CPU - meaning it might as well be Linux Software RAID. Unfortunately these onboard controller are NOT (99%) supported with Linux drivers, but if you disable the RAID features in the BIOS, Linux will see them as just a normal drive interface and load a standard driver and you can go on to perform the above process.

If you have IDE drives, you will need to do a custom install as outlined here and also here.


Wiki Home|Tutorials|Troubleshooting|Additional Scripts and Tricks|Hardware