-
Notifications
You must be signed in to change notification settings - Fork 1
/
RHEL Client 7.4.log
114 lines (106 loc) · 8.68 KB
/
RHEL Client 7.4.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
[BEGIN] 2020/4/30 21:14:02
[root@Client ~]# yum -y install iscsi-init*
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
软件包 iscsi-initiator-utils-6.2.0.874-4.el7.x86_64 已安装并且是最新版本
软件包 iscsi-initiator-utils-iscsiuio-6.2.0.874-4.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@Client ~]# vim /etc/iscsi/initiatorname.iscsi
[root@Client ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2020-04.bad.com:bad
[root@Client ~]# systemctl restart iscsid
[root@Client ~]# systemctl enable iscsid
[root@Client ~]# man iscsiadm
[root@Client ~]# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.43.128 --discover
192.168.43.128:3260,1 iqn.2020-04.bad.com:server2
192.168.43.128:3260,1 iqn.2020-04.bad.com:server1
[root@Client ~]# iscsiadm --mode node --targetname iqn.2020-04.bad.com:server1 --portal 192.168.43.128:
3260 --login
Logging in to [iface: default, target: iqn.2020-04.bad.com:server1, portal: 192.168.43.128,3260] (multiple)
Login to [iface: default, target: iqn.2020-04.bad.com:server1, portal: 192.168.43.128,3260] successful.
[root@Client ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─rhel-root 253:0 0 17G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm
sdb 8:16 0 3G 0 disk
sr0 11:0 1 3.8G 0 rom /mnt
[root@Client ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0x920c6bfc 创建新的 DOS 磁盘标签。
命令(输入 m 获取帮助):n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
分区号 (1-4,默认 1):
起始 扇区 (8192-6291455,默认为 8192):
将使用默认值 8192
Last 扇区, +扇区 or +size{K,M,G} (8192-6291455,默认为 6291455):+500M
分区 1 已设置为 Linux 类型,大小设为 500 MiB
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
正在同步磁盘。
[root@Client ~]# partprobe /dev/sdb
[root@Client ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─rhel-root 253:0 0 17G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm
sdb 8:16 0 3G 0 disk
└─sdb1 8:17 0 500M 0 part
sr0 11:0 1 3.8G 0 rom /mnt
[root@Client ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=4096 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=34078720
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (8192 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[root@Client ~]# blkid /dev/sdb1
/dev/sdb1: UUID="7284c233-f322-4c7b-9d2c-a248d7bf1a52" TYPE="ext4"
[root@Client ~]# mkdir /netdev
[root@Client ~]# vim /etc/fstab
[root@Client ~]# tail -1 /etc/fstab
UUID="7284c233-f322-4c7b-9d2c-a248d7bf1a52" /netdev ext4 defaults,_netdev 0 0
[root@Client ~]# mount -a
[root@Client ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/rhel-root 17G 3.2G 14G 19% /
devtmpfs 897M 0 897M 0% /dev
tmpfs 912M 0 912M 0% /dev/shm
tmpfs 912M 9.1M 903M 1% /run
tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sda1 1014M 179M 836M 18% /boot
tmpfs 183M 24K 183M 1% /run/user/1000
/dev/sr0 3.8G 3.8G 0 100% /mnt
tmpfs 183M 0 183M 0% /run/user/0
/dev/sdb1 477M 2.3M 445M 1% /netdev
[root@Client ~]# cd /netdev/
[root@Client netdev]# echo 'I AM Bad Boy!' > wangjie.txt
[root@Client netdev]# ls
lost+found wangjie.txt
[root@Client netdev]# cat wangjie.txt
I AM Bad Boy!
[END] 2020/4/30 21:23:03