-
Notifications
You must be signed in to change notification settings - Fork 1
/
RHEL Server 7.0.log
194 lines (179 loc) · 18.4 KB
/
RHEL Server 7.0.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
[BEGIN] 2020/4/30 21:02:46
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Thu Apr 30 19:54:34 2020
[root@Server ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 19.5G 0 part
├─rhel-root 253:0 0 17.5G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
sr0 11:0 1 3.5G 0 rom /run/media/jay/RHEL-7.0 Server.x86_64
[root@Server ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0x1d74251c 创建新的 DOS 磁盘标签。
命令(输入 m 获取帮助):n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
分区号 (1-4,默认 1):
起始 扇区 (2048-20971519,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-20971519,默认为 20971519):+3G
分区 1 已设置为 Linux 类型,大小设为 3 GiB
命令(输入 m 获取帮助):n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
分区号 (2-4,默认 2):
起始 扇区 (6293504-20971519,默认为 6293504):
将使用默认值 6293504
Last 扇区, +扇区 or +size{K,M,G} (6293504-20971519,默认为 20971519):+3G
分区 2 已设置为 Linux 类型,大小设为 3 GiB
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
正在同步磁盘。
[root@Server ~]# partprobe /dev/sdb
[root@Server ~]# yum -y install target*
已加载插件:langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
正在解决依赖关系
--> 正在检查事务
---> 软件包 targetcli.noarch.0.2.1.fb34-1.el7 将被 安装
---> 软件包 targetd.noarch.0.0.7.1-1.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
===============================================================================================
Package 架构 版本 源 大小
===============================================================================================
正在安装:
targetcli noarch 2.1.fb34-1.el7 Base 55 k
targetd noarch 0.7.1-1.el7 Base 48 k
事务概要
===============================================================================================
安装 2 软件包
总下载量:104 k
安装大小:305 k
Downloading packages:
-----------------------------------------------------------------------------------------------
总计 4.5 MB/s | 104 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : targetd-0.7.1-1.el7.noarch 1/2
正在安装 : targetcli-2.1.fb34-1.el7.noarch 2/2
验证中 : targetcli-2.1.fb34-1.el7.noarch 1/2
验证中 : targetd-0.7.1-1.el7.noarch 2/2
已安装:
targetcli.noarch 0:2.1.fb34-1.el7 targetd.noarch 0:0.7.1-1.el7
完毕!
[root@Server ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 19.5G 0 part
├─rhel-root 253:0 0 17.5G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
├─sdb1 8:17 0 3G 0 part
└─sdb2 8:18 0 3G 0 part
sr0 11:0 1 3.5G 0 rom /mnt
[root@Server ~]# targetcli
targetcli shell version 2.1.fb34
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> ls
o- / .................................................................................... [...]
o- backstores ......................................................................... [...]
| o- block ............................................................. [Storage Objects: 0]
| o- fileio ............................................................ [Storage Objects: 0]
| o- pscsi ............................................................. [Storage Objects: 0]
| o- ramdisk ........................................................... [Storage Objects: 0]
o- iscsi ....................................................................... [Targets: 0]
o- loopback .................................................................... [Targets: 0]
/> cd /backstores/block
/backstores/block> create iscsi_store1 /dev/sdb1
Created block storage object iscsi_store1 using /dev/sdb1.
/backstores/block> create iscsi_store2 /dev/sdb2
Created block storage object iscsi_store2 using /dev/sdb2.
/backstores/block> cd /iscsi
/iscsi> create iqn.2020-04.bad.com:server1
Created target iqn.2020-04.bad.com:server1.
Created TPG 1.
/iscsi> create iqn.2020-04.bad.com:server2
Created target iqn.2020-04.bad.com:server2.
Created TPG 1.
/iscsi> cd iqn.2020-04.bad.com:server1/tpg1/acls
/iscsi/iqn.20...er1/tpg1/acls> create iqn.2020-04.bad.com:bad
Created Node ACL for iqn.2020-04.bad.com:bad
/iscsi/iqn.20...er1/tpg1/acls> cd ..
/iscsi/iqn.20...:server1/tpg1> cd luns
/iscsi/iqn.20...er1/tpg1/luns> create /backstores/block/iscsi_store1
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.2020-04.bad.com:bad
/iscsi/iqn.20...er1/tpg1/luns> cd ..
/iscsi/iqn.20...:server1/tpg1> cd portals
/iscsi/iqn.20.../tpg1/portals> create 192.168.43.128 3260
Using default IP port 3260
Created network portal 192.168.43.128:3260.
/iscsi/iqn.20.../tpg1/portals> cd /iscsi/
/iscsi> cd iqn.2020-04.bad.com:server2/tpg1/acls
/iscsi/iqn.20...er2/tpg1/acls> create iqn.2020-04.bad.com:bad
Created Node ACL for iqn.2020-04.bad.com:bad
/iscsi/iqn.20...er2/tpg1/acls> cd ..
/iscsi/iqn.20...:server2/tpg1> cd luns
/iscsi/iqn.20...er2/tpg1/luns> create /backstores/block/iscsi_store2
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.2020-04.bad.com:bad
/iscsi/iqn.20...er2/tpg1/luns> cd ..
/iscsi/iqn.20...:server2/tpg1> cd portals
/iscsi/iqn.20.../tpg1/portals> create 192.168.43.128 3260
Using default IP port 3260
Created network portal 192.168.43.128:3260.
/iscsi/iqn.20.../tpg1/portals> cd /
/> ls
o- / .................................................................................... [...]
o- backstores ......................................................................... [...]
| o- block ............................................................. [Storage Objects: 2]
| | o- iscsi_store1 ............................... [/dev/sdb1 (3.0GiB) write-thru activated]
| | o- iscsi_store2 ............................... [/dev/sdb2 (3.0GiB) write-thru activated]
| o- fileio ............................................................ [Storage Objects: 0]
| o- pscsi ............................................................. [Storage Objects: 0]
| o- ramdisk ........................................................... [Storage Objects: 0]
o- iscsi ....................................................................... [Targets: 2]
| o- iqn.2020-04.bad.com:server1 .................................................. [TPGs: 1]
| | o- tpg1 .......................................................... [no-gen-acls, no-auth]
| | o- acls ..................................................................... [ACLs: 1]
| | | o- iqn.2020-04.bad.com:bad ......................................... [Mapped LUNs: 1]
| | | o- mapped_lun0 ..................................... [lun0 block/iscsi_store1 (rw)]
| | o- luns ..................................................................... [LUNs: 1]
| | | o- lun0 ............................................ [block/iscsi_store1 (/dev/sdb1)]
| | o- portals ............................................................... [Portals: 1]
| | o- 192.168.43.128:3260 ......................................................... [OK]
| o- iqn.2020-04.bad.com:server2 .................................................. [TPGs: 1]
| o- tpg1 .......................................................... [no-gen-acls, no-auth]
| o- acls ..................................................................... [ACLs: 1]
| | o- iqn.2020-04.bad.com:bad ......................................... [Mapped LUNs: 1]
| | o- mapped_lun0 ..................................... [lun0 block/iscsi_store2 (rw)]
| o- luns ..................................................................... [LUNs: 1]
| | o- lun0 ............................................ [block/iscsi_store2 (/dev/sdb2)]
| o- portals ............................................................... [Portals: 1]
| o- 192.168.43.128:3260 ......................................................... [OK]
o- loopback .................................................................... [Targets: 0]
/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
[root@Server ~]# systemctl restart target.service
[root@Server ~]# systemctl enable target.service
[root@Server ~]# systemctl stop firewall
[END] 2020/4/30 21:10:49