[ t h e f r a g g l e . c o m ]

technology, photography and anything else that springs to mind.

iSCSI quick-start guide.

I had to configure an iSCSI target for testing purposes, the steps I followed are below.

This assumes that you have the tgtadm software installed, and that you are making use of LVM.

1. create the backing volume in lvm

we have one volume group, called vg01, if you want to see what volume groups you have available, issue:

$ vgs
VG   #PV #LV #SN Attr   VSize  VFree
vg01   1   6   0 wz--n- 501G    295G

To create your volume, issue something like this:

$ lvcreate -L50G vg01 -n iscsiback01

Logical volume “iscsiback01″ created

2. set up the iSCSI target
2.1 create the iSCSI target

$ tgtadm --lld iscsi --op new --mode target --tid 1 -T test-file01:storagetest

To verify this was created successfully:

$ tgtadm --lld iscsi --op show --mode target

Target 1: test-file01:storagetest
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: deadbeaf1:0
SCSI SN: beaf10
Size: 0 MB
Online: Yes
Removable media: No
Backing store: No backing store
Account information:
ACL information:

2.2  Add a LUN to the target

$ tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/vg01/iscsiback01

2.3 Allow access to the new target

$ tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Instead of using “ALL” you can specify addresses that you want to be allowed to access these LUNs.

3. Set up an iSCSI initiator

Lets assume that our iSCSI target server is sat on 192.168.10.1, on the initiator you need to issue the following to discover the targets on there

$ iscsiadm --mode discovery --type sendtargets --portal 192.168.10.1
192.168.10.1:3260,1 test-file01:storagetest

Once you’ve done this log into the target session

$ iscsiadm --mode node --targetname test-file01:storagetest --portal 192.168.10.1:3260 --login

Once you’ve done this, the first LUN should be added as a new sdX device, “fdisk -l” should show this new disk, if not, restart the iscsi service on the initiator and then perform a partprobe.

If you add a new LUN to the target, you can always refresh your iscsi session to force it to show up:

$ iscsiadm -m session -R

It’s worth noting that this tool won’t save any of this configuration to a config file. I resorted to entering the commands above into /etc/rc.local to make sure they were run on boot. You also need to make sure that iscsid and tgtadm are set to start on boot, if you’re using RHEL or clone of that, a simple:


$ chkconfig iscsid on
$ chkconfig tgtadm on

Will do this for you, if you’re using debian:


$ update-rc.d iscsid defaults
$ update-rc.d tgtadm defaults

Should do the same.

See http://stgt.berlios.de/ for more information about tgt

Tags: , , ,
, , ,
September 14, 2009 at 3:19 pm Comments (0)

cheap portable hard disks a go go

I decided to buy a portable hard disk this week for my trip to germany, so that I can ensure I don’t run out of CF space.

It’s a vosonic vp2160, and at £109 for a 60gb model I’m pretty happy. It happily reads my CF card fresh from the camera, and copies over all the images pretty speedily.

The interface is super simple and easy to use, it doesn’t play music or anything like that, but all I wanted it for was to store pictures on till I get home and can process the images.

The USB2.0 interface is speedy enough to copy over files i’ve copied to the disk, and also allows you to use the device as a CF/MMC/whatever reader for your PC, which is handy. It’s pretty handy too how you can charge the Li-ion battery via USB too (you have to plug two usb connectors into your pc, but that’s no biggie really)

What really impressed me the most, however, is how it actually seems to suggest you should be fine upgrading the hard disk at some point. They include (amongst the power adapter to charge it up and the install cd for win98 drivers etc) a mini screwdriver to uncouple the back off it, which reveals a bog standard fujitsu 2.5″ hard disk. So if I decide 60gb isn’t enough in this little device I will be able to have a good go at upgrading the hard disk!.

Vosonic VP2160

I also purchased a Creative Zen Vision:M 30gb today too today to tide me for my trip to germany, but will druel more at that when it arrives tomorrow :D

Tags: , , , ,
, , , ,
June 21, 2007 at 6:35 pm Comments (0)