###############
First step: Create a 2G partition
Step two: Yum install targetcli-y step three: Create a 2G partition and synchronize
Fourth Step: Execute TAGETCLI
LS View
/>/backstores/block Create westos:storage1/dev/vdb1 set/DEV/VDB1 as a shared hard drive and name
/>/ISCSI Create iqn.2018-08.com.westos:storage1 generate external share name
/> Iscsi/iqn.2018-08.com.westos:storage1/tpg1/acls Create Iqn.2018-08.com.westos:westoskey1 key generation
/> Iscsi/iqn.2018-08.com.westos:storage1/tpg1/luns Create/backstores/block/westos:storage1 associating an external name with an internal device
/> iscsi/iqn.2018-08.com.westos:storage1/tpg1/portals Create 172.25.254.204 Open Interface exit Save and exit
##############################################################
Client settings
Yum Install iscsi-initiator-utils-y Installation
Iscsiadm-m discovery-t st-p 172.25.254.204 View the ports that can be connected
Iscsiadm-m node-t iqn.2018-08.com.westos:storage1-p 172.25.254.204-l landed on this port at this time the login port will be found to be a failure, Because there is no password entered on the server-side set Key1
VIM/ETC/ISCSI/INITIATORNAME.ISCSI edit this file, set the password
Initiatorname=iqn.2018-08.com.westos:key1
Systemctl Restart Iscsid.service Restart this service
Iscsiadm-m node-t iqn.2018-08.com.westos:storage1-p 172.25.254.204-l login again, login successfully, at this time fdisk-l can display SDA hard disk
FDISK/DEV/SDA Creating a new partition
MKFS.XFS/DEV/SDA1 Formatting partitions
mount/dev/sda1/mnt/Mount Partition
Df-h
Vim/etc/fstab setting up auto mount on boot
/DEV/SDA1/MNT/XFS Defaults,netdev 0 0 Since this mount can only be mounted after the network service is started, the default parameters are added, _netdev
Mount-a
Df-h #####################
Delete and logout of SDB1 on client
Vim/etc/fstab Canceling the default mount
UMOUNT/DEV/SDA1 Uninstall
Dfisk-l See Also
Exit Login
[Email protected] ~]# iscsiadm-m node-t iqn.2018-08.com.westos:storage1-p 172.25.254.204-u
Delete a node
[Email protected] ~]# iscsiadm-m node-t iqn.2018-08.com.westos:storage1-p 172.25.254.204-o Delete
Yum Install tree tree/var/lib/iscsi/view
Systemctl Restart iSCSI
Fdisk-l found success at this time ############## #服务器上的删除
Targetcli
Clearconfig
Clearconfig Confirm=true
Ls
Exit
iSCSI Services in Linux