Using same drive for iSCSI and SMB share under FreeNAS
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.
Related videos on Youtube
Admin
Updated on September 17, 2022Comments
-
Admin almost 2 years
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!
-
Admin almost 15 yearsThanks 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.
-
Javier almost 15 years@vans, what filesystem are you using?
-
Admin almost 15 yearsI think I'll end up with ZFS. Thats what I have on the current install.