客户端设置
1.安装
yum -y install iscsi-initiator-utils
2.启动
systemctl start iscsi //启动
systemctl enable iscsi //关闭
3.发现目标
[root@oawebserver ~]# iscsiadm -m discovery -t sendtargets -p 10.1.9.4:3260 //输入
10.1.9.4:3260,1 iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target //显示
4.登陆节点
[root@oawebserver ~]# iscsiadm -m node –T iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target -p 10.1.9.4:3260 -l
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target, portal: 10.1.9.4:3260] (multiple)
Login to [iface: default, target: iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target, portal: 10.1.9.4:3260] successful.
5.系统启动时自动登陆
iscsiadm -m node –T iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target -p 10.1.9.4:3260 --op update -n node.startup -v automatic
6.查看磁盘信息
[root@oawebserver ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 300G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 50G 0 part /home
├─sda3 8:3 0 40G 0 part /usr
├─sda4 8:4 0 1K 0 part
├─sda5 8:5 0 40G 0 part /var
├─sda6 8:6 0 20G 0 part /tmp
├─sda7 8:7 0 16G 0 part [SWAP]
└─sda8 8:8 0 133G 0 part /
sdc 8:32 0 2T 0 disk //新增加的硬盘
sr0 11:0 1 1024M 0 rom
[root@oawebserver ~]# fdisk -l
磁盘 /dev/sda:322.1 GB, 322122547200 字节,629145600 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x000657d4
设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 106956799 52428800 83 Linux
/dev/sda3 106956800 190842879 41943040 83 Linux
/dev/sda4 190842880 629145599 219151360 5 Extended
/dev/sda5 190844928 274731007 41943040 83 Linux
/dev/sda6 274733056 316676095 20971520 83 Linux
/dev/sda7 316678144 350232575 16777216 82 Linux swap / Solaris
/dev/sda8 350234624 629145599 139455488 83 Linux
磁盘 /dev/sdc:2198.2 GB, 2198171811840 字节,4293304320 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
7.登出节点
[root@oawebserver ~]# iscsiadm -m node –T iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target -p 10.1.9.4:3260 -u
Logging out of session [sid: 6, target: iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target, portal: 10.1.9.4,3260]
Logout of [sid: 6, target: iqn.1991-05.com.microsoft:oaspzhserver-ekpfile-target, portal: 10.1.9.4,3260] successful.
8.刷新节点
iscsiadm -m session –R
9.注销所有节点
iscsiadm -m node --logoutall=all