Skip to main content

Posts

Showing posts from March, 2020

How to configure ISCSI target and initiator?

What is ISCSI? ISCSI is a shared storage service, by using ISCSI service we can share storage space which we can use as internal storage in different machines. Requirements- 2 CentOS machines Free storage space (as per your requirements) Let’s start with configuration- Configuration (Server-Side)- First, we need to install the targetcli package, # yum install targetcli -y Now start and enable the service. # systemctl start/enable target.service Create partition of free space that you want to share as ISCSI storage. # fdisk /dev/sdb Follow the instructions and create a partition according to your requirements. I’ve created a partition of 6GB size. No need to format this partition but you can create LVM partition if you want. Now run following command- # targetcli > cd /backstores/block > create data_block /dev/sdb1 > cd /iscsi > create iqn.2020-03.com.example:server1 > cd iqn.2020-03.com.example:server1/tpg1/acls > create iqn.2020-03.com.example:desktop1 > cd .