Skip to content

Instantly share code, notes, and snippets.

@wsvn53
Last active June 22, 2016 04:05
Show Gist options
  • Save wsvn53/2786353ce9c5b0347309e3c59c8d5b76 to your computer and use it in GitHub Desktop.
Save wsvn53/2786353ce9c5b0347309e3c59c8d5b76 to your computer and use it in GitHub Desktop.
Using iSCSI target on Ubuntu 14.04

Install open-iscsi

sudo apt-get install open-iscsi

Configure client

vi /etc/iscsi/iscsid.conf

# line 53: uncomment
node.session.auth.authmethod = CHAP

# line 57,58: uncomment and set username and password which set on iSCSI Target
node.session.auth.username = username
node.session.auth.password = password

Restart iSCSI initior

/etc/init.d/open-iscsi restart

Discovery & Login

sudo iscsiadm -m discovery -t sendtargets -p 10.1.1.2
sudo iscsiadm -m node -o show
sudo iscsiadm -m node --login
sudo iscsiadm -m session -o show
cat /proc/partitions

Mount

sudo mount /dev/sdb1 /mnt

Other operations

# delete node
sudo iscsiadm -m node -p 10.1.1.2 --op=delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment