Network RAID Storage: Proof of Concept
Posted by Motoma
I recently discovered a post on Hack a Day linking to a proof of concept how-to on setting up a software RAID on FTP servers. While the guide is a simple approach to running a network based RAID 5 configuration, a number of tools the original developer used are less than optimal. First, the set up requires both Windows and Linux, meaning you will either need two physical machines, or a virtualized machine in your configuration. The second, and larger problem is that it is restricted to RAID 5 and FTP servers. This article is my attempt to alleviate both of these issues.
The goals of this project will be simple: establish a software RAID configuration that supports all of the common RAID levels, works across network share protocol, works with any number of network shares, works with different types of network shares simultaneously, and is based entirely on open source software. Simple.
To start, this proof of concept has two network shares mounted an NFS share and an SMB share:
The difficult part of this project is the process of allocating space on the remote servers in such a way that you are able to feed them to mdadm as devices. Luckily, "everything is considered a file" in Linux, and devices such as hard disks are no exception. With hard disks considered files, there is no reason why files could not be considered hard disks. The first task to complete is to set up a regular file on each share, filled to the appropriate size. In this example, each "disk" file will be approximately 1GB:
References:
- http://www.hackaday.com/2007/12/22/virtual-raid-5-internet-storage/
- http://home.arcor.de/wonderer42/
- http://cs.joensuu.fi/%7Emmeri/usbraid/
- http://www.clarkson.edu/projects/itl/honeypot/ddtutorial.txt
Post your comment
Comments
-
Glad you appreciated the article Chuck!
Posted by Motoma, 19/02/2010 5:21am (20 days ago)
-
Offensive or stupid...no. Genious...yes. Thank you.
Posted by Chuck, 15/02/2010 3:56pm (23 days ago)
-
You're right /dev/kev, neither losetup nor mdadm need partitioned devices in order to do their work.
Thank you for the correction!
MotomaPosted by Motoma, 02/11/2009 4:16am (4 months ago)
-
Surely the fdisk partitioning of the files is unnecessary? Just use losetup without any offset to get loopback devices that can be fed to mdadm... eg. something like
dd of=nfsmountpoint/image bs=1024 count=0 seek=1M
dd of=smbmountpoint/image bs=1024 count=0 seek=1M
losetup -f nfsmountpoint/image
losetup -f smbmountpoint/image
mdadm -C /dev/md0 -l1 -n2 /dev/loop{0,1}
mke2fs /dev/md0
mount /dev/md0 /mnt/tmp
Posted by /dev/kev, 28/10/2009 3:08pm (4 months ago)
-
Glad to hear it tdowg1. If you have any questions regarding this, feel free to email me (motoma at gmail).
Posted by Motoma, 16/07/2009 8:00pm (8 months ago)
-
Thanks--By seeing what the set of cmds+operations are to use, you helped me to create my first file-based/backed raid array! (I didn't impelement the nfs or smb part... )
......sweeeeeeeeeeeet....Posted by tdowg1, 16/07/2009 1:17pm (8 months ago)
-
This is the first step-by-step discussion I have found about how to set up network RAID. I am trying to do this for an iSCSI SAN I am creating. Being a linux newbie I am unsure about how to apply your solution to my problem. Currently, I have two CentOS servers running iSCSI acting as initiators and two storage boxes running iSCSI target. Ideally, there would be n storage boxes and using network RAID only n-1 boxes would be required for the data to stay available. I have successfully allowed both storage boxes to appear as disks via iSCSI on both the servers, now I have to use software RAID to make one network RAID device which I will then use inside GFS. It seems you are building a RAID device using files "masquerading" as disks, but I have iSCSI disks so should I create files that use all the dive space on my iSCSI disks and follow your steps or can I shortcut these steps as I have disks available? I intend to do some research to better understand what you are doing, but I thought there was no harm in asking. Thanks in advance for any help you can give.
Posted by Michael, 29/05/2008 1:16pm (2 years ago)
-
Is there a benchmark or something to see how well it performs?
Posted by , 29/05/2008 1:15pm (2 years ago)
-
Man, this is sweet, I've got a bunch of crap machines laying around and now I can use them to provide redundancy via a network RAID setup.
Thanks for the great article!Posted by chrisd, 29/05/2008 1:15pm (2 years ago)
-
Hi
I have realized the same concept with iSCSI protocol.
The last step is put the softraid under heartbeat control to have a fault tolerant system.Posted by , 29/05/2008 1:14pm (2 years ago)