# [SOLVED]Raid, lvm or sth else? Need advice :)

## Yatmai

I want to create one huge storage from 2 partitions - each of diffrent hdd. I know, I can use raid0, raid linear or lvm, but which method will allow me to recover any data from partition A, when part B fails?

I don't want to recover all - some data from that storage will be on disc A, and some on B. Then if ie. B fail (Tux bless out storages  :Wink:  ) I would like to recover data which was on disc A.

Is there any method, which allows that?

----------

## mgrela

Neither LVM nor RAID won't help you achieve the result you want. LVM only combines block devices into larger ones so when one of your drives fails you will loose half of your filesystem. On the other hand, havin RAID with only two drives doesn't make much sense. Just create a filesystem on each hdd and mount them as subdirectories of a common mountpoint, ie. /mnt/storage/hdd0 and /mnt/storage/hdd1.

br,

----------

## dirk_salewski

 *Yatmai wrote:*   

> which method will allow me to recover any data from partition A, when part B fails?

 

A Raid1 (mirror) combining partitions A and B into one device would do that. You will obviously loose 50% of the combined space, since each file will be mirrored on each of the partitions. You would have a single device "/dev/mdX" afterwards. If your partitions are quite large (e.g. both 50G) then your single device will be large, too, so on top of this device you could then use lvm to make smaller and better manageable chunks of it.

----------

## Yatmai

I know, but I already have raid1 matrix for most important data  :Smile:  The storage, I was talking about is about 400GB, so 50% lost from this would be too much.

----------

## fangorn

You have some options then

Easiest: as mgrela already wrote, mount them into subdirectories and do the splitting yourself.

or: buy another drive and do RAID5 (will loose you the capacity of the new drive only)

or: buy a drive big enough to hold all the data and do RAID0 (or LVM for that matter) with regular backups. 

The backup is advisable anyway, regardless if you choose LVM, RAID0, RAID5 or two mountpoints. The best RAID can only protect you from failing hardware. Not from errouneous software, user-malfunction  :Twisted Evil:  or other possible reasons for lost data.

----------

## mgrela

Have you seen mhddfs ?

http://debaday.debian.net/2008/05/25/mhddfs-join-several-real-filesystems-together-to-form-a-single-larger-one/

----------

## Yatmai

 *mgrela wrote:*   

> Have you seen mhddfs ?
> 
> http://debaday.debian.net/2008/05/25/mhddfs-join-several-real-filesystems-together-to-form-a-single-larger-one/

 

Awesome  :Very Happy: 

I've done some quick performance tests. 4 partitions ~250MB in raid linear array vs mhddfs - copy from another partition 800 files, 1MB each. 

Matrix - 49s, 48s

Mhddfs -  50s, 51s, and after I set mlimit to 100Mb - 48s

Well, I was worring about delays from fuse, but results are very positive and migration to mhddfs will be much easier than to raid or lvm.

Thanks for sugestions, 

Dzięki Maćku  :Smile: 

----------

## mgrela

Your benchmarks seem to be very promising  :Smile: . I thought, that a fuse solution would be much slower. But then maybe it is time to move out all the filesystems from the kernel to userspace  :Wink: . Now I'm almost certain I will use mhddfs on my own storage box when I spare some time to build one.

br,

----------

## szczerb

In case someone didn't find this already, here is a pretty fresh (3 days old) ebuild:

https://bugs.gentoo.org/show_bug.cgi?id=220451

----------

## beandog

Oh man, this is super awesome ... I can't wait to do some testing on this.

I've been looking for a solution to form one directory out of multiple USB drives.  LVM/RAID obviously wouldn't be a solution, but I'm willing to bet this could take it to task.

----------

