App Repository‎ > ‎

stgt-1.0.24

Overview

STGT provides iSCSI functionality as an user-level application. This means your DroboFS will be able to act as an iSCSI Target. STGT requires Perl to be installed on the DroboFS, and a Perl module called Config::General which is bundled with this DroboApp. This is a statically compiled version, optimized for the DroboFS hardware.

Acknowledgements

Thanks to DroboSpace forum user bujam1 for figuring out all of the dependencies.

Preparation

Make sure you have a cross-compiling virtual machine properly setup.

Compilation

export DEST=/mnt/DroboFS/Shares/DroboApps/stgt
cd ~/code/

wget http://search.cpan.org/CPAN/authors/id/T/TL/TLINDEN/Config-General-2.50.tar.gz
tar zxf Config-General-2.50.tar.gz
cd Config-General-2.50/
make clean
perl Makefile.PL PREFIX=$DEST DESTDIR=$DEST INSTALLPRIVLIB=/lib/perl5 INSTALLSITELIB=/lib/perl5/site_perl INSTALLARCHLIB=/lib/perl5 INSTALLSITEARCH=/lib/perl5/site_perl INSTALLBIN=/bin INSTALLSITEBIN=/bin INSTALLSCRIPT=/bin INSTALLSITESCRIPT=/bin INSTALLMAN1DIR=/share/man/man1 INSTALLSITEMAN1DIR=/man/man1 INSTALLMAN3DIR=/share/man/man3 INSTALLSITEMAN3DIR=/man/man3
make && make install
cd ..

wget -O stgt-v1.0.24.tar.gz https://github.com/fujita/tgt/tarball/v1.0.24
tar zxf stgt-v1.0.24.tar.gz
cd fujita-tgt-e039354/
grep -rl "/etc/tgt/" * | xargs sed -i -e "s|/etc/tgt/|$DEST/etc/tgt/|g"
sed -i -e "s/\-O2/\-O3/g" usr/Makefile
make clean
make programs scripts conf PREFIX=$DEST
make install-programs install-scripts PREFIX=$DEST
make install-conf DESTDIR=$DEST

Packaging

cd $DEST
mkdir -p var/log var/run
mv etc/tgt/targets.conf etc/tgt/targets.conf.default
mv sbin/tgt-admin sbin/tgt-admin.pl
sed -i -e "s|/usr/bin/perl|/usr/bin/env perl|g" sbin/tgt-admin.pl
wget -O service.sh http://www.droboports.com/app-repository/stgt-1-0-24/service.sh
wget -O sbin/tgt-admin http://www.droboports.com/app-repository/stgt-1-0-24/tgt-admin
chmod a+x service.sh sbin/tgt-admin
chmod -R g+w etc var
~/bin/package.sh

Installing

Download the TGZ file below and place it in you DroboApps share. If you do not have SSH access, reboot your Drobo. Otherwise, SSH in and type:

/usr/bin/DroboApps.sh install

Final remarks

Disclaimer: this is a work-in-progress. Most of the issues with the previous version have been worked out, but it is still beta quality. You have been warned.

This package does not change the DroboFS configuration in any way. In fact, it ships with an empty configuration file. Please read the STGT documentation on how to properly setup STGT. To test your setup, you can create a 2 TB volume to make sure things are working fine:

  1. Create a 2 TB file sparse file using dd. Connect to the DroboFS via SSH and type:
    dd if=/dev/zero of=/mnt/DroboFS/Shares/Public/iscsi-disk1 bs=1 count=0 seek=2000G
  2. Update targets.conf. Open the file /mnt/DroboFS/Shares/DroboApps/stgt/etc/tgt/targets.conf in an editor and add these lines:
    <target iqn.2011-12.drobofs:test>
       backing-store /mnt/DroboFS/Shares/Public/iscsi-disk1
    </target>
    
  3. Restart stgt.
    /mnt/DroboFS/Shares/DroboApps/stgt/service.sh restart

If everything worked, you should now be able to connect to the DroboFS over iSCSI and see a 2 TB volume.

Due to the limitations of the iSCSI protocol itself, 2 TB is the largest file size the DroboFS can expose per LUN. It is still possible, however, to export all of the Drobo's storage pool in one logical unit. For that, you need to create 8 x 2 TB volumes (which covers all of the Drobo's thin provisioning address space), and join them at the client end using, for example, spanned disks.

Upgrade advice

Upgrading should be seamless, since service.sh checks for the presence of a targets.conf file before replacing it with an empty configuration. In any case, it is strongly recommended to (1) make sure all clients have disconnected, and (2) backup the "etc" folder.

Please visit the DroboSpace forums to leave your comments, suggestions and feedback.

ċ
service.sh
Download
  4k v. 1 Feb 9, 2012, 4:22 AM Ricardo Padilha
ċ
stgt.tgz
Download
DroboApp for DroboFS  456k v. 2 Feb 9, 2012, 4:26 AM Ricardo Padilha
ċ
tgt-admin
Download
  1k v. 1 Feb 9, 2012, 4:22 AM Ricardo Padilha
Comments