Sunday, 9 February 2014

How to Add ISCSI Storage Under Linux


Adding Iscsi Storage under Linux is always the problem for everyone, everyone try do this via different way and every time some thing goes wrong !! and in answer no storage showing in linux, it was always painful for everyone so my this writeup is for all those guys they want a simple steps for adding ISCSI storage under linux.So lets start with package 





Check if iscsi-initiator-utils packages is already installed
      -          rpm -qa iscsi-initiator-utils


 If not installed then install it using the following command

-          yum install iscsi-initiator-utils


     Discovery of Targets
Now use iscsiadm command, which is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database. If your storage server IP address is 192.168.105.70, then enter the following command:
iscsiadm -m discovery -t sendtargets -p 192.168.105.70

 service iscsi restart (this command is also use for refreshing the LUN configuration)


Now there should be a block device under /dev directory. To obtain new device name, type:
-          fdisk –l

 Disk /dev/sdb: 42.9 GB, 42949672960 bytes is our partition.


Disk /dev/sdc: 5368 MB, 5368709120 bytes is volume need to be formatted.
-Fdisk /dev/sdc 

Format iSCSI Volume
 Select ‘n’ to add a new partition, then select ‘p’ to create primary partition and give partition number, cylinder starting and ending point and total size and use ‘w’ to write and exit.

 Then use
Fdisk –l command to get the output 
 Just restart the iscsi service on 2nd machine to see new portioned disk.
Note: we will use ‘sdc’ for Voting Disk and sdb ‘for Database’.