Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a Linux LVM partition on my disk and want to share it over network via iSCSI. However, the target is unreachable with iscsiadm (from both local and remote). The setup is shown below.

Does anybody know the reason that I cannot connect/discover my iSCSI target? (Please let me know, if you need further information.)

In my setup, node01 is running on Proxmox VE 3.1 (Debian 7) with DNS name and static IP address

$ Linux node01 2.6.32-23-pve #1 SMP Tue Aug 6 07:04:06 CEST 2013 x86_64 GNU/Linux

Creation of LVM volume group:

$ fdisk /dev/sdf

Command (m for help): p

Disk /dev/sdf: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9f0d1cbd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1            2048  3907029167  1953513560   8e  Linux LVM

Command (m for help): q

$ pvcreate /dev/sdf1
  Physical volume "/dev/sdf1" successfully created
$ vgcreate myvg /dev/sdf1
  Volume group "myvg" successfully created

iSCSI target setup:

$ sudo apt-get install iscsitarget
Then I have changed the configuration files as follows ...
$ more /etc/default/iscsitarget
# ietd options
# See ietd(8) for details
$  more /etc/iet/ietd.conf
        Lun 0 Path=/dev/sdf1,Type=blockio
        Alias LUN1

$ more /etc/iet/initiators.allow
#ALL ALL,,,, 192.168
$ /etc/init.d/iscsitarget restart
Removing iSCSI enterprise target devices: :.
Removing iSCSI enterprise target modules: :.
Starting iSCSI enterprise target service:.

iSCSI test:

$ iscsiadm -m discovery -t st -p
iscsiadm: cannot make connection to Connection refused
iscsiadm: cannot make connection to Connection refused
iscsiadm: cannot make connection to Connection refused
iscsiadm: cannot make connection to Connection refused
iscsiadm: cannot make connection to Connection refused
iscsiadm: cannot make connection to Connection refused
iscsiadm: connection login retries (reopen_max) 5 exceeded
iscsiadm: Could not perform SendTargets discovery: encountered connection failure
share|improve this question
I know this is not the problem, but i'm curious, why you created a partion for create a vg, intend of create your vg directly on your device? – c4f4t0r Dec 3 '13 at 15:29
As far as I know, you can only add LVM partitions to a LVM volume group but not complete (raw) devices. Hence, I created one LVM partition that occupies the full disk and added it to the volume group. Further, after configuring the iSCSI target successfully (see in my own answer), the volume group is also visible and usable at the initiator side. – sema Dec 4 '13 at 17:28
up vote 0 down vote accepted

This is not meant to be a rude answer to my own questions, but was really my 'solution':

apt-get purge iscsitarget
apt-get install tgt

# Unfortunately, on my version of Proxmox VE there is no init.d script to start and stop tgtd. As a consequence, I need to go nasty ways of workarounds to start and stop tgtd on startup/shutdown/restart. See below:
tgtadm --lld iscsi --op new --mode target --tid 1 -T
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sdf1
tgtadm --lld iscsi --op bind --mode target --tid 1 -I,,,, 192.168

# To see if everything is configured correctly, use this:
tgtadm --lld iscsi --op show --mode target

On the initiator side, do this:

iscsiadm --mode discovery --type sendtargets --portal
# Shows this output:,1

# This creates a volume /dev/sdg and partition /dev/sdg1
iscsiadm --mode node --targetname --portal --login

For more information, see here:

To make this permanent, use this on the target side:

tgtadm --dump > /etc/tgt/targets.conf

# Add this to /etc/rc.local
tgt-admin --execute

To make a clean 'logoff' add this to a script for shutdown on the initiator side

# Some code to turn off your disk users
iscsiadm --mode node --targetname --portal --logoff
rm /dev/sdg
share|improve this answer

i had the same problem. This wiki thread fixed the problem:

First of all, check if the following problem exists:

  1. Start ietd (/etc/init.d/iscsitarget start)
  2. Execute ietd -d 8 -f -> Expected result: "1387214741.122258: kernel module version mismatch!"
  3. Stop ietd /etc/init.d/iscsitarget stop

To rebuild the module with current kernel:

  1. Install kernel headers: apt-get install pve-headers-$(uname -r)
  2. Install DKMS of iscsitarget: apt-get install iscsitarget-dkms
  3. Add the following lines to the file '/var/lib/dkms/iscsitarget/'



  4. Rebuild modules: dkms autoinstall

  5. Start ietd (/etc/init.d/iscsitarget start)
share|improve this answer
Please don't just give links, as external websites may disapear. Instead rephrase relevant parts according to the question. – user130370 Dec 3 '13 at 15:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.