# Adding disks to a RAID 0 array

## samsari

I have been trying to tidy up the nightmarish collection of partitions I have managed to accumulate over the years. I decided I would try and make two or three RAID0 arrays out of them, partly for neatness and partly for coolness. Also, the pc is going to become a fileserver, so I thought this might make it faster.

The problem I have is that some of the partitions have data on them already and I don't want to lose it. Obviously, I know that creating a new array will destroy any data on any of the component disks. I have 3 250gb disks, which I want to make a 750gb array out of. I've managed to squeeze all the data from them onto one, so 2 of the three are empty now.

My question is: is there any way I can make an array out of two of them, copy the data from the last disk onto the array, then add the third disk to the array, WITHOUT losing the data? Remember, this is a RAID0 I'm trying to make...

I've tried doing it in mdadm, but it doesn't seem to work, and searching this forum and on google doesn't turn much up either. Is this even possible? If I think about it logically, I start to think it might not be, but this is the 21st century!

If not directly possible, could I make a RAID1 array first, then turn a RAID1 into a RAID0 after the fact? Or any other roundabout way?

Any way to do it would be extremely gladly received  :Smile: 

----------

## NeddySeagoon

samsari,

You can't do any of that. 

To add a new partition to a raid0 array, you need to move all the data around on the existing drives. You also need an extensible filesystem because the underlying file system has to change to describe the new space.

Raid0 is a nice toy but won't make your sever any faster than than single drives since the data bottleneck will be the network.

----------

## samsari

Hey, thanks for the fast reply.

Hmm, I hadn't thought about the fs issue, that does scupper it a little. However, I had sort of hoped that the software raid mechanism might be smart enough to do the rearranging of the chunks itself (would obviously take ages, but you only need to do it once). Any other suggestions? in this case, I may just have to make it a 500gb raid5 instead...

As for the faster thing, I know it wouldn't make much difference in specific cases. My network is 54g, which is about as fast as one of the disks, and in fact my laptop is only a 5400rpm disk. But where it would make a difference, I believe - correct me if I'm wrong, is when more than one person is trying to access files on the server. If both myself, and my two flatmates are all copying a file off the server, or are watching something being streamed from the mythtv backend, would it not help to reduce one of the bottlenecks at least?

r

----------

## Vlad

Not really.  While video is relatively high bandwidth, true, you're more likely to have dropouts due to wireless issues than due to the hard disk being unable to stream two of you video.  Nevermind that 802.11g rarely approaches 54 mbps even under optimal conditions.

If you're going to use RAID0 here, it's going to be for space, not for speed.  If I were you I might drop a bit more cash, get another 250, and RAID5 the drives - then you'll have enough speed, redundancy, and a good amount of disk space.  Of course you'll need to move all the data off of it in the interim, though...

----------

## NeddySeagoon

samsari,

54g is 54Mbits/sec half duplex under ideal conditions. Thats 6.75 Mb/sec shared by everyone.

Given the half duplex nature of the radio link, tcp will be nowhere near that speed because of the need for acknowledgements to be sent.

There is also the network overhead, which means not all the bandwidth is useful.

All your drives will easily keep that network busy on their own - no need for raid.

You can set up redundant raid sets in their degraded mode and add the last disk later. 

This means you can set up a n disk raid5 with only n-1 drives, copy your data over and add the drive your data was on the the raid ser to bring it up to full strength

----------

## samsari

Okay, thanks for the advice  :Smile:  I guess what I'll do then is make a 500gb raid5 array instead. Extra peace of mind...

What I was mainly thinking about when I was talking about speed, mainly, was when two or more people are all trying to access different files off the same disk. That sort of thing really runs it into the ground, and last time I tried it, ended up giving transfer rates way below the network bandwidth. I was hoping that a faster raid0 array might just cope with multiple requests a little better than a single disk. Much like extra read-heads make random reads off single disks faster...

----------

## eccerr0r

File serving for multiple users is tricky.  What is the data access pattern like and what kind of data?

Typically RAID0/RAID5 is great if you can buffer a lot of data to absorb head access latency.  If you know your access will to be a lot of small data files randomly distributed across the disk, you may get better access speeds if the heads can be decoupled.  With an average stripe size, RAID0/RAID5 the heads tend stay near the same spot on all disks all of the time if you're serving large files - which may be terrible for lots of scattered files. Your stripe size and buffer sizes may be optimized for your workload but will hurt others.

What are you trying to serve for?  Are you more concerned about burst/stream speed or latency?

----------

## Akkara

Is there a spare hardwired ethernet port on your machine? Two physically separate connections into a server is the best for serving high-volume data to multiple destinations.

If one of your clients is close by running a wire to it would be the best option, while leaving your other client(s) to go over wireless.

(Additionally, I've never been much of a fan of wireless except for low-bandwidth convenient browsing of the web.  Its 6 MB/sec on a *very* good day makes even a slow USB drive seem fast by comparison.)

----------

## samsari

Aha, good thinking, both of you.  :Smile: 

What I had in mind was a mythtv box, doubling as a fileserver for the many tv episodes and movies that I have... (ripped off all the DVDs that I own, of course... *ahem*). So in that case, it would be large, contiguous files being either copied to the client's pc to be watched locally, or simply streamed across. 

One client at least might be within ethernet range, whilst at least one other would need to be wireless. But that would definitely be a good solution to increasing the network bandwidth. The only other reason to raid disks together would be to make one single disk where everything could fit, rather than trying to spread things over several disks (neatness, tidiness and convenience mainly).

As I said, I'm only looking for enough speed to make transfers fast enough to make coying the whole file over before watching it unnecessary. Last time I tried this, watching a file directly off the samba share was impossible as (I assumed) the disk/samba/wireless combination couldn't keep up. I was the only client accessing the server at the time, two clients might have killed it  :Smile: 

----------

