Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created January 10, 2014 09:55
Show Gist options
  • Save tkuchiki/8349332 to your computer and use it in GitHub Desktop.
Save tkuchiki/8349332 to your computer and use it in GitHub Desktop.
iscsi over ssh tunnel
$ autossh -M 33333 -N -f -L 13260:10.150.1.26:3260 sg
$ yum install -y iscsi-initiator-utils
$ iscsiadm -m discovery -t sendtargets -p 127.0.0.1:13260
$ vim /var/lib/iscsi/send_targets/127.0.0.1\,13260/iqn.1997-05.com.amazon\:myvolume\,10.150.1.26\,3260\,1\,default/default
#node.conn[0].address = 10.150.1.26
#node.conn[0].port = 3260
node.conn[0].address = 127.0.0.1
node.conn[0].port = 13260
$ iscsiadm -m node -T iqn.iqn.1997-05.com.amazon:myvolume --login
$ fdisk -l
$ fdisk /dev/sdX
...
$ yum install -y xfsprogs xfsdump
$ mkfs.xfs -f /dev/sdX
...
$ mkdir /data
$ mount /dev/sdX /data
# $HOME/.ssh/config
Host sg
HostName Your Elastic IP
IdentityFile /root/.ssh/id_rsa
User root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment