iscsi/service-install.sh

raw link view readme
1 fdisk /dev/sdc <
2 n
3 p
4 1
5
6
7 w
8 EOF
9
10 yum install firewalld -y
11 systemctl start firewalld
12 systemctl enable firewalld
13 firewall-cmd --permanent --zone=public --add-interface=eth0
14 firewall-cmd --reload
15 firewall-cmd --permanent --add-service=iscsi-target --zone=public
16 firewall-cmd --reload
17
18 yum install epel-release -y
19 yum install scsi-target-utils -y
20
21 mv /etc/tgt/targets.conf /etc/tgt/targets.conf.original
22
23 cat > /etc/tgt/targets.conf << EOF
24
25 backing-store /dev/sdc
26
27 EOF
28
29 systemctl start tgtd
30 systemctl enable tgtd
31