# Semi-newbie software RAID questions....

## digitalamish

I have a bunch of spare drives laying around, and I was thinking about playing around with RAID.  I've been trying to decypher some of the docs I have found, and I have a few basic questions I can't seem to find answers for.  I'm hoping someone here will take some pity on me.

My first question is on a RAID-0 configuration.  I have two drives, one is 60 Gig, the other is 120.  I was going to set them up in a RAID-0 config to give me one drive of about 180 Gig of space.  My question is based on the connections to the IDE bus.  I've seen some docs talking about RAID-1 configs NOT using the same connector (drives should not be on the same physical cable, master/slave config) because of performance.  Is this true for RAID-0?  I know it would be better if they were on separate channels, but CAN they run in the same channel, without awful performance?

OK, so that is the RAID-0 config.  Now, I actually have 2 sets of drives like that (2 80's, 2 120's).  If I can get a RAID-0 config on one channel, could I then take two RAID-0's like this and put them into a RAID-1 config?  I'm thinking of having one RAID-0 on each channel, so the RAID-1 would be on two separate channels.

Is this a do-able setup?  I have a second PCI IDE adaptor, that unfortunately doesn't have RAID in it (it was on sale).  I'll have a could of other drives on the MB IDE bus, and then this poor man's array on running on the card.

Any insights would be helpful.  If anyone has any links to how-to's or examples of this, I'd appreciate it.

d

----------

## adaptr

First of all, you cannot set up a RAID-0 array on drives of disparate sizes - they will only use the portion of the bigger drive that corresponds to the size of the smaller drive.

The reason for this is that RAID-0 uses a striping mechanism to achieve its speed - they are not simply concatenated together to form a bigger drive, they are interleaved so every access goes to both drives for a theoretical doubling in speed.

Having said that, you can set it up on two drives of disparate sizes, and use the remaining space for something else.

Personally, what I would do is either set the same-sized drives up in a RAID-1 array (it will work faster if they are on separate cables, but the difference in performance depends on the original speed of the drives)

or use all of the drives in a RAID-5 array.

And yes, you can set it up like you suggested - two mirrored RAID-0 "arrays" - but the failure rate of a RAID-0 is higher than that of a single drive!

This means that the failure rate of a mirrored RAID-0 is higher than that of a single mirror.

If speed is what you want out of it then set up 2 RAID-0 pairs with drives of equal size - you will not lose any space, and you can set them up on different channels, which does maximise the speed.

----------

## NeddySeagoon

digitalamish,

First, there are two different sorts of RAID Software or Hardware.

In hardware raid, a special chip or card does all the hard word of sorting out waht data goes where and organising the two writes to a mirror set. 

Software raid comes in two sorts too. BIOS raid, where the BIOS provides the software for the software raid and kernel raid. 

If dual booting is an issue you may not use kernel raid.

Kernel raid does not need any support from hardware. 

There are two implementaions of raid0. Linear and Striped.

Linear stackes the drives end to end, so they appear as one big drive.

Striped writes blocks to alternate drives.

You may raid more than two drives too.  

Commands on the same IDE bus cannot be overlapped, so the speed benefit of multiple drives in raid0 is not realised if the drives are on the same cable.

Which raid setup is right for you depends on your aims. How much data you lose for a single drive failure depends on  the setup too.

----------

## digitalamish

Thanks for the info adaptr.  Basically I am just looking for a combination of speed and redundancy.  Right now I just use single drives, but with all of these spares, I thought I could play with some better protection and performance.

A couple of followups (anyone jump in here).  Basically having two disk at 80G, and two disks at 120G, if I were to set up a RAID-5 array, using the formula (# drives - 1) * smallest drive I'd see an drive of about 240G, right?  I guess that's better than my false 'stripe and raid-1' idea that would have yielded about 200G.

Since I'd only be using 80 gig out of 120 on two drives, could I still access the 'extra' space for other drives, or is that not possible/a good idea?  Would having all 4 physical drives on two IDE channels a concern?  I'm not looking for world class performance, but I don't 

Anyone else play around with this and have some tips?

----------

## NeddySeagoon

digitalamish,

On Linux you don't raid drives, you raid partitions.

Linux will do striped raid0 on different size drives too but you don't get the stripes off the end of the samll drive.

Putting two drives of a raid5 set on the same IDE channel is a bad idea. If the controller fails, it can trash the data on both drives, so you loose everything.

A safe configuration would be an 80G and 120G in linear raid0 on each IDE controller, then the two raid0 linears put into a raid1 set.

That way you can loose a controller (and the pair of drives) and still not notice. You don't get any slowdown because there should never be any writes to both drives on the same channel.

Unless you want the join to be invisible, there is nothing to be gained by using raid0 here. Partition both pairs of dirves the same and raid1 the resulting partitions.

----------

## digitalamish

 *NeddySeagoon wrote:*   

> digitalamish,
> 
> A safe configuration would be an 80G and 120G in linear raid0 on each IDE controller, then the two raid0 linears put into a raid1 set.
> 
> 

 

OK, so I was thinking I could probably go out an grab another controller for $20-$30.  If I put in a second controller, giving each of the 4 disks their own channel, is RAID-5 worth looking into, or is it overkill?

Bascially I am not looking at a mission critical system here (bascially my home web/mail/file server), this is just a 'fun' project to play with.

----------

## NeddySeagoon

digitalamish,

Play away. I think I would play with RAID 5, even  if its over kill

----------

## digitalamish

Thanks Neddy...

Here is what I have come up with.  I am going to put in a PCI IDE card, so I have 4 independant channels.  I am going to put 80G partitions on each of the drives, and RAID-5 them.  In addition I am going to use the extra space on the 120 Gig drives to create the partitions for Linux (swap, boot, maybe /home), then RAID-1 the boot and /home (mirror) to the empty partition on the other 120G drive, and create a swap space.  That way if any one drive fails, I still have the rest of the system.  I can swap the boot flag to the other drive, and everything should pick back up.  I'm not sure sure if I am pushing too much on the drives or not.  I may even consider throwing in an old 40G drive (why do I have some many spare drives?) and RAID-5 the boot and home.

I found this Wiki entry on Raid installs, and I think I'll give it go!

http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID

If anyone has any other tips, I'd appreciate it!

d

----------

## JDSANCHEZ

Can you put a swap on raid? It would seem that you would get better performance from your system when your physical memory gets full than a non-raid swap.

----------

## digitalamish

 *JDSANCHEZ wrote:*   

> Can you put a swap on raid? It would seem that you would get better performance from your system when your physical memory gets full than a non-raid swap.

 

According to this site:

http://www.tldp.org/HOWTO/Software-RAID-HOWTO-2.html

 *Quote:*   

> There's no reason to use RAID for swap performance reasons. The kernel itself can stripe swapping on several devices, if you just give them the same priority in the /etc/fstab file.

 

It says it can be done, and there are arguements both ways, but it's not required.

----------

