HowTo: Mount iSCSI on Debian 6 (Squeeze)

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

HowTo: Mount iSCSI on Debian 6 (Squeeze)

Post by ^rooker »

Install required packages:

Code: Select all

$ apt-get install iscsitarget iscsitarget-dkms open-iscsi
Discover existing iSCSI targets on host $HOST_IP:

Code: Select all

$ iscsiadm -m discovery -t st -p $HOST_IP
Should return something like this, for example:
192.168.1.208:3260,1 iqn.2015-10.DVA-Hive:Debian_6.lun1
Information about found/known nodes is stored in: /etc/iscsi/nodes/.

And can be retrieved with:

Code: Select all

$ iscsiadm -m node
Connect the iSCSI target:
In my case, I've configured the iSCSI target without any login (for testing). But in order to connect to it, you still need to "login":

Code: Select all

$ iscsiadm -m node --targetname "iqn.2015-10.DVA-Hive:Debian_6.lun1" --login
Logging in to [iface: default, target: iqn.2015-10.DVA-Hive:Debian_6.lun1, portal: 192.168.1.208,3260]
Login to [iface: default, target: iqn.2015-10.DVA-Hive:Debian_6.lun1, portal: 192.168.1.208,3260]: successful

Show new device:

Code: Select all

$ fdisk -l
The iSCSI target will just show up like a raw device (e.g. /dev/sdb).

Partition and format it like a normal device.
You're done! :)


Based on Falko Timme's HowTo: https://www.howtoforge.com/using-iscsi- ... and-target
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: HowTo: Mount iSCSI on Debian 6 (Squeeze)

Post by ^rooker »

If you want that iSCSI target/device to be mounted automatically upon reboot/startup, do the following:

1) Edit "/etc/iscsi/nodes/*/*/defaults" for this iSCSI target.
Set the "node.startup" to automatic:

Code: Select all

node.startup = automatic
2) Add it to /etc/fstab:
Add an fstab line as usual and add the following parameters:

Code: Select all

defaults,auto,_netdev
For example:

Code: Select all

UUID=6791f623-8ce3-45e7-9df9-429e4bbe0ac2       /mnt/my_iscsi    ext4    defaults,auto,_netdev   0     0
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply