0. Online help
server-side / target:
targetcli is one of the most friendly software which provides fantastic UI and on-line help.
'ls' and 'cd' commands are so helpful. When you "cd" into a path, "help" lists available commands in the current context.
client-side / initiator:
man iscsiadm [EXAMPLES section]
1. Cheat-sheet
1.1 Server side
# Prepare the backstore partitionparted /dev/vda
>print free
>mkpart primary ....
# in targetcli, create backstore, iqn, lun, acl, portal
targetcli
# firewall setup
firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 source address=192.168.100.40/32 port port=3260 accept'
firewall-cmd --reload
1.2 Client side
# modify /etc/iscsi/initiatorname.iscsiInitiatorName=iqn.2001-05.com.example:client
# dicover the iqn
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.100.30 --discover
# login the iqn
iscsiadm --mode node --targetname iqn.2001-05.com.example:server --portal 192.168.100.30:3260 --login
# list targets
iscsiadm --mode node
# check the new iscsi disk/lun
lsblk
# partition the disk
parted /dev/sda
# modify /etc/fstab
blkid # get the UUID of the part
/etc/fstab: UUID="xxxx" /mnt/data xfs defautls 0 0
mount -a
2. Tips
- Create the required back store at the very beginning of the exam.
This task may ask creating a partition / LV as a back store. Storage operations are critical as they may cause the OS failed to boot.
- Don't try to shrink ROOT fs!!!
For extending or shrinking FS/LV, please refer to:
https://www.linuxexam.net/2019/09/ex300-how-to-resize-ext4-file-system.html
It's much better to pass the exam with losing marks on this task than to fail the exam because of an unbootable system.
No comments:
Post a Comment