# raid0 on root

## DaggyStyle

hello all,

my root is on a WDC 320gb 7200rpm and I'm thinking on maybe use raid0 to increase the performance, so I have a few questions on the matter as I'm not that familiar with raid0 and root.

will partitioning the drive to two partitions and joining them in sw raid0 will introduces any performance gains? my gut feeling is no because both partitions are on the same drive.

will getting another 320gb 7200rpm drive and joining both in raid0 and put root on it will increase the performance in manner that can justify this approach?

assuming it justifies it and as I'm using grub2, how many bumps I might encounter when trying to implement that?

Thanks.

----------

## massimo

'No' to 1 and 2.

----------

## DaggyStyle

no to 1 means I'm right?

can you elaborate more on why no for 2?

----------

## NeddySeagoon

DaggyStyle,

You asked if it would be worth it.

You should find the your disk read and write speed is doubled. That was certainly thw case for a pair of SATA1 drives on a Silicon Image 3112 controller.

The down side is that the reliability is halved - if either drive fails all your data is gone.

If the cost of the extra drive is worth the risk and speedup is something only you can judge.

To complicate matters, there is no upgrade path from a single drive to two drive raid0.  The drives in the raid set need to be clean before you start.

Well, if you only have a small amount of data on the drive you may be able to upgrade.

----------

## DaggyStyle

 *NeddySeagoon wrote:*   

> DaggyStyle,
> 
> You asked if it would be worth it.
> 
> You should find the your disk read and write speed is doubled. That was certainly thw case for a pair of SATA1 drives on a Silicon Image 3112 controller.
> ...

 

Hello NeddySeagoon,

Thanks for the answer, as I'm running a ~ system I tend to break it here and there so re installation isn't something I fear off.

also, as part of this possible change I'll get more hds (assuming my psu can support them) and generate a backup system which will backup root from time to time.

thing is, today, I have one drive of root, if it fails then I'm screwed, if I have raid0 on two and one fails, I still have one of them and I can recover some data and still continue working until I get a new drive.

but with raid0 I get a performance boost.

also with the prices of hds today, getting two 2 TB of 5400 for backups and additional 320gb 7200 at the same price of a highspeed/ssd drive and I get a huge amount of space.

----------

## NeddySeagoon

DaggyStyle,

With raid0 on two spindles, when one fails, you still have one good drive but none of your data.

With the default 512kB stripe size, you have 512kB on one drive, then 512kB on the other ... and so on.

With a dead drive you loose every other 512kB worth of data and metadata. e.g. if a directory is in one of the missing stripes, its gone for good.

The read/write speedup comes from the kernel reading/writing a stripe from each drive in parallel.

----------

## DaggyStyle

 *NeddySeagoon wrote:*   

> DaggyStyle,
> 
> With raid0 on two spindles, when one fails, you still have one good drive but none of your data.
> 
> With the default 512kB stripe size, you have 512kB on one drive, then 512kB on the other ... and so on.
> ...

 

I know that if one fails, I loose it all, I think I've didn't expressed myself right, what I meant is that if one fails, I can still use the backup I'll create to have a semi working system until I get a new drive.

----------

## the8lack8ox

First off let say my recommendation is that instead of a second hard disk drive I think you'd be happier with a solid state drive for your root device.  An SSD will perform better than two 7200 RPM HDDs in RAID0.  You can use your older HDD for your user data.

If you do choose to go RAID0 route, you should have your precious user data on different device outside the RAID0 array or make frequent backups.  Otherwise, you'll get burned by the crappy reliability.   :Evil or Very Mad:   It's a sad story that I read about all the time.

To answer your earlier questions, yes, throughput to the RAID0 array of two disks is nearly twice as fast as either one individually.  

Even RAID1 (drive mirroring) also would improve performance at the expense of lots of disk space.  In a RAID1, the read performance increases n times for n disks, and the write performance is always the same for any number of disks (no increase).

I personally have a RAID10 (mirroring + striping) of six disks.  A RAID10 organizes pairs of drives in RAID1 and then stripes across the pairs like in RAID0.  Thus, in my array there is a 6-fold increase in read performance and a 3-fold increase in write performance.  There is a moderate sacrifice in capacity.  The total capacity of the array is half the sum of all drives.

----------

