Using same drive for iSCSI and SMB share under FreeNAS
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:
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)
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!
Solution 1:
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.