hostnamectl set-hostname [Link].
local
[Link]-month.reverse_domain_lookup
add three disks to your srv
echo "- - -" > /sys/class/scsi_host/host#/scan
1. Create Storage with RAID 5 Device.
sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sda /dev/sdb
/dev/sdc
you will find it
ls -l /dev/md/mditi10
cat /proc/mdstat
1. Create two with pysical volume partitions
fdisk /dev/md127 t:8e
pvcreate /dev/md127p1 /dev/md127p2
vgcreate testvg /dev/md127p1 /dev/md127p2
lvcreate -n lun1 -L 20G testvg
lvcreate -n lun2 -l 100%free testvg
################333Install Target Package
dnf install targetcli -y
targetcli
ls
##############Create add the Storage to storage backend as block device or fileio
cd /backstores/block
#Created block storage object LUN1 using /dev/testvg/lv-lun1
backstores/block> create dev=/dev/testvg/lv-lun1 name=LUN1
backstores/block> create dev=/dev/testvg/lv-lun2 name=LUN2
Created block storage object LUN2 using /dev/testvg/lv-lun2.
#@2222###########Create IQN for the iSCSI target
[Link]-month.reverse_domain_lookup
create [Link].srv1
cd [Link].srv1/
cd tpg1/acls
create [Link].client1
#####################################################
export block devices as luns
Create LUN to be seen at the iSCSI target
cd tpg1/luns
create /backstores/block/LUN1
#########################################3
systemctl enable --now [Link]
firewall-cmd --add-service=iscsi-target --permanent
firewall-cmd --add-service=iscsi-target
firewall-cmd --add-port=3260/tcp
##################################################
1-add backstore
2-create server (target) iqn
3-create acl clients
4-mapping backstore as lun (export)
when exit it save config /etc/target/[Link]
5-default portal
###################################################
On Client Side
dnf install iscsi-initiator-utils -y
edit your client iqn
The default /etc/iscsi/[Link] file contains a generated IQN using Red
Hat's domain
t he /etc/iscsi/[Link] file contains default settings for node records created
during new target discovery.
Settings include iSCSI timeouts, retry parameters, and authentication usernames and
passwords. Changing this file requires restarting the iscsi service.
systemctl enable --now iscsid
iscsiadm --mode discovery --type sendtargets --portal [Link]
iscsiadm --mode discoverydb --type sendtargets --portal [Link]
iscsiadm --mode node --targetname [Link].server1. --portal
[Link] --login
lsscsi
#umount before logout
#presistent mount
/etc/fstab
UUID=4958d8fc-0c26-4ea4-9b63-2990a182d7e9 /mnt/data2 ext4 defaults,_netdev
0 0
UUID=f91d93e2-5a61-4211-af05-2ab568889048 /mnt/data1 ext4 defaults,_netdev
0 0
iscsiadm --mode node --targetname [Link].srv1 --portal
[Link] --logout
iscsiadm --mode node --targetname [Link].srv1 --portal
[Link] -o delete
[Link] = CHAP
[Link] = username
[Link] = password
iscsi/iqn.20...cloud.client1> set auth userid=romany password=123
service iscsi restart
nano /var/lib/iscsi/nodes/
/iscsi/iqn.20...lab.srv1/tpg1> set attribute authentication=1
after logout an relogin again
vgchange -an test
vgchange -ay test