[Discuss] samba devices and RAID

taras taras.judge at shaw.ca
Fri Nov 10 13:15:16 PST 2006


pw wrote:
> hello,
>
> Is it possible to use two SMB devices as a software
> RAID set? For example if there are 2 x 2TB NAS devices
> on the network, can I mirror one to the other using RAID?
>
> I was thinking of having two disk image files
> mounted as loops
>
> ie:
>
> #mount NAS drives that contain the disk images as files
>
> mount -t smbfs -o username=yadda,password=tadda //NAS1/share /smb1
> mount -t smbfs -o username=yadda,password=tadda //NAS2/share /smb2
> mount -t smbfs -o username=yadda,password=tadda //NAS3/share /smb3
>
>
> #mount the disk images as loop devices
>
> mount -o loop=/dev/loop0 /smb1/disk-image fs
> mount -o loop=/dev/loop1 /smb2/disk-image fs
> mount -o loop=/dev/loop2 /smb3/disk-image fs
>
>
> And then use those loop devices as devices for the
> mirrored raid.
>
> vi /etc/raidtab
>
> <i>
>
> raiddev /dev/md0
>         raid-level      1
>         nr-raid-disks   2
>         nr-spare-disks  1
>         persistent-superblock 1
>         device          /dev/loop0
>         raid-disk       0
>         device          /dev/loop1
>         raid-disk       1
>         device          /dev/loop2
>         spare-disk      0
>
> <esc><wq>
>
> mkraid /dev/md0
using raidtools is silly. Learn mdadm so you don't show your age :)
>
>
> Stupid idea? Any thoughts?
Dear pw, would I ever describe your ideas as not stupid? All kidding 
aside, the NAS would become tied to your one host(where you init the 
raid) and would be very slow since you'd be doing 2 writes for every one 
usual write. Plus you'd have all kinds of funny caching issues since 
there god knows how many caches inbetween smbfs and the raw disk on the NAS.
For examples on how to do stupid raid tricks with loop stuff see 
http://www.n8gray.org/blog/2006/09/05/stupid-raid-tricks-with-evms-and-mdadm/

Taras


More information about the Discuss mailing list