- 什么是ISCSI
ISCSI主要是透过TCP/IP技术,将存储设备端透过iscsi target(iscsi 目标端)功能,做成可以提供磁盘的服务器端,再透过iscsi initiator(iscsi初始化用户)功能,做成能够挂载使用使用iscsi设置来进行磁盘的应用了。也就是说,iscsi这个架构主要将存储装置与使用的主机分为两部分,分别是:
(1)iscsi target:就是存储设备端,存放磁盘或RAID的设备。
(2)iscsi initiator:就是能够使用target的用户端,通常是服务器。也就是说,想要连接到iscsi target 的服务器,也必须要安装iscsi initistor 的相关功能后才能使用iscsi target 提供的磁盘。
一.iscsi网络磁盘的共享
服务端
fdisk -l 查看有几块磁盘,若只有一块磁盘,可以自行添加一块磁盘
创建新的磁盘
[root@localhost ~]# fdisk /dev/sdb
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +1000M 建立一个1G的磁盘
Partition 1 of type Linux and of size 1000 MiB is set
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM' 改名为lvm格式的
同步并且创建新的磁盘
[root@localhost ~]# partprobe /dev/sdb1 同步更新
[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[root@localhost ~]# vgcreate vg0 /dev/sdb1
Volume group "vg0" successfully created
[root@localhost ~]# lvcreate -L 500M -n lv0 vg0
Logical volume "lv0" created.
监视磁盘
[root@localhost ~]# watch -n 1 ‘pvs;echo==== ;vgs;echo====;lvs;’