iSCSI Target Configuration (R4Sparc)

This text was rescued from the “Way Back Archive” – may contain some errors

Installation Instructions (.bin format)

Although the new version of the iSCSI target support installs through the web interface you have to make some manual changes to your ReadyNAS to make it actually work. That’s because I consider this an interim version before the release of the full version which will include a complete web interface.

So you still have to have the EnableRootSSH addon installed. And to make that one work, you might also need to install the ToggleSSH addon first.

Important note for Upgrades:
If you are currently running version 0.4.16 of the iSCSI target support, some file locations and names have changed. To upgrade cleanly, after installing the new version perform the following steps:

    • Install the .bin archive through the Frontview web management system of your ReadyNAS.
    • Disconnect/Shutdown all clients currently accessing the iSCSI target on your ReadyNAS.
    • Shut down the iSCSI target daemon using “/etc/init.d/iscsi-target stop”
    • Delete the old kernel module by issuing “rm -rf /lib/modules/2.6.17.8ReadyNAS/kernel/iscsi”
    • Recreate kernel module dependencies by running “depmod”
    • Start the iSCSI target daemon: “/etc/init.d/rfw-iscsi-target start”
    • Edit “/etc/init.d/rc3” and replace “/etc/init.d/iscsi-target start” with “/etc/init.d/rfw-iscsi-target start”
    • Edit “/etc/rc6.d/S99reboot” and replace “/etc/init.d/iscsi-target stop” with “/etc/init.d/rfw-iscsi-target stop”

That’s all

Installation

Log in to the SSH shell of your ReadyNAS and perform these steps:

Note: If you’re unfortunate enough to use Windows, you’ll need to install an SSH client first. A good choice would be PuTTY MobaXterm, other commercial tools are available, too. How to use the SSH client is beyond the scope of this document.

  • Install the .bin archive through the Frontview web management system of your ReadyNAS.
  • As the .bin installer doesn’t include the main configuration file you’ll have to create /etc/ietd.conf manually. A minimal version could look like this:
    Target iqn.2001-04.com.example:readyduo.iscsi.target0
    # Users, who can access this target. The same rules as for discovery
    # users apply here.
    # Leave them alone if you don't want to use authentication.
    #IncomingUser joe secret
    #OutgoingUser jim 12charpasswd
    # Logical Unit definition
    # You must define one logical unit at least.
    # Block devices, regular files, LVM, and RAID can be offered
    # to the initiators as a block device.
    Lun 0 Path=/c/iscsi_0,Type=fileio
    # Alias name for this target
    # Alias SunStorage
    # various iSCSI parameters
    # (not all are used right now, see also iSCSI spec for details)
    # MaxConnections 8
    # InitialR2T No
    # ImmediateData Yes
    #MaxRecvDataSegmentLength 8192
    #MaxXmitDataSegmentLength 8192
    #MaxBurstLength 262144
    #FirstBurstLength 65536
    #DefaultTime2Wait 2
    #DefaultTime2Retain 20
    #MaxOutstandingR2T 8
    #DataPDUInOrder Yes
    #DataSequenceInOrder Yes
    #ErrorRecoveryLevel 0
    # HeaderDigest CRC32C,None
    # DataDigest CRC32C,None
    # various target parameters
    #Wthreads 8

The important part is this line:

Lun 0 Path=/c/iscsi_0,Type=fileio

This will tell the iSCSI daemon to use the file /c/iscsi_0. If that’s fine with you, leave the line untouched. Otherwise change the file name to your liking.

Create the file from the config line above 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_0 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 done by typing

depmod

on the command line. (You only need to do this once)

Start the iSCSI target daemon:

/etc/init.d/rfw-iscsi-target start

To enable autostart of the iSCSI target daemon, edit /etc/init.d/rc3 and insert

/etc/init.d/rfw-iscsi-target start

right before the last line (should be “exit 0”).

To have the iSCSI target daemon shut down cleanly on a system shutdown, edit /etc/rc6.d/S99reboot and insert

/etc/init.d/rfw-iscsi-target stop

just before the line ‘# Save the last 5 ecounters by date.’