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.
I've scripted this so that you can build the scst kernel automatically using the above procedure. Go to:
https://github.com/gstanden/orabuntu-lxc
and download the project archive. Unzip the archive and find the scst-files.tar and unzip it with 'tar -xvf scst-files.tar'. Run the scripts in order to create the scst ubuntu kernel. The scripting has been tested on Ubuntu 3.x and 4.x kernels. It automatically edits the required files and automatically selects correct directories based on the detected kernel version. Please let me know at [email protected] if you hit any bugs running the bundle and I will work to fix them if you provide details.
To create, and then, boot into, the scst kernel, and create the scst binaries, you only need to run the following scripts:
create-scst-1a.sh
create scst-1b.sh
create-scst-1c.sh
create-scst-1d.sh
create-scst-2a.sh
create-scst-2b.sh
create-scst-3.sh
The rest of the scripts create targets and LUNs etc. that are specific to my Oracle on Ubuntu project (orabuntu-lxc) so if you are not going to use the SCST SAN for orabuntu-lxc, you are done, and you can proceed to manually create your targets, groups, LUNs, etc. from that point as per your requirements.