btrfs mount as iSCSI target?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

bmacklin

Member
Dec 10, 2013
96
5
8
I have a btrfs mount of a few different sized drive. I want to make the mounted directory (/mnt/single) as the iSCSI target for a windows server. The plan is then in windows server share that up via SMB with 2 gigabit ports on passthrough. This is to enable multi-channel transfers between my windows desktop and the windows server. Except I get a "tgtadm: invalid request" error when I tried to do
Code:
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --b /mnt/single
Googling around seems to indicate that btrfs is not a block device so this fails. I would have to create a file with dd and do it that way.

Anyway, just want to see if anyone has successfully gotten iSCSI target to work with btrfs without using a file.

Thanks,
 

TuxDude

Well-Known Member
Sep 17, 2011
616
338
63
It won't work without using a file, and you will probably have all kinds of problems if you do use a file on top of btrfs as an iSCSI target. One feature that btrfs does not (yet) have that ZFS does is the concept of a 'zvol', and with no plans to implement any time soon I don't think.

In your case, I would say just use samba to make the btrfs volume available over SMB and forget multi-channel (at least until Samba supports it)
 

charles

New Member
Feb 8, 2016
1
0
1
41
New York City
www.clearpoolgroup.com
It won't work without using a file, and you will probably have all kinds of problems if you do use a file on top of btrfs as an iSCSI target. One feature that btrfs does not (yet) have that ZFS does is the concept of a 'zvol', and with no plans to implement any time soon I don't think.

In your case, I would say just use samba to make the btrfs volume available over SMB and forget multi-channel (at least until Samba supports it)
Btrfs does not have Zvols and it won't have, just use a file. Zvol is a ZFS concept and is not necessary on btrfs.

Also the statement "you will probably have all kinds of problems if you do use a file on top of btrfs" sounds like a comment from someone with no experience on btrfs.
There is no problems with that. Each volume can be a file, that's fine.
 

TuxDude

Well-Known Member
Sep 17, 2011
616
338
63
Btrfs does not have Zvols and it won't have, just use a file. Zvol is a ZFS concept and is not necessary on btrfs.

Also the statement "you will probably have all kinds of problems if you do use a file on top of btrfs" sounds like a comment from someone with no experience on btrfs.
There is no problems with that. Each volume can be a file, that's fine.
It's a comment from someone with a reasonable amount of btrfs experience, including trying to use btrfs as a storage back-end for running VMs. Yes the iSCSI part will technically work - but the performance hit of layering yet another filesystem on top of btrfs, nested inside of a (very) large file that the btrfs Copy-on-Write is going to fragment to hell, is going to be like trying to run your entire system off an old USB 1.0 drive. And thats assuming you don't run into issues of the btrfs filesystem complaining about out-of-space first, which you will run into real soon if the file backing the nested filesystem is >90% of the size of the btrfs.

I like btrfs and am using it for a variety of things now - but one thing it still sucks at is anything that tries to emulate a block device on top of it. Doesn't matter if its a local VM with a raw or .qcow2 file on btrfs, or an image-file being used as an iSCSI target holding an NTFS filesystem, the only way to get performance even close to reasonable is to disable copy-on-write for that file(s), which also disables btrfs's checksumming - with most of the good features gone and performance still not great I just don't recommend using btrfs for those use-cases yet.