SCST Manual Testing


At this point you have completed the SCST compilation. Before you continue, you’ll want to do a manual test of the SCST install. I’ll show you how to run the test without having to go through the trouble of setting up a scst.conf file. First, we’ll need a binary file to serve as the iSCSI Device we will publish to our test system. To create the file, we will be utilizing the linux dd command and the device /dev/zero (just a zero device).

Run the following command in whatever test folder you’d like to use. I chose to use /mnt/

user@node1:/mnt/# dd if=/dev/zero /of=lun0.bin bs=1024 count=0 seek=10M

The command will use input device zero and create a thin provisioned binary file of 10G.
of= is the outfile
bs= is the block size (1024)
count=0 is for thin provisioning
seek=10M is how many blocks to provision (10 Million of 1024 blocks)

if you then run

user@node1:/mnt/ls -lah

You should get a listing with human readable output

-rw-r–r– 1 root root 10G Feb 10 10:30 lun0.bin

Ok, now we have the file we will utilize. Now to continue with SCST. The following site is a good place to reference what SCST can and can’t do.  To run the test you now have to load the modules SCST needs to work.

user@node1:/modprobe scst

user@node1:/modprobe scst_vdisk

user@node1:/modprobe iscsi-scst

And start the SCST Service.

user@node1:/service scst start

Now if you run the scstadmin command, you shouldn’t get an error about missing modules.

If you type…


You should get…

Collecting current configuration: done.

No valid operations specified

Now we need to configure the iSCST Target.

We first need add a SCST Target.

user@node1:/scstadmin -add_target iqn.2013-04.local.test:lun0 -driver iscsi

You should get the response…

Collecting current configuration: done.

-> Making requested changes.
        -> Creating target ‘iqn.2013-04.local.test:lun0’ for driver ‘iscsi’: done.
        -> Done.

All done.

Next we add the SCST Device to the target.

user@node1:/scstadmin -open_dev disk0 -handler vdisk_fileio -attributes filename=/mnt/lun0.bin,nv_cache=1

If you get the error…

FATAL: Received the following error:

        No such handler exists.

Try to reload the scst_vdisk module (modprobe scst_vdisk).

If it works you should get…

Collecting current configuration: done.

-> Making requested changes.
        -> Opening device ‘disk0’ using handler ‘vdisk_fileio’: done.
        -> Done.

All done.

Now we create the SCST Lun.

user@node1:/scstadmin -add_lun 0 -driver iscsi -target iqn.2013-04.local.test:lun0 -device disk0

Here we used the SCST Target and Device as defined above.

Now we need to enable the Target.

user@node1:/scstadmin -enable_target iqn.2013-04.local.test:lun0 -driver iscsi

And finally we enable the iSCSI Driver.

user@node1:/scstadmin -set_drv_attr iscsi -attributes enabled=1

You will get the following prompt…

Collecting current configuration: done.

Performing this action may result in lost or corrupt data, are you sure you wish to continue (y/[n]) ?

Press y to allow the change and you’ll be prompted with

-> Making requested changes.
        -> Enabling driver ‘iscsi’: done.
        -> Done, 0 change(s) made.

All done.

And that is it.  You now should have a test iSCSI Target that you should be able to mount with Windows or any other system that will mount an iSCSI Target. From what you can see, setting up a manual iSCSI Target is a bit of work. Fortunately LCMC and the scripts that work with HeartBeat/Pacemaker automate all of this.

I’ll next discuss setting up LCMC and then add the DRBD which actually goes along with LCMC.



Leave a Reply

Your email address will not be published.

Protected with IP Blacklist CloudIP Blacklist Cloud