These instructions are for SCST trunk as of 5/25/2015 and Ubuntu server 15.04 with 3.19.0-18-generic amd64 kernel. adjust paths as needed
commands all relative to the build dir of your choice and mostly dependent on the command above it
get latest SCST:
svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst
make kernel patch:
cd scst scripts/generate-kernel-patch 3.19 > ../scst.patch cd ..
get kernel source and tools:
apt-get source linux-image-$(uname -r) apt-get build-dep linux-image-$(uname -r) apt-get install libncurses5-dev
apply scst patch to kernel and prepare it for building (note: -Np1 is a One(1) not a lower case L (l) ):
cd linux-3.19.0/ patch -Np1 -i ../scst.patch chmod a+x debian/scripts/* chmod a+x debian/scripts/misc/*
create a custom flavor for scst based on the generic flavor:
cp debian.master/config/amd64/config.flavour.generic debian.master/config/amd64/config.flavour.scst cp debian.master/abi/3.19.0-17.17/amd64/generic debian.master/abi/3.19.0-17.17/amd64/scst cp debian.master/abi/3.19.0-17.17/amd64/generic.modules debian.master/abi/3.19.0-17.17/amd64/scst.modules cp debian.master/control.d/vars.generic debian.master/control.d/vars.scst
edit debian.master/control.d/vars.scst
to reflect SCST instead of Generic
edit debian.master/etc/getabis
and add scst to the getall amd64...
line
edit debian.master/rules.d/amd64.mk
and add scst to the flavours = ...
line
Update configs for our new flavor. Take default answer on any prompts:
fakeroot debian/rules clean debian/rules updateconfigs
Edit the configs to enable scst modules, only edit amd64/config.flavour.scst, say "n" to all the others:
debian/rules editconfigs
In the GUI select Networking Support
, then Networking options
, under TCP/IP networking
press spacebar on TCP/IP zero-copy transfer completion notification
to enable it. Select Exit
twice and select Device Drivers
, then SCSI Target (SCST) Support
, then press spacebar on the option to make it <M>
, leave what shows up as defaults.
Select Exit until you get a Save prompt, choose Yes. You will get many config-check failures, they are all ARM and PPC related and do not affect us.
Compile the kernel:
fakeroot debian/rules clean fakeroot debian/rules binary-headers binary-scst cd .. ls -l
you should now have several .deb files. Copy them to the target system and install the needed ones:
dpkg -i linux-image-* linux-headers*
Reboot into the new kernel and cd back into your build dir to compile and install scst, iscsi, and scstadmin
cd scst make scst scst_install iscsi iscsi_install scstadm scstadm_install cd ..
To enable boot-time startup:
systemctl enable scst.service
Create /etc/scst.conf
and add our devices and iscsi config. filename
can be any storage block device, including MD, LVM, and mapper aliases, or a filename such as created with dd if=/dev/zero of=disk01 bs=1M count=1024
. the TARGET name needs to be unique on your LAN, the part after the : is what you change (tgt in the example). You must also always have a LUN 0, in case you might want to remove any LUN, make a small file to be LUN 0 that will always exist.
HANDLER vdisk_fileio { DEVICE disk01 { filename /media/data/disk01 nv_cache 1 } } TARGET_DRIVER iscsi { enabled 1 TARGET iqn.2015-05.iscsi.lan:tgt { LUN 0 disk01 enabled 1 } }
Start the service:
service scst start
iSCSI Initiators should now see your LUNs.
FYI for anyone who might need to install SCST: Version 3.1.x of SCST no longer requires a custom kernel build for kernels >= 2.6.30. So if your kernel is 2.6.30 or higher, just get SCST version 3.1.x from SVN and then install it. You can use my automated bundle scst-files.tar at my github to do all of this for you automatically. https://github.com/gstanden/orabuntu-lxc and download the zip archive and then just unpack the scst-files.tar archive and follow the instructions. In about 15 minutes you will have SCST up and running. The bundle is now multi-distro : it works with Ubuntu Linux and with CentOS Linux. It will almost surely work with RedHat and the bundle could easily be modified for RedHat. I don't have a RedHat instance to validate on, but I do have an Oracle Linux instance, and will be testing it and releasing scst-files.tar for Oracle Linux as well. Thanks.