How to Configure ISCSI Drive from SAN on Linux

Configure iSCSI Drive from SAN on Linux

iSCSI stands for internet small computer system interface. iSCSI is a transport layer protocol that uses initiators to send commands to target storage devices on remote sites. The storage targets can be on SAN, NAS, Tape devices and etc. 

Here we are using software based iSCSI initiator that is less expansive then  Host base adapter that is a hardware device. With the help of iSCSI we can setup centralized storage. iSCSI is use standard Ethernet, it is not require expansive switches and cards that require to run on Fiber Channel Networks. 

The Performance of iSCSI is depend upon the technologies for example 10 GbE, Mulitpathing I/O, Jumbo Frames and Data center bridging.

Here we are configuring iSCSI Drive from SAN (Storage Area Network) on Linux (RedHat 7, CentOS 7, Oracle Linux 7 and etc).

First configure the IP address on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc) of same LAN (Local Area Network) as same network of SAN (Storage Area Network). In this scenario the IP configuration on the Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc) is mention below.

IP: 10.0.11.20
Netmask: 255.255.255.0
Gateway: 10.0.11.1

configure iscsi drive from san to linux

Install the package "iscsi-initiator-utils" on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc) that is use to connect the iSCSI storage from remote storage device (SAN, NAS, Tape devices and etc), in our case SAN (Storage Area Network). To install the package "iscsi-initiator-utils" on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc) type the below mention command.

yum install iscsi-initiator-utils

configure iscsi drive from san on linux

The package "iscsi-initiator-utils" has successfully installed on Linux machine (Oracle Linux 7) that uses the distribution package of Oracle Linux and compiled from Red Hat Enterprise Linux source code.

configure iscsi drive from san on linux

Use vi editor to configure node.startup to automatic in file "iscsid.conf" that is available in directory "/etc/iscsi/".

vi /etc/iscsi/iscsid.conf
Set the node.startup to automatic.
node.startup = automatic

Use vi  editor to copy the iSCSI initiator name from the file "initiatorname.iscsi" that is available in directory "/etc/iscsi".

vi /etc/iscsi/initiatorname.iscsi

how to configure iscsi drive from san on linux

By-default every Linux machine have unique iSCSI initiator name, you can change the iSCSI initiator name as per your requirement.

how to configure iscsi drive from san on linux

To create a connection of SAN (Storage Area Network) device with the Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc). Set the ip address, hostname and iscsi initiator name of Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc) on SAN device.

Configuration Details:

IP: 10.0.11.20
Server: OracleAPP
initiator: iqn.1988-12.com.xxx:54215484bxxx

how to configure iscsi drive from san on linux

After create a connection of SAN (Storage Area Network) device with the Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), restart the iSCSI service on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), type the below mention command.

service iscsid restart

how mount iscsi drive from san to linux

To check the available connections of SAN (Storage Area Network) device on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), use iSCSI discovery by type the below mention iscsiadm command.

iscsiadm -m discovery -t st -p 10.0.11.5

how mount iscsi drive from san to linux

To log on to an iSCSI target that is available on SAN (Storage Area Network), type the below mention iscsiadm command.

iscsiadm -m node --targetname "iqn.1992-04.com.emc:cx.fcnmm093100339.a0" --portal "10.0.0.11.5:3260" -login


how mount iscsi drive from san to linux

Complete details of connection are mention in below image, that have the valuable information of connection.

how mount iscsi drive from san to linux

To check the iSCSI drive of SAN (Storage Area Network) on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), use command "fdisk -l".

fdisk -l


After type the command "fdisk -l" on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), the details of iSCSI drive are mention in below image.


Create a directory "Prod_Temp_Bak" for mount the iSCSI drive in it. Use below mention command to create a directory, the attribute -p is use to create child directory with parent directory. Here parent directory is "iscsi" and child directory is "Prod_Temp_Bak".

mkdir -p /mnt/iscsi/Prod_Temp_Bak

mount iscsi drive from san to linux

To create a partition on the iSCSI drive use command "fdisk", the complete command is mention below.

fdisk /dev/sdb

mount iscsi drive from san to linux

To create a partition on the iSCSI drive, the complete steps are as follows.

Step 1:

Type "n" for new partition, then type "p" for primary partition.

Step 2: 

Type "1" for first Partition number, then press enter two times for first and last cylinder respectively. you can set specific partition size as per your requirement.

Press "p", for print the newly created partition for verification.

Step 3:

Type "w" to write the partition.

mount iscsi drive from san to linux

To make a file system "ext3" of newly created partition "/dev/sdb1", type the below mention command.

mkfs.ext3 /dev/sdb1

setup iscsi target on linux

To mount the newly created partition "/dev/sdb1" on directory "/mnt/iscsi/Prod_Temp_Bak/", type the below mention command.

mount /dev/sdb1 /mnt/iscsi/Prod_Temp_Bak/

setup iscsi target on linux

To check the mounted iSCSI drive on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), type the below mention command.

df -hT

setup iscsi target on linux

For permanent mount iSCSI drive on Linux machine (RedHat 7, CentOS 7, Oracle Linux 7 and etc), edit the below mention line in file "/etc/fstab" by use of vi editor.

/dev/sdb1 /mnt/iscsi/Prod_Temp_Bak/ ext3 _netdev 0 0

Thanks for Read this Article

Comments