## DaggyStyle

 *the8lack8ox wrote:*   

> First off let say my recommendation is that instead of a second hard disk drive I think you'd be happier with a solid state drive for your root device.  An SSD will perform better than two 7200 RPM HDDs in RAID0.  You can use your older HDD for your user data.
> 
> If you do choose to go RAID0 route, you should have your precious user data on different device outside the RAID0 array or make frequent backups.  Otherwise, you'll get burned by the crappy reliability.    It's a sad story that I read about all the time.
> 
> To answer your earlier questions, yes, throughput to the RAID0 array of two disks is nearly twice as fast as either one individually.  
> ...

 

ssd doesn't worth it, price is to high of the amount of space you get.

currently my user data is on a raid1, I just wondering will move from one hd to raid0 is worth it.

----------

## wcg

(Apologies for the minor hijack.)

What about raid 1 and grub? If I use raid 1 simply for

the reliability (if 1 fails, system can failover to the other

without losing anything), how do I tell grub which

drive to look for the kernel and root partition on?

----------

## DaggyStyle

 *wcg wrote:*   

> (Apologies for the minor hijack.)
> 
> What about raid 1 and grub? If I use raid 1 simply for
> 
> the reliability (if 1 fails, system can failover to the other
> ...

 

my .02c, put /boot on a physical partition and compile all the raid, hd and fs drivers as build it.

----------

## LordVan

 *wcg wrote:*   

> (Apologies for the minor hijack.)
> 
> What about raid 1 and grub? If I use raid 1 simply for
> 
> the reliability (if 1 fails, system can failover to the other
> ...

 

Yes /boot non-raid + initramfs: http://en.gentoo-wiki.com/wiki/Initramfs

----------

## DaggyStyle

 *LordVan wrote:*   

>  *wcg wrote:*   (Apologies for the minor hijack.)
> 
> What about raid 1 and grub? If I use raid 1 simply for
> 
> the reliability (if 1 fails, system can failover to the other
> ...

 

why not just upgrade to udev-182 then?

I for instance wont.

----------

## NeddySeagoon

wcg,

Grub just ignores raid.  Put /boot on a small raid1 partion, so its easy for your to maintain.

Install grub to both MBRs.

Boot will not failover where the normal boot drive dies but can still be detected by the BIOS.  In this case you have to go into the BIOS and choose the good drive as the boot drive.

----------

## wcg

OK, thanks. :Smile: 

----------

## DaggyStyle

ok, I've got another recommendation from our IT guy using raid5 and raid1 so I'd probably go that way.

Thanks for the input guys.

----------

## wcg

Note: I usually run grub from a floppy, usb stick, something external to

the data drive with the root partition. But that is only an issue for grub's

install command (I need to tell grub what storage to install to in grub's

own syntax for drives; no problem, how to do it is in the grub documentation

and in various faqs online).

Here is an example kernel line from a grub.conf:

```

title Gentoo 3.1.6

kernel (hd2,1)/vmlinuz_3.1.6 root=/dev/sdc3 ro video=[whatever I need for a framebuffer]

```

/dev/sdc1 is swap, /dev/sdc2 mounts on /boot, and /dev/sdc3 mounts on /

at system bootup. (sda and sdb are a 2.4 system that still boots if necessary.)

If /dev/sdc and /dev/sdd (third and fourth hard drives) are a mirrored pair,

is that syntax still going to work? The kernel and root partitions are definitely

going to be on those partitions if that drive is still functional, and I can change

what was sdd to be the third drive in bios if sdc fails (or use an almost duplicate

line in grub.conf for loading from sdd).

My question is whether the kernel is going to understand "root=/dev/sdc3" (when

passed to it by grub) if /dev/sdc3 is half of a raid 1 mirror.

edit:

Should be "if /dev/sdc is half of a raid 1 mirror (with /dev/sdd as the other half)".

(Thanks for the advice about having anything to do with the drives built-in and not

modular. I do that anyway, but I can see why it would be vital with any kind of raid.)

----------

## DaggyStyle

 *wcg wrote:*   

> Note: I usually run grub from a floppy, usb stick, something external to
> 
> the data drive with the root partition. But that is only an issue for grub's
> 
> install command (I need to tell grub what storage to install to in grub's
> ...

 

in that case you pass root=/dev/md<something>

----------

