UPDATE: Instead of writing ever new blog posts, an always up-to-date page for the iSCSI Target Support for ReadyNAS is now available.

As much as I like the ReadyNAS, there’s one feature I’ve been missing since day one: Being able to define an iSCSI target. Well, since the code is out there, I set about to make it work on the ReadyNAS. Luckily, there’s now some sort of development kit available, and for I had a spare ReadyNAS unit to break, there was nothing to stop me. To cut a long story (with many gory details) short: Mission accomplished.
(Disclaimer: If you break your ReadyNAS using the modules and scripts from the archive mentioned below, you own the parts. In short: Works for me. Ymmv. Use at your own risk.)
If you want to try for yourself, just download iSCSI Kernel Modules and Utilities for ReadyNAS directly to your ReadyNAS. You should have the EnableRootSSH addon installed and to make that one work, you might also need to install the ToggleSSH addon first. For the sake of brevity I assume you downloaded or copied the file to the /root directory of your ReadyNAS. If not, you’ll have to adapt the following commands accordingly:
- Change to the root directory and unpack the archive:
cd /
tar xzf /root/iscsitarget-0.4.15-ReadyNAS.tar.gz
- Edit /etc/ietd.conf. The important part is this line:
Lun 0 Path=/c/iscsi_file,Type=fileio
This will tell the iSCSI daemon to use the file /c/iscsi_file. If that’s fine with you, leave the line untouched. Otherwise change to your liking.
- Create the file for the iSCSI daemon. Since the iSCSI daemon cannot create the file that’ll later become our virtual SCSI drive, we’ll have to manually do that:
dd if=/dev/zero of=/c/iscsi_file bs=10485760 count=4096
As given above, the command will create a 40 GB file. If you need a smaller/larger file, just change the count parameter. Depending on the size of the file to be created, this will take from some minutes to some hours. So don’t wait for the command to finish but do something else in the meantime.
- Make the iSCSI modules known to the kernel. This is easily done by typing
depmod
on the command line. (You only need to do this once)
- Start the iSCSI target daemon:
/etc/init.d/iscsi-target start
That’s it. But now what? What is it good for to have an iSCSI target sitting around in the network? Well, for me it’s the ideal place to put TimeMachine backups onto. Instead of using an (officially unsupported) SMB share, an iSCSI target to my Mac looks like just another hard drive. And as such, it can be used as a regular TimeMachine backup volume. All that’s needed in addition to the modules for the ReadyNAS is the globalSAN iSCSI initiator, provided free of charge by Studio Network Solutions. It will allow you to connect to any iSCSI target on your network. Although it’s still in beta, it’s working remarkably well for me since months now.

Thanks for the heads-up! I’ve been hoping for iSCSI on the NV!
Any feedback on what performance impact if any this has had on your ReadyNAS? Driver behaving itself? No mem leaks, CPU-hogging?
Since I don’t run this particular setup in a production environment, I can’t give you any hard figures. Read performance for the iSCSI target itself is around 10,5 MByte/second, write performance is around 7,5 MByte/second. This would leave a lot of room on a gigabit link for other transmissions.
While under load, the iSCSI daemons on the ReadyNAS will use between 30 and 40 percent of available CPU power. Since the CPU of the ReadyNAS NV isn’t the most powerful around, you may experience some degradation of NFS/CIFS performance. This will also depend on the number of clients connected to the iSCSI target as well as the number of iSCSI writer threads running (this is tunable using the Wthreads option in /etc/ietd.conf – I’m using 3 instead of the default of 8 at the moment).
However, I’m currently playing with some settings of the TCP/IP stack for I feel that the values used by the ReadyNAS could be tweaked somewhat. Also, when I compiled the iSCSI target code, I didn’t use any special optimizations, so maybe there’s some performance to gain there, too.
As for the driver behaving itself: So far the iSCSI daemons appear to be rock stable (knocking on wood). As far as I can see, there’s no memory leakage, there’s been no change in memory consumption for a week now. The only crash I had was due to my own fault. I accidentially powered off the Ready NAS while moving some other equipment which resulted in a corrupted iscsi_file which in turn caused the virtual SCSI drive to be no longer accessible. So, on the server side I’d consider the code quite mature.
Client side is a different story, however. Especially the globalSAN iSCSI initiator on the Mac isn’t very forgiving when it comes to dropped connections, sometimes requiring a reboot of the client to be able to find the iSCSI target again. Connecting from Linux using open-iscsi however works flawlessly so far. Haven’t tested connectivity from Windows, though, and probably never will ;) But given the results from Mac OS X and Linux, I don’t see why it shouldn’t work with Windows clients, too.
So if i understand this correctly than the file of in this case 40Gb will become the storage space. But what if i already have shares and data on the readynas. And i want to connect to them via iSCSI?
Yes, that’s right, the file becomes the storage space – or to be more precise, the virtual SCSI disk. And that’s also the reason why you can’t access shares using iSCSI. Whereas a share is just “files and folders” presented over a network link, an iSCSI disk basically is, ummm, a raw unformatted disk drive. To make use of an iSCSI target, you have to partition and format it, things you just can’t do with or on a network share. This is also the reason why you shouldn’t access an iSCSI target from more than one host directly using a normal file system: since the iSCSI target behaves like a disk, it doesn’t know anything about file locking or parallel access issues. To make that work, you’d need a cluster file system like OCFS2 or GFS2 which will take care of access and locking issues in a multi-client environment.
Yeah well my intention was to let only a windows 2003 server connect to it thru iSCSI. And then make shares with ntfs rights and all that stuff. Thnx for the info.
For that scenario I think you’d better look at building your own iSCSI storage using FreeNAS. Saves you a lot of the overhead that comes with the ReadyNAS but comes with iSCSI target support and from the looks of it would be what you’re looking for. And you can easily scale to your performance needs by choosing the hardware yourself.
Thanks for the info.
I am able to setup iSCSI on my NAS.
My question is why GlobalSAN iSCSI only recognise a 30G volume even if i create a 40G file or greater on the NAS.
I have try using the Microsoft iSCSI initiator, it still recognise as a 30G volume. Is it there is a size limitation, is there any way to have a volume greater then 30G?
Hi,
Thanks for the info.
It works great on my NAS.
My problem is my iSCSI volume is only 30G even if i create a 40G or greater file size. Is there any way i can have a volume greater then 30G.
Since I’m using an iSCSI volume of 350 GB without any problem my best guess is that your problem is either related to the operating system of your client or the file system used on the iSCSI volume. If you could provide some more information on these I might be able to give some hints on what’s going wrong.
OK, tried it on a Rev. A 600 with the factory 128MB memory. Used MS Initiator – everything worked.
Noticed the following:
Reboot of NAS causes a filecheck every time on NAS while rebooting (not sure if this is the result of the NTFS file system or ?).
Need to start the iSCSI daemon manually after reboot.
Write speeds start out great (over 50MBs) but continue to decline as the transfer continues dropping to 9.4MBs on the 4.85GB file I was testing with (stayed steady at 17MBs using CIFS to a share).
Read speeds lower than write but stay fairly consistent at around 8.5MBs (didn’t see the decline like the write).
All of the above was based on testing with a Vista sp1 machine. Am going to reload and reset everything to factory default and try again to see if it was something I did to cause the weird write numbers. Will also test with an XP machine to see if it happens there as well. Getting 20MBs write and 40MBs read with the same Vista machine and a NV using CIFS to a share – but want to play with it more on the 600 before attempting it on the NV.
Excellent work on your part creating this and it forced me to do a crash course on Linux today to learn how to work with it…
Pingback: iSCSI Target Support for ReadyNAS updated at WhoCares?
Thanks for the information. Has anyone ever used some type of security mechanism to only allow particular computer to connect to the volume?
try iptables
Has anyone tried this with vmware esx server 3.5 or 3i
Thanks
Chris
I’d love to but unfortunately, ESX doesn’t support the hardware available to me right now.
I can say that it works with Sun’s iSCSI implementation, though. ;)
I have tried this with esxi, works fine with ReadyNAS 1100. Only thing is, the daemon does not seem to start automatically at startup. What’s the best way to take care of this?
You’ll find the answers in the comments over there.
Hello,
Does anyone know if this mod apply to all readyNAS products or only some (ie NV/NV+) ?
If I am right, it seems that all readyNAS use the same firmwares, but maybe I’m wrong.
I want to buy a ReadyNAS Duo and I really need iscsi.
Regards,
Jeremy
Jeremy, since I also own a Duo, I can confirm that this will work on the Duo, too. It just doesn’t work on the PRO for this uses a different hardware architecture altogether.
Thanks Stefan.
Thank you Stefan
Working fine, next steps are to point my ESX3i server at it and see what the VMFS performance is like over GigE
All my VM’s protected by X-Raid is something I have wanted for a long time :)
Stefan,
Love the addon. One question if i create a iscsi file on the readynas is there anyone to resize it if i run out of space?
Robert,
In general, you can easily add more space to the iSCSI file by doing a “dd if=/dev/zero of=/c/<your iscsi file> bs=<the block size you used when creating the original file> count=<desired size to ADD> seek=<original count of blocks the iscsi file had before>”.
However, this effectively results only in the file becoming larger which in turn means that to the iSCSI client it just looks like suddenly the whole hard drive (as that’s what the iSCSI target is to the client) magically became bigger. To actually use the added space, you’d have to use some tool that would allow you to resize the partition you most likely created on the iSCSI drive and doing this without data loss.
So in short: Yes, it’s doable but it’s got some strings attached.
If we upgrade RAIDiator versions does that override the iSCSI stuff?
Well, yes and no.
It won’t – and so far didn’t – overwrite the added kernel modules, nor will it overwrite or delete the iSCSI related startup/stop-scripts and the virtual disk files you most likely created.
An upgrade may however (and most likely will) overwrite the general startup and shutdown scripts of the ReadyNAS, thereby deleting the added entries (if you added them, that is) for starting and stopping the iSCSI service.
A special case would be if the ReadyNAS guys at Netgear for one reason or other decide to upgrade the whole kernel, as they already did on the ReadyNAS Pro. Even that wouldn’t overwrite the iSCSI stuff. However it would result in the iSCSI modules no longer being loaded for they belong to a different kernel. In that case I’d have to provide a new version of the iSCSI support files, which I of course would do.
Any chance of a addon for this that can be managed thru the web interface?
Working on that one as I type ;)
I bought an SC101T just before all of the ReadyNAS hardware was launched. Whilst I wouldn’t have been able to afford the ReadyNAS, it’s a shame because I would have considered saving for it due to the enhanced reliability of them over the SC101T.
It’s also a shame that the SC101T is a SAN and not a NAS because I’d love to be able to use iSCSI instead of the Netgear software.
Great work tweaking this on the ReadyNAS though, and I’ll be sure to favourite this for the day I can maybe afford one.
Worked out-of-the-box on my ReadyNAS Duo. Thanks a lot, Stefan!
An addon for iSCSI to be managed thru the web interface would be very much appreciated. I would be willing to make a donation for this effort.
Hello Stefan,
Thank you for this awesome module. Could you please let us know when the gui will be done? Thanks again.
Is there a source for update iSCSI source. I noticed on sourforge that it is upto version 4.17
Ok, I just upgraded the iSCSI support for ReadyNAS to 0.4.17. Two versions available, “stable” and “svn”. This time you’ll also get a .bin package for installation through the web interface ;) Check it out here: ReadyNASFreeware.org ;)
Oops. Had to post a hotfix. If you upgraded already, please do download the latest version and upgrade again. Sorry.
Hi Stefan! I have installed the *.bin version of your file, I got no error at all during the install (I have a ReadyNAS NV+) and I am connecting to an iMac Intel.
I haven’t changed anything in your code (e.g. iscsi_0), but when I try to connect to the target through the global SAN iSCSI I constantly get an error message: “Could not login to target “iqn.2001-04.com.readynas:iscsi_0″ because an error occurred during target login. Login status code 0203.”
What am I doing wrong? Please help me out somehow… (if you want please answer it here or drop me mail).
MANY THANKS!
Did you go through all the additional steps after installing the .bin version? Although it’s a .bin installer it still requires some manual work before you can actually use the iSCSI target.
Yes Stefan, I have used it exactly as you have described it! I have restarted both the NAS and he iMac as well to be on the safe side.
As I got no error message in the ssh terminal events, all has succeeded perfectly, I guess I am screwing up something in the globalSAN.
When I try to add a Target in the globalSAN, I click “+”, then I enter the IP address, I keep the port 3260, and I enter as Targer name “iqn.2001-04.com.ReadyNAS:iscsi_0″. Is this correct? My ReadyNAS is named ReadyNAS, and I haven’t touched your original “iscsi_0″ name.
In case I can’t make it work, could you please direct me how to uninstall/delete the stuff? Or should I just “reverse” the actions performed earlier?
I’m a bit confused here. You souldn’t have to enter a target name with GlobalSAN iSCSI.
The proper way would be to start the GlobalSAN iSCSI initiator. Next, you press the (+) on the “Portals” tab. There you enter the IP address of your ReadyNAS and leave the port 3260 unchanged. After confirming the settings with enter, the target(s) should be detected automatically.
Just tested it again here with my setup, works like a charm. If it doesn’t work that way for you, could you post me your ietd.conf?
Well, I am a newbie to iSCSI, so I wasn’t quite sure where to enter the data.
Now I put in the right place, as you have describe it, under “Portals”. I entered the IP address as well. But still nothing has been detected (although no error message this time!)
Is there anything I need to do in the ReadyNAS Frontview “Services/Installed Add-ons” panel? Currently in the Frontview panel the iSCSI target is ticked, but the little green light in the right corner is not green but gray (disabled I guess). If I click Configure targets a new pop apperas and says “Please enter the Name of your new iSCSI target:”. Do I need to enter here again the IP address?
Needless to say how happy I am that you help me Stefan! Thank you seriously for your kind help and support!
my ietd.conf is only the following:
Lun 0 Path=/c/iscsi_0,Type=fileio
Dear Stefan, thank you again for your very kind help yesterday!
Hi Stefan – this looks great but I just wanted to check (before I brick my NAS), does this work on the ReadyNAS Duo?
Yes, it does. Well, at least for me, since my Duo hosts the iSCSI drive for my Solaris 10 virtual machine ;) Just make sure you grab the latest version from ReadyNASfreeware.org.
Thanks for the lightning fast response! I’ll give it a go over the next couple of days :-)
I am having a great deal of difficulty with this, mostly because I am a linux newb, but when I try to execute this command:
/etc/init.d/iscsi-target start
It says no such file or directory, and indeed when I look in the init.d directory, there is no ‘iscsi’ anything. Why might this be?
That’s because you followed an outdated guide. As mentioned on the very top of this page, this page isn’t updated any longer. The current documentation can be found on ReadyNASFreeware.org. That’s also true for the latest revision of the iSCSI target support for ReadyNAS.
Most likely you’ll have to use
to make your installation work.
I agree that the current state of affairs is less then optimal, but I simply don’t have the time to build a site the way I would like it.
I fear I must have done something wrong, I am following the up to date documentation, but when I try to start the daemon it says ‘no such file or directory’ Am I missing something?