Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a new FreeNAS server this weekend with pretty good success, but I am stuck on one last issue.

Right now I have 2x 1.5 TB drives that I want mirrored (I was planning Software RAID 1) for a total of 1.5 TB usable space.

I need to be able to access the data from the drives via SMB (CIFS) and iSCSI. I'll probably also use AFP, DAAP, & uPnP in the future.

My Questions:

  1. It does not seem like the same drive (or RAID) can be used for both SMB and iSCSI access. Is this correct, or have I missed something? (Note: I know you can make a file on a drive accessible via iSCSI, but this it not what I want since you cant see this data from SMB)

  2. If the answer to #1 is really no, are there good workarounds for this? I came up with a few solutions (and am open to more), but need to understand what the best option is.

Solution A: Keep the drives out of RAID. Mount one for SMB and the other for iSCSI. Use rsync(?) to do hourly syncs. (Realtime sync is not critical here, I just need to make sure I don't lose all data if one drive dies)

Solution B: Create the RAID drives as iSCSI, then have FreeNAS access this target and re-mount it fro SMB. Not even sure if this works, and it sounds like a bit of a Rube Goldberg machine.

Solution C: I don't love either of the above options and was hoping for a better solution!

Thanks for any input here!

share|improve this question
add comment

1 Answer

i don't think it's possible just like you put it.

iSCSI is a block-level protocol. if several hosts access the same block device, they have to somehow arbitrate the use of the data stored there. Usually that means using a cluster-aware filesystem (GFS, OCFS2, CXFS, etc).

SMB/CIFS is a file-level protocol. it shares files with several clients, doing all the arbitration needed, and relying on the underlying filesystem.

Solution B should work, as long as you use a cluster-aware filesystem on this partition. oterwise, as soon as you use that block device from two hosts, you'll totally corrupt it.

It's not a 'rube goldberg'-like solution at all, since any fileserver works on top of a filesystem, you would just use a cluster-aware one. in fact, one of the most common use of cluster filesytems is as shared storage for several (smb/nfs) fileservers, distributing the processing and bandwidth load of file serving the same files.

in short: if you want block-level sharing, you have to use a cluster filesystem. if you also have non-cluster clients, you can add a fileserver on top of that filesystem.

share|improve this answer
    
Thanks for the input! I went ahead and created the re-mount (option B) and it seems to work. The odd thing is that I cannot see the data between the drives. SMB sees one set of data, while iSCSI sees another - ie if I copy something via iSCSI, a SMB attached machine does not have access. I just created a new share at the root - no security etc is in place yet. Odd. –  user19588 Sep 7 '09 at 16:11
    
@vans, what filesystem are you using? –  Javier Sep 7 '09 at 19:08
    
I think I'll end up with ZFS. Thats what I have on the current install. –  user19588 Sep 9 '09 at 10:43
    
ZFS isn't a cluster filesystem. if you mount if from different hosts on the same block device you'll corrupt it. (or, if the error detection is good enough, just block out one host or the other) –  Javier Sep 9 '09 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.