ISCSI技术实现了物理硬盘设备与TCP/TP网络传输的相互结合,使得客户可以通过互联网方便的获得到远程机房提供的共享存储资源
使用硬盘共享设备
1、服务端设定
(1)下载服务(yum源版本需和下载版本一至,否则服务不可用)
(2)新建一个逻辑卷用于共享
[root@shareserver ~]# fdisk -l ##查看现有分区
Disk /dev/sda: 9663 MB, 9663676416 bytes, 18874368 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00094fb4
Device Boot Start End Blocks Id System
/dev/sda1 2048 411647 204800 83 Linux
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x79ecac8f
Device Boot Start End Blocks Id System
(3)新建一个逻辑卷
[root@shareserver ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +1G
Partition 1 of type Linux and of size 1 GiB 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’
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x79ecac8f
Device Boot Start End Blocks Id System
/dev/sdb1 2048 2099199 1048576 8e Linux LVM
Command (m for help): wq
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@shareserver ~]#
(4)新建物理卷/逻辑卷组以及逻辑卷
[root@shareserver ~]# pvcreate /dev/sdb1
Physical volume “/dev/sdb1” successfully created
[root@shareserver ~]# vgcreate vg0 /dev/sdb1
Volume group “vg0” successfully created
[root@shareserver ~]# vgdisplay
— Volume group —
VG Name vg0
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 496.00 MiB
PE Size 4.00 MiB
Total PE 124
Alloc PE / Size 0 / 0
Free PE / Size 124 / 496.00 MiB
VG UUID qE6TbE-7irb-Cedc-FMg4-u1ui-s9EN-RfXo1I
[root@shareserver ~]# lvcreate -l 124 -n lv0 vg0
WARNING: ext4 signature detected on /dev/vg0/lv0 at offset 1080. Wipe it? [y/n]: y
Wiping ext