二、 客户端(Linux)配置
安装客户端软件包:
#yum -y install iscsi-initiator-utils.x86_64
启动服务:系统重启后会进行登录目标
#/etc/init.d/iscsid start
发现目标:192.168.100.174为存储服务器端IP地址
#iscsiadm -m discovery -t st -p 192.168.100.174
192.168.100.174:3260,1 iqn.1991-05.com.microsoft:d5z37c3x-test-target
登录目标:
# iscsiadm -m node –T iqn.1991-05.com.microsoft:d5z37c3x-test-target -l
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:d5z37c3x-test-target, portal: 125.39.195.174,3260] (multiple)
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:d5z37c3x-test-target, portal: 192.168.100.174,3260] (multiple)
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:d5z37c3x-test-target, portal: 2002:7d27:c3ae::7d27:c3ae,3260] (multiple)
iscsiadm: Could not login to [iface: default, target: iqn.1991-05.com.microsoft:d5z37c3x-test-target, portal: 125.39.195.174,3260].
iscsiadm: initiator reported error (19 - encountered non-retryable iSCSI login failure)
Login to [iface: default, target: iqn.1991-05.com.microsoft:d5z37c3x-test-target, portal: 192.168.100.174,3260] successful.
分区:超过2TB,使用GPT,不能使用MBR
# parted /dev/sda
GNU Parted 1.8.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: Unable to open /dev/sda - unrecognised disk label.
(parted) mklabel gpt
(parted) p
Model: MSFT Virtual HD (scsi)
Disk /dev/sda: 16.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) mkpart primary 0 50%
(parted) p
Model: MSFT Virtual HD (scsi)
Disk /dev/sda: 16.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 8246GB 8246GB primary
(parted) mkpart primary 50% 100%
(parted) p
Model: MSFT Virtual HD (scsi)
Disk /dev/sda: 16.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 8246GB 8246GB primary
2 8246GB 16.5TB 8246GB primary
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.
格式化:
# mkfs.ext3 /dev/sda1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1006632960 inodes, 2013265915 blocks
100663295 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
61440 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544, 1934917632
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
挂载:
#mount /dev/sda1 /media
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p3 3.9G 319M 3.4G 9% /
/dev/cciss/c0d0p8 483G 198M 458G 1% /data
/dev/cciss/c0d0p7 7.8G 226M 7.2G 3% /var
/dev/cciss/c0d0p6 20G 173M 19G 1% /home
/dev/cciss/c0d0p5 20G 1.8G 17G 10% /usr
/dev/cciss/c0d0p1 996M 40M 905M 5% /boot
tmpfs 5.9G 0 5.9G 0% /dev/shm
/dev/sda1 7.4T 184M 7.1T 1% /media
/dev/sda2 7.4T 178M 7.1T 1% /mnt
测试:
# dd if=/dev/zero of=/mnt/test bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes (10 GB) copied, 466.882 seconds, 22.5 MB/s
来自为知笔记(Wiz)