iscsi-osx / iscsiinitiator Goto Github PK
View Code? Open in Web Editor NEWiSCSI Initiator for macOS
License: BSD 2-Clause "Simplified" License
iSCSI Initiator for macOS
License: BSD 2-Clause "Simplified" License
Hi,
i cant see here any dmg image. Any idea?
iSCSIUtilsValidateIQN() checks if the specified target name conforms to RFC3721. However, the code assumes top domain name has always 3 letters (com,org,..). It is not case of country domains. So, it should be "[[:alnum:]]{2,3}" instead of "[[:alnum:]]{3}".
I also suggest that using double backslash to suppress 'unknown escape warnings' , e.g. "}" instead of "}" ( there are 4 regular expression string literals in the file) .
Hi again,
Thanks for the installer. No errors installing.
Getting a new error:
Jamess-iMac:~ jamrog$ sudo iscsictl add target iqn.2015-1.workgroup:RAID.iscsi0.vg0.data1
iscsictl: The specified target name is not a valid IQN or EUI-64 identifier
Any ideas? This same target shows in globalSAN which sees it and connects.
Xcode(v6.3.1) warnning about crc32c.c have 4 value conversion issues
//implicit conversion loses integer precision
crc0 = crc32c_shift(crc32c_long, crc0) ^ crc1;
I am not an expert by any means with BASH so please bear with me. I ran the csrutil enable command first and foremost and after a reboot, i ran the sudo sh build.sh command. I had to agree to terms and what not, but when I run the sudo sh install.sh command, I get the error above. Not sure how to proceed.
Any help would be appreciated.
On OSX 10.11.5 El Capitan, running most commands with 'sudo' results in the error Trace/BPT trap: 5
.
rteixeira-mbp:~ rteixeira$ iscsictl list targets
Trace/BPT trap: 5
rteixeira-mbp:~ rteixeira$ iscsictl add target blah
iscsictl: A target must be specified using a valid IQN or EUI-64 identifier
Trace/BPT trap: 5
Running iscsictl with 'sudo' prevents the error, but it still looks like nothing is happening.
rteixeira-mbp:~ rteixeira$ sudo iscsictl list targets
rteixeira-mbp:~ rteixeira$ sudo iscsictl add target <valid iqn>,<valid ip>
rteixeira-mbp:~ rteixeira$ sudo iscsictl list targets
rteixeira-mbp:~ rteixeira$
Hi Nareg,
first of, thanks for this very nice work, I'm using your code on a NAS and so far it's working great.
The only trouble I'm having is with the auto-login: for some reason, when I boot El Capitan, the daemon does not seem to login. It seems working however, since
$ sudo launchctl list | grep iscsi
81 0 com.github.iscsi-osx.iscsid
and when I list the target-config auto-login is indeed enabled:
$ iscsictl list target-config <target>
iqn.*** <inactive, static>
auto-login: enabled
Configuration:
MaxConnections (1)
ErrorRecoveryLevel (0)
HeaderDigest (none)
DataDigest (none)
Authentication: none
CHAP-name
CHAP-secret <unspecified>
192.168.0.18 <inactive, port 3260, interface default>
I should mention that manual login/logout are working fine, and that I'm using the master branch of the repository (which matches the latest release if I'm not mistaken).
Any input will be very much appreciated, thanks!
V.
Hi there,
Thanks for making this, really appreciate it and would love to get up and running, unfortunately, I'm getting the following:
Jamess-iMac:Scripts jamrog$ ./install.sh
cp: /Users/jamrog/Library/Developer/Xcode/DerivedData/iSCSIInitiator-aigtxpilzqrfppejydqcfhbzmveq/Build/Products/Debug/iscsid: No such file or directory
cp: /Users/jamrog/Library/Developer/Xcode/DerivedData/iSCSIInitiator-aigtxpilzqrfppejydqcfhbzmveq/Build/Products/Debug/com.github.iscsi-osx.iscsid.plist: No such file or directory
chmod: /Library/PrivilegedHelperTools/iscsid: No such file or directory
chown: /Library/PrivilegedHelperTools/iscsid: No such file or directory
chmod: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
chown: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
cp: /Users/jamrog/Library/Developer/Xcode/DerivedData/iSCSIInitiator-aigtxpilzqrfppejydqcfhbzmveq/Build/Products/Debug/iscsid.8: No such file or directory
/Library/Extensions/iSCSIInitiator.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
/System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
Jamess-iMac:Scripts jamrog$
Can anyone assist? I have run ./build.sh already.
Thanks,
James.
Im having problems connecting to a Qnap target , i managed to get it working with yosemite but upgraded to el capitan and it now no longer works :(
My first issue is
OS X 10.11 and later
Run the following command at the Recover OS terminal window:
csrutil enable
Should this be enable or disable ?
Secondly after adding a target and specifiying CHAP credentials i try to login
i get the following error
Unknown error: 268435459
Any help please 💃
I have been able to get iSCSIInitiator running and connecting successfully between El Capitan and a ReadyNAS 104 created LUN.
Transferring files is working, however the device keeps disconnecting, a new iscsictl login is required to reconnect. OS X alert reports device not properly disconnected.
I've checked /var/log/system.log and I see the following messages that seem to be connected to the disconnect. (I've also attached the full system log file if useful).
Thanks
Dec 30 11:31:43 Batman kernel[0]: iscsi: Sending data length: 10000
Dec 30 11:31:43 Batman kernel[0]: iscsi: Transfer size: 332314 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Queued task 0x21d3b520 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Received PDU type 0x31 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Dataoffset: 65536 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Desired data length: 196608 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Sending final data out (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Sent PDU type 0x5 (sid: 0, cid: 0)
Dec 30 11:31:43 Batman kernel[0]: iscsi: Sending data length: 30000
Dec 30 11:31:48 Batman kernel[0]: iscsi: Transfer size: 135706 (sid: 0, cid: 0)
Dec 30 11:31:48 Batman kernel[0]: iscsi: Queued task 0x1d9e0b60 (sid: 0, cid: 0)
Dec 30 11:31:49 Batman kernel[0]: gfx: surf 63dcbef: SetIDMode: id=449545833 mode=0x24
Dec 30 11:31:49 Batman kernel[0]: gfx: surf 63dcbef: clientClose:
Dec 30 11:31:55 Batman kernel[0]: iscsi: Received PDU type 0x20 (sid: 0, cid: 0)
Dec 30 11:31:55 Batman kernel[0]: iscsi: Sent PDU type 0x40 (sid: 0, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Failed to send NOP response (sid: 0, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sent PDU type 0x43 (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sending data length: 71
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sent PDU type 0x43 (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sending data length: 11b
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sent PDU type 0x44 (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sending data length: 10
Dec 30 11:32:05 Batman kernel[0]: iscsi: Deactivated connection (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Sent PDU type 0x46 (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Releasing session (sid 1)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Removed event sources (sid: 1, cid: 0)
Dec 30 11:32:05 Batman kernel[0]: iscsi: Released connection (sid: 1, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Task timeout for task 0x21d3b880 (sid: 0, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Connection timeout (sid: 0, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Releasing session (sid 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Bytes per second: 1308626 (sid: 0, cid: 0)
Dec 30 11:32:43 --- last message repeated 1 time ---
Dec 30 11:32:43 Batman kernel[0]: iscsi: Deactivated connection (sid: 0, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Removed event sources (sid: 0, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: iscsi: Released connection (sid: 0, cid: 0)
Dec 30 11:32:43 Batman kernel[0]: disk1s2: device/channel is not attached.
Dec 30 11:32:43 Batman kernel[0]: disk1s2: I/O error.
Dec 30 11:32:43 Batman kernel[0]: jnl: disk1s2: do_jnl_io: strategy err 0x5
Dec 30 11:32:43 Batman kernel[0]: jnl: disk1s2: end_transaction: only wrote 0 of 135680 bytes to the journal!
Dec 30 11:32:43 Batman kernel[0]: hfs: unmount initiated on iSCSI on device disk1s2
Dec 30 11:32:43 Batman kernel[0]: jnl: disk1s2: close: journal is invalid. aborting outstanding transactions
Dec 30 11:32:43 Batman deleted[322]: normalizeUserMountpoint:736 volRoot failed for /Volumes/iSCSI
Dec 30 11:32:43 Batman deleted[322]: _validateVolume:758 unable to normalize volume: "/Volumes/iSCSI", vol: (null)
Dec 30 11:32:43 Batman kernel[0]: gfx: gfx: powerStateDidChangeTo: The display is awake.
Dec 30 11:32:43 Batman fseventsd[51]: disk logger: failed to open output file /Volumes/iSCSI/.fseventsd/0000000001166467 (No such file or directory). mount point /Volumes/iSCSI/.fseventsd
Dec 30 11:32:53 --- last message repeated 1 time ---
Dec 30 11:32:53 Batman kernel[0]: gfx: gfx: powerStateDidChangeTo: The display is asleep.
Dec 30 11:33:04 --- last message repeated 1 time ---
Dec 30 11:33:04 Batman kernel[0]: gfx: surf 63dcfef: SetIDMode: id=449763306 mode=0x24
Dec 30 11:33:04 Batman kernel[0]: gfx: surf 63dcfef: clientClose:
Dec 30 11:33:04 Batman iscsid[439]: discovery is taking longer than the specified discovery interval. Consider increasing discovery interval
Dec 30 11:34:05 Batman kernel[0]: iscsi: Sent PDU type 0x43 (sid: 0, cid: 0)
Dec 30 11:34:05 Batman kernel[0]: iscsi: Sending data length: 71
Dec 30 11:34:05 Batman kernel[0]: iscsi: Sent PDU type 0x43 (sid: 0, cid: 0)
I needed to add some conditional defines to build for Mountain Lion.
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_8
typedef int errno_t;
#endif
#define kIOPropertyiSCSIQualifiedNameKey "iSCSI Qualified Name"
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_8
#define kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics"
#define kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier"
#define kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier"
#define kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number"
#define kIOBSDNameKey "BSD Name"
#define kIOMediaSizeKey "Size"
#define kIOMediaPreferredBlockSizeKey "Preferred Block Size"
#endif
When building on OS X 10.11.2 El Capitan I got 3 compiler warnings for iSCSIVirtualHBA.cpp:
I have fixes for both, if you'd like me to submit a pull request.
That is, if you wish to fix such things. I'm just learning Xcode, so I'm starting small.
Hi,
because the package was built from old sources and contains bugs... could you please provide any details how can the package be build from the git sources and therefor actual code will be installed.
Thank you
I upgraded to Xcode 7, and I get a bunch of warnings now when building the initiator kernel module, all along the lines of:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework/Headers/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h:1532:18: 'getWorkLoop' overrides a member function but is not marked 'override'
It looks like the build flag "-Wno-inconsistent-missing-override" needs to be added to the compilation of most of the other kernel files for the iSCSIInitiator" target to fix this, i.e. to:
(It is already set for iSCSIInitiator.cpp.)
IOSimpleLock used to serialize access to queues that hold iSCSI tasks. Since tasks are queued from more than one function (which may run concurrently) access to this needs to be serialized.
Consider modifying iSCSITaskQueue to use IOCommandGate as a superclass to use the command gate to achieve this without locks.
Hi,
I've been testing iscsi-osx for the last three weeks and for now it works very well.
Sometimes I've seen some iscsid-xxxx-crash reports at /Library/Logs/DiagnosticReports/ but, as everything was working fine I didn't pay any attention to them.
Today, I've realised that in fact, there are two, and only two iscsid-xxxx-crash reports each time after I do a reboot. That happens in my 3 El Capitan test machines. It does not depend on automounting any LUN, because I get a crash report in machines with or without auto-login enabled targets.
The text in the report starts with:
---------------------------------------------------------------------------
Process: iscsid [68]
Path: /Library/PrivilegedHelperTools/iscsid
Identifier: iscsid
Version: ???
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Responsible: iscsid [68]
User ID: 0
Date/Time: 2016-02-15 18:33:25.529 +0100
OS Version: Mac OS X 10.11 (15A284)
Report Version: 11
Anonymous UUID: B3B11DCF-F07D-5927-5F8E-F626ECE8D1FA
Time Awake Since Boot: 6 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0x8:
-->
__TEXT 000000010e104000-000000010e116000 [ 72K] r-x/rwx SM=COW /Library/PrivilegedHelperTools/*
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x00007fff9a5ca5fe CFRunLoopAddSource + 78
1 iscsid 0x000000010e108479 iSCSIInitialize + 52
2 iscsid 0x000000010e10a61b main + 672
3 iscsid 0x000000010e10587c start + 52
---------------------------------------------------------------------------
Hope this helps,
Regards,
Manuel Martínez
Ive tried to add a target as documented but get an error instead
○ → iscsictl add target iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant,192.168.124.82:3260 -interface en0
iscsictl: The specified target name is not a valid IQN or EUI-64 identifier
I wonder if the additional .name.etc. are causing it to misinterpret the validity of the identifier.
A discovery from linux shows
w530:~ # iscsiadm -m discovery -t st -p 192.168.124.83
192.168.124.82:3260,1 iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant
192.168.124.83:3260,2 iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant
The userland daemon iSCSIDaemon does not compile on Mavericks. It fails in the logging part:
iSCSIInitiator/Source/User Tools/iSCSIDaemon.c:1260:5: error: unknown type name 'asl_object_t'; did you mean 'io_object_t'?
asl_object_t log = asl_open(NULL,NULL,ASL_OPT_STDERR);
^~~~~~~~~~~~
According to man asl
on a Mavericks box, asl_open()
returns (and other functions expect) the type aslclient
in OS X 10.9.
when i try and run the
i receive this:
form the console i can read:
I suppose the only way is run Kext in KEXT Development Mode, isn't it?
Hi,
Im desperately looking how to use this tool, is there any documentation? What should i do after installation... Thanks
Hi,
I'm testing iscsi-osx on with El Capitan and a ReadyNAS RNDP4420 with ReadyNAS OS 6.4.1 and I'm experimenting an strange issue.
I have installed it using the released (beta) dmg. It seems to work nice. I'm able to add the target, login and then format the disk, but when I write files on the Volume the used wired memory starts to grow until the system stops working.
If I write a 1GB file on the LUN (with: dd if=/dev/zero of=test.img bs=1024k count=1000) the wired mem used grows 1GB. It seems that the system doesn't free the buffers (or similar).
Looking at /Library/Logs/DiagnosticReports I see the following crash report.
Can you help me?
Thanks in advance,
Manuel Martínez
Hi All,
I am a new user of iSCSIInitiator and it works fine so far. My problem, however, is that if OSX wakes from sleep, the disk is lost. I read in some other thread that the connection is dropped upon sleep and restarted upon wake, but this does not seem to work.
My configuration:
iscsiinitiator: iSCSIInitiator-1.0.0-beta.dmg
OSX: 10.11.3
Target: FreeBSD 10.2-RELEASE
root@fbsd:~ # cat /etc/ctl.conf
timeout 0
portal-group g0 {
discovery-auth-group no-authentication
listen 0.0.0.0
listen [::]
}
target iqn.2012-06.com.example:target0 {
auth-group no-authentication
portal-group g0
lun 0 {
path /dev/zvol/zroot/testvol
size 2G
}
}
heinrich@Heinrichs-iMac [~]: iscsictl list target-config in.2012-06.com.example:target0
iqn.2012-06.com.example:target0 <inactive, static>
auto-login: enabled
Configuration:
MaxConnections (1)
ErrorRecoveryLevel (0)
HeaderDigest (none)
DataDigest (none)
Authentication: none
CHAP-name
CHAP-secret <unspecified>
192.168.178.123 <inactive, port 3260, interface en0>
Any ideas?
TIA,
Heinrich
Total iscsi noob here. Just started playing with this. iscsid is crashing consistently. On 10.10.5 with latest Xcode.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Thread 4 Crashed:
0 com.apple.CoreFoundation 0x00007fff925233e9 CFArrayGetCount + 25
1 iscsid 0x000000010a829f79 iSCSIDiscoveryRunSendTargets + 41 (iSCSIDiscovery.c:127)
2 iscsid 0x000000010a8349a3 iSCSIDRunDiscovery + 19 (iSCSIDaemon.c:817)
3 libsystem_pthread.dylib 0x00007fff89fe505a _pthread_body + 131
4 libsystem_pthread.dylib 0x00007fff89fe4fd7 _pthread_start + 176
5 libsystem_pthread.dylib 0x00007fff89fe23ed thread_start + 13
I see that iSCSIPLCreateArrayOfPortalsForSendTargetsDiscovery can return null. This result is next passed to CFArrayGetCount in iSCSIDiscoveryRunSendTargets.
Things work up to the point of doing login. Server is Solaris 11. Presumably even if this crash didn't happen there would still be something else not working.
With some guidance I can make changes, test, and PR.
On 10.11.5 and Xcode 7.3.1 (7D1014), some components fail to build. The resultant .pkg only had the framework and was missing everything else, failing the pkg's post install.
If I run the project from Xcode, it says it succeeds but a subsequent run on the script has the same result. Attached is the output from the script.
failed build.txt
Trying to compile (OsX 10.9.5 / XCode 6.2), I find the following issues 👍
Kernel/crc32c.c
Kernel/crc32c.c:197:42: Implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
Kernel/crc32c.c:198:42: Implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
Kernel/crc32c.c:217:43: Implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
Kernel/crc32c.c:218:43: Implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
Kernel/iSCSIVirtualHBA.cpp
Kernel/iSCSIVirtualHBA.cpp:470:40: Format specifies type 'int' but the argument has type 'UInt64' (aka 'unsigned long long')
Kernel/iSCSIVirtualHBA.cpp:1761:53: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'UInt32' (aka 'unsigned int')
Hope this helps :-)
Jean-David
With the updated code, the build is much gentler, but the install fails - How do you usually install?
Either sudo or as authorized admin I cannot install it on El Capitan.
MacPro in ~/Documents/iSCSIInitiator
± |master ?:2 ✗| → sudo ./install.sh
cp: /usr/sbin/iscsid: Operation not permitted
cp: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: Operation not permitted
chmod: /usr/sbin/iscsid: No such file or directory
chown: /usr/sbin/iscsid: No such file or directory
chmod: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
chown: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
cp: /usr/bin/iscsictl: Operation not permitted
chmod: /usr/bin/iscsictl: No such file or directory
/Library/Extensions/iSCSIInitiator.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
/System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
MacPro in ~/Documents/iSCSIInitiator
± |master ?:2 ✗| → sh install.sh
cp: /usr/sbin/iscsid: Operation not permitted
cp: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: Operation not permitted
chmod: /usr/sbin/iscsid: No such file or directory
chown: /usr/sbin/iscsid: No such file or directory
chmod: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
chown: /System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
cp: /usr/bin/iscsictl: Operation not permitted
chmod: /usr/bin/iscsictl: No such file or directory
/Library/Extensions/iSCSIInitiator.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
/System/Library/LaunchDaemons/com.github.iscsi-osx.iscsid.plist: No such file or directory
Hi !
I install latest beta but it has lower R/W speed 59/79MB/s ( AJA test ).
Beta 3 get 89/90MB/s in AJA test.
El Capitan 10.11.
I'm running Beta 4 on an iMac running El Capitan (10.11.6 with all updates as of September 6th, 2016). I was able to install the package without issue, and it took me a bit to find the name of the iSCSI target (it took a Windows PC, natch), but I finally got it.
The first time I attached, I saw a 2 MB drive appear for a brief moment - even though the LUN is 2 TB in size. Now, when I try to attach to the LUN, I am unable to. The following are the commands I use and their output:
Last login: Wed Sep 7 20:23:50 on console
Harlock-House-iMac:~ gjschaller$ iscsictl list targets
iqn.2016-09.GeoffNAS.com:itunesdata <inactive, static>
10.0.0.254 <inactive, port 3260, interface default>
Harlock-House-iMac:~ gjschaller$ iscsictl login iqn.2016-09.GeoffNAS.com:itunesdata,10.0.0.254
Harlock-House-iMac:~ gjschaller$ iscsictl list targets
iqn.2016-09.GeoffNAS.com:itunesdata <inactive, static>
10.0.0.254 <inactive, port 3260, interface default>
Harlock-House-iMac:~ gjschaller$
I can see the target, logging on does not produce a result, or an error.
Hi,
First thank you for your initiative of developing and iscsi initiator for OS X.
I've been able to successfully use the software to mount multiple LUN with a IETD server.
After a few tests, it appears that I'm getting an Input/output error after manipulating more than 1 LUN.
# iscsictl list targets
iqn.2001-04.com.example:storage.disk2.sys1.xyz <inactive, static>
10.51.1.98 <inactive, port 3260, interface default>
iqn.2015-01.net.42:b71d51f06599e6df976ea78d081ab711 <inactive, static>
10.51.1.99 <inactive, port 3260, interface default>
# iscsictl login iqn.2001-04.com.example:storage.disk2.sys1.xyz
iscsictl: Input/output error
# iscsictl login iqn.2015-01.net.42:b71d51f06599e6df976ea78d081ab711
iscsictl: Input/output error
In my /var/log/system.log I also get
Dec 9 17:17:02 dump-accueil-1 iscsid[82]: Login to <iqn.2015-01.net.42:b71d51f06599e6df976ea78d081ab711,10.51.1.99:3260 interface default> failed: Input/output error
I do not see any traffic coming up on my server network interface.
If I remove completely the software/wipe the Mac and try to reinstall I can often get the following behavior:
# iscsictl add [...]
# iscscitl login [...]
login won't print anything and won't send any TCP packets to the server.
mount won't work too.
It's strange since it's been working at first.
The tests have been done on Mac OS X 10.10.5
POSIX guarantees synchronization; no need for locks here.
Hooks have been left to perform advanced error recovery. Instances where the iSCSI error recovery level should be considered and acted upon are:
A notification mechanism has been setup to allow the kernel to notify the daemon that it should perform some recovery action.
Successful only with csrutil disable not enable option.
In El Capitan, this is achieved by running csrutil enable at the Recover OS terminal window (see the System Integrity Protection Guide for more details).
Hi,
isnt the code buggy? I setup the initiator on the el capitan, when i transfer around 3GB of data to the mounted location the kernel_task starts to use 80% cpu and machine is simply non-responsive until i reboot it.
any idea?
Hello,
Running on OSX 10.11.3 (15D21)
The following command gives out a segmentation fault (Both in the latest release and the latest github code):
iscsictl add target iqn.2016-08.local.domain:test,10.54.1.4
While debugging, I managed to locate the error in User/iSCSI Framework/iSCSIUtils.c, line 106:
if(regexec(&preg,CFStringGetCStringPtr(portal,kCFStringEncodingASCII),maxMatches[index],matches,0)) {
[...]
}
The call to CFStringGetCStringPtr(portal,kCFStringEncodingASCII) apparently returns NULL for portal IPs under 10 characters long.
The error is fixable by converting the CFStringRef "manually" using CFStringGetCString with a preallocated buffer, instead of using CFStringGetCStringPtr. (According to the Apple Developer Docs (Bottom of the page), CFStringGetCStringPtr is not guaranteed to return non-NULL, and must be "backed up" by a call to CFStringGetCString in that case.)
I genuinely have no idea WHY this would happen, but, hey, it does ! I will attempt to go and fix this potential error everywhere in the code where there's a call to CFStringGetCStringPtr, and make a pull request, but a bit later, as for now I'm calling it a day. Just thought you should know :)
well, I installed package from img and the binaries are missing... no such file as iscsictl etc...
Dear all,
nice project but I'm unable to get it to work. Compiling and using the kext and binarys is working so far with one little addition: Maybe it should be mentioned that one needs to disable kext signing security if using OS X in version 10.9 and above. To do so simply set the following parameter in terminal:
and restart the machine before loading the kext.
Furthermore I noticed a little error. The hardcoded initiator-name in iSCSISession.c should be read correctly in iSCSIAuth.c (wrong variable was used here):
--- iSCSIAuth.c.orig 2015-05-15 17:07:23.557196400 +0200 +++ iSCSIAuth.c 2015-05-15 17:08:41.549346924 +0200 @@ -20,6 +20,7 @@ extern unsigned int kiSCSISessionMaxTextKeyValuePairs; extern CFStringRef kiSCSIInitiatorIQN; +extern CFStringRef kiSCSIInitiatorName; extern CFStringRef kiSCSIInitiatorAlias; /*! Helper function. Create a null-terminated byte array that holds the @@ -297,7 +298,7 @@ /// TODO: fix initiator name (read from globals?) // Read global variables for initiator name & alias and add them to dict. - CFDictionaryAddValue(authCmd,kiSCSILKInitiatorName,kiSCSILKInitiatorName); + CFDictionaryAddValue(authCmd,kiSCSILKInitiatorName,kiSCSIInitiatorName); CFDictionaryAddValue(authCmd,kiSCSILKInitiatorAlias,kiSCSIInitiatorAlias); // Determine authentication method used and add to dictionary @@ -456,7 +457,7 @@ CFDictionaryAddValue(authCmd,kiSCSILKTargetName,iSCSITargetGetIQN(target)); // TODO: grab name from the daemon / local variable? - CFDictionaryAddValue(authCmd,kiSCSILKInitiatorName,kiSCSILKInitiatorName); + CFDictionaryAddValue(authCmd,kiSCSILKInitiatorName,kiSCSIInitiatorName); CFDictionaryAddValue(authCmd,kiSCSILKInitiatorAlias,kiSCSIInitiatorAlias); CFDictionaryAddValue(authCmd,kiSCSILKAuthMethod,kiSCSILVAuthMethodAll);
But now it's getting harder, I can't get managed to connect to my iSCSI Server. The command
works fine. But when trying to login with command
I just get the error message:
Login to [ target: iqn.2015-05.com.whatever:rbd.disk1 portal: 192.168.0.1:3260 if: en0 ] failed: Unknown error occurred.
On the server side I get the following error message:
[16603465.600920] Unable to locate "=" separator for key, ignoring request.
[16603465.600958] iSCSI Login negotiation failed.
I'm using the Linux iSCSI LIO (included in Kernel) implementation. Any clue what could be the problem? Sniffing with wireshark the initial iSCSI login package/handshake looks fine to me. Connecting to the target from a linux machine with iscsiadm works without any problems.
Furthermore running "iscsictl −discovery −portal ..." hangs the iscsid daemon at 100 percent cpu load. The only way to recover is to kill the process. But that wouldn't mind me for now. The more important thing is to get the login to work probably.
If you need more data from me to debug just let me know.
Thanks and best regards,
Fabian
Hi nsinenian,
I couldn't connect to icsid - when I tried to setup according to your wiki Initiator configuration.
After a lot of searching I found out that you have to use terminal with sudo for the commands necessary for setting up.
Could you please update or add this in your wiki accordingly, as it would have saved me a lot of time.
I'm using the initiator on OSX Mavericks and a ReadyNAS OS 6
:-)
in the WIKI
The initiator's iSCSI Qualified Name (IQN) and alias should be configured after installation. Default values for the IQN and alias are set by the initiator which may not be unique in the iSCSI domain. The IQN can be modified as follows:
$ iscsictl modify initiator-config -node-name [IQN]
Where [IQN] is specified as defined in RFC3720 (see iSCSI overview). The initiator alias may similarly be configured:
$ iscsictl modify initiator-config -node-alias [alias]
These values are part of the initiator configuration that can be viewed using the list subcommand:
It should be:
">$ sudo iscsictl modify initiator-config -node-name [IQN]"
The iqn parsing might still be off since the 'add target' is still adding targets with a more random naming, I was removing the entry that was added without certain values and there was a segfault, perhaps as it removed a mounted target because the syntax caught more than one entry and did not block that well...
MacPro in ~
○ → sudo iscsictl remove target iqn.2003-01.org.linux-iscsi.igw:sn,192.168.124.82:3260
Password:
The specified portal has been removed
MacPro in ~
○ → iscsictl list targets
iqn.2003-01.org.linux-iscsi.igw:sn <inactive, static>
192.168.124.83 <inactive, port 3260, interface default>
iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant <active, static, sid 0, tpgt 1, tsid 0x1>
192.168.124.82 <active, cid 0, port 3260, interface en0>
MacPro in ~
○ → sudo iscsictl remove target iqn.2003-01.org.linux-iscsi.igw:sn,192.168.124.83:3260
The specified portal has been removed
MacPro in ~
○ → iscsictl list targets
iqn.2003-01.org.linux-iscsi.igw:sn <inactive, static>
Segmentation fault: 11
previously, it had blocked me from removing a connected target
MacPro in ~
○ → iscsictl remove target iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant,192.168.124.82:3260
The specified portal is connected and cannot be removed
but again, this protection might have failed if the parsing is off due to the IQN naming used...
I was unable to get the LUNs to mount. I wonder if the documentation is correct (as the iscsictl is expecting the LUN or if the target is specified without a LUN ID)
The command hangs...
MacPro in ~
○ → iscsictl mount iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant
^C
MacPro in ~
○ → sudo iscsictl mount iqn.2003-01.org.linux-iscsi.igw.x86:sn.redundant
^C
I'm using El Capitan 10.11.3. I installed from source (latest git pull). Install went fine (csrutil disabled). Discovery seems to be working:
MBP-Hoeve:~ jhoeve$ sudo iscsictl list targets
iqn.2012-05.hoeve.nu.istgt:vmtvdisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmmaildata <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:dockerdata <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:tm-mbp13 <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmdnsroot <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmgamedisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmdatabasedisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmmiscdisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmpvrroot <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmmaildisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
iqn.2012-05.hoeve.nu.istgt:vmwebdisk <inactive, dynamic>
10.0.1.20 <inactive, port 3260, interface default>
But login isn't:
MBP-Hoeve:~ jhoeve$ sudo iscsictl login iqn.2012-05.hoeve.nu.istgt:tm-mbp13
Password:
iscsictl: Authentication failure
Console shows:
12/03/16 23:24:32,885 iscsid[272]: CHAP secret is missing or insufficient privileges to system keychain, reverting to no authentication.
Which isn't true:
MBP-Hoeve:~ jhoeve$ sudo iscsictl list target-config iqn.2012-05.hoeve.nu.istgt:tm-mbp13
iqn.2012-05.hoeve.nu.istgt:tm-mbp13 <inactive, dynamic>
auto-login: disabled
discovery portal: 10.0.1.20
Configuration:
MaxConnections (1)
ErrorRecoveryLevel (0)
HeaderDigest (none)
DataDigest (none)
Authentication: CHAP
CHAP-name macosx
CHAP-secret <specified>
10.0.1.20 <inactive, port 3260, interface default>
Also, in keychain I can find the corresponding entry. To be sure I changed access control to 'allow all applications to access this item'. But that doesn't make any difference.
I did manage to login (or atleast thats what iscsictl said) by enabling auto-login. I cant seem to reproduce that now though. It never found any LUNs though. Server is FreeNAS 9.3 and I am using iscsi succesfully on linux clients.
Several other things I notice:
MBP-Hoeve:~ jhoeve$ iscsictl list discovery-config
SendTargets: enabled
interval: 60
discovery-portals: 1
(null) <port 3260, interface default>
Even though discovery works, it shows '(null)' there.
Neither work (both the error about keychain) but one says input/output error. iscsid seems to be running judging ps -ef and logging...
ServerSide: win server 2012r2 software target
ClientSide:
HyperMeow:~ root# iscsictl login iqn.1991-05.com.microsoft:svr01-share-target
Attached iqn.1991-05.com.microsoft:svr01-share-target <scsi domain 0, target 0>
MSFT Virtual HD 6.3
Serial Number 76741189-0F61-4F19-9AAB-4FAB80E2E1F6
lun 0: type 0x00 (Block device)
HyperMeow:~ root# iscsictl list luns
iqn.1991-05.com.microsoft:svr01-share-target <scsi domain 0, target 0>
MSFT Virtual HD 6.3
Serial Number 76741189-0F61-4F19-9AAB-4FAB80E2E1F6
lun 0: type 0x00 (Block device)
disk5: 10.74 GB (20971520 512 byte blocks)
diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 120.5 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +120.1 GB disk1
Logical Volume on disk0s2
AE08F4BD-3565-44B8-86E4-3B151F4264F7
Unlocked Encrypted
/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *128.7 GB disk2
1: Windows_NTFS Transcend 128.7 GB disk2s1
/dev/disk3 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: *10.7 GB disk3
HyperMeow:~ root# diskutil eraseDisk JHFS+ test GPT disk3
Started erase on disk3
Unmounting disk
......hang on a very long time........
Hi, I managed to run the install iSCSI.
it works great.
However, the auto-login does not work, does not attach itself only a manual start.
Before installing I turned off the csrutil disable.
However, this has not been run sudo nvram boot-args = kext-dev-mode = 1
Perhaps the reason?
Hi,
I commented on a previously closed issue (#16).
Same problem as this person had. Running Mavericks. I have ran terminal command in readme to load unsigned kexts but no luck. Kext remains unloaded and receive same error message.
Any ideas?
I downloaded the latest source, ran ./build.sh in the main directory, and got this error message 3 times:
xcodebuild: error: The project named "iSCSIInitiator" does not contain a scheme named "iSCSIDaemon". The "-list" option can be used to find the names of the schemes in the project.
It's not building at all.
Mounting iscsi target ok, but impossible write large files - The Finder can’t complete the operation because some data in “filename” can’t be read or written.(Error code -36) appears windows :(
Disk iscsi is formatting hfs+.
OS X 10.11.4 Beta (15e39d)
Free ( comadline mods :)) iscsi initiator from atto works very well on this same disk so it is a bug iscsiinitiator.
$ sudo /tmp/iscsictl -targets
+-o iqn.1995-05.com.seagate.mynas:iscsi2 [ Inactive ]
+-o 192.168.0.107 [ Not Connected, Port: 3260, Interface: en0 ]
I can't seem to find a way to tell iSCSIInitiator to make the target active.
I'm not sure if it's related, but discovering never works either:
$ sudo /tmp/iscsictl -discovery -portal 192.168.0.107
/tmp/iscsictl: Input/output error
Nothing interesting in the log nor dmesg. This is OSX 10.10.3 with a Seagate 2 bay NAS.
MacPro in ~
○ → iscsictl list targets
iqn.2003-01.org.linux-iscsi.igw:sn <inactive, static>
192.168.124.83 <inactive, port 3260, interface default>
192.168.124.82 <inactive, port 3260, interface default>
MacPro in ~
○ → iscsictl login iqn.2003-01.org.linux-iscsi.igw:sn,192.168.124.82
Login to <iqn.2003-01.org.linux-iscsi.igw:sn,192.168.124.82:3260 interface default> failed: Target services unavailable
The lun is being presented by a Linux host, using the (ceph) rbd module. It should be irrelevant as this works fine for ESXi, Linux and Windows.
The README expects that the Kernel and Tools have already built, but there are no instructions on how to build them. Can you provide a quick overview?
Hi !
Under OS X 10.11.6 any option add to terminal command iscsictl ( eg. iscsictl add target xxxx ) resuls crash app.
I attach error report.
Reg.
error raport.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.