On Mar 12, 2014, at 6:18 PM, Rick Stevens ricks@alldigital.com wrote:
On 03/12/2014 04:23 PM, Dan Mossor issued this missive:
I've been combing the web for a couple days, and most hits I'm finding regarding using a btrfs subvolume as an iSCSI target are posts from the 2009/2010 timeframe stating that that functionality is broken.
I'm working on a couple projects here, and one of those involves the research into iSCSI targets and initiators, and the testing thereof. I have an F20 system with a 1.3TB btrfs master subvolume (across three dissimilar devices), and want to create a subvolume within that to serve as an iSCSI target.
The traditional methods, specifically those mentioned in the Fedora Wiki and the tgtadm man pages, place the emphasis on using devices (/dev/sdx) or files (dd if=/dev/zero of=/array/target1 bs=1k count=1). I realize that using the file is probably the easiest thing to do in this instance, but that's not the point of my project - I am intentionally trying to designate the btrfs subvolume as the target.
The issue I believe that is going to stop me is that tgtadm expects a block device as the target, and btrfs does not provide that. Is there a workaround, other than using a file in the subvolume as the target? Is there work in progress to enable this feature, either in the scsi-target-utils package or within the btrfs framework?
iSCSI stands for "internet SCSI", a way to share raw devices over normal network mechanisms rather than having to have a storage farm (e.g. fiberchannel switches or SAS concentrators and a ton of cables). As far as I know, the functionality you want will never be available. iSCSI is intended to share raw devices, not subdirectories (that's what things like NFS and CIFS are for).
It's a reasonable inquiry as ZFS does support iSCSI export of a zvol, but this is built into ZFS directly.
https://btrfs.wiki.kernel.org/index.php/Project_ideas#block_devices_.27btrvo...
No one has taken this yet though, so no work so far.
Chris Murphy