How to add an ISCSI disk on linux server

root's picture

So you have configured a brand new iscsi disk and want to put it to use in linux client?
No problem, read below!

Note: in our example, the ISCSI server is on 192.168.69.66

1. Discover the disks:

venus:~# iscsiadm -m discovery -t sendtargets -p 192.168.69.66
192.168.69.66:3260,3 iqn.2014-07.ro.gz.sun:swap-venus

2. activate them:

venus:~# iscsiadm -m node --login -p 192.168.69.66
Logging in to [iface: default, target: iqn.2014-07.ro.gz.sun:swap-venus, portal: 192.168.69.66,3260]

3. You should see the new disk with fdisk command now:

venus:~# fdisk -l /dev/sdb

Disk /dev/sdb: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

END!

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content