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
on the command line. (You only need to do this once)
- Start the iSCSI target daemon:
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.Â