Disk /dev/sda: 32.2 GB, 32212254720 bytes64 heads, 32 sectors/track, 30720 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000da3dc
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 30720 30944256 8e Linux LVM
Partition 2 does not end on cylinder boundary.
Disk /dev/mapper/VolGroup-lv_root: 28.5 GB, 28462546944 bytes
255 heads, 63 sectors/track, 3460 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
# 可以看出只有一块磁盘
2、安装Client软件
[root@iSCSI_Client_1 ~]# yum -y install epel-release
[root@iSCSI_Client_1 ~]# yum -y install iscsi-initiator-utils.x86_64
3、启动服务
[root@iSCSI_Client_1 ~]# service iscsid start
[root@iSCSI_Client_1 ~]# chkconfig iscsid on
4、发现下iSCSI服务端
[root@iSCSI_Client_1 ~]# iscsiadm -m discovery -t st -p 192.168.30.133
192.168.30.133:3260,1 iqn.2017-03.com.zlyang:kvm.iscsi
5、挂载该磁盘
a、加载磁盘
# iscsiadm -m node -T iqn.2017-03.com.zlyang:kvm.iscsi -p 192.168.30.133 -l
Logging in to [iface: default, target: iqn.2017-03.com.zlyang:kvm.iscsi, portal: 192.168.30.133,3260] (multiple)
Login to [iface: default, target: iqn.2017-03.com.zlyang:kvm.iscsi, portal: 192.168.30.133,3260] successful.
# echo "iscsiadm -m node -T iqn.2017-03.com.zlyang:kvm.iscsi -p 192.168.30.133 -l" >> /etc/rc.d/rc.local"
[root@iSCSI_Client_1 ~]# fdisk -l
Disk /dev/sdc: 20.4 GB, 20401094656 bytes
64 heads, 32 sectors/track, 19456 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
注:看到此信息表示已经加载成功
b、分区格式化
[root@iSCSI_Client_1 ~]# mkfs.ext4 /dev/sdc
mke2fs 1.41.12 (17-May-2010)/dev/sdc is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1245184 inodes, 4980736 blocks
249036 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
152 block groups3
2768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@iSCSI_Client_1 ~]#
c、挂载到本地
[root@iSCSI_Client_1 ~]# mount /dev/sdc /mnt
[root@iSCSI_Client_1 ~]# echo "mount /dev/sdc /mnt" >> /etc/rc.d/rc.local
[root@iSCSI_Client_1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
26G 2.6G 23G 11% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 477M 52M 400M 12% /boot
/dev/sdc 19G 44M 18G 1% /mnt
[root@iSCSI_Client_1 ~]#
Client_1的所有配置已经配置完成,Client_2配置与Client_1基本相同,只是Client_2不需要再分区格式化了,直接加载及挂载就可以!
好了,部署已经全部完成,如果什么问题可以回复或发邮件到:DBA_Master@163.com