[root@localhost ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x0005bb6c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 281 2048000 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 281 2611 18717696 83 Linux
Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x00077087
Device Boot Start End Blocks Id System
yum install scsi-target-utils -y
vim /etc/tgt/targets.conf
<target iqn.2008-09.com.example:server.target1>
backing-store /dev/sdb
</target>
service tgtd restart
yum install iscsi-initiator-utils -y
iscsiadm --mode discoverydb --type sendtargets --portal 10.1.1.222 --discover
出现以下则表示有共享磁盘 10.1.1.222:3260,1 iqn.2008-09.com.example:server.target1
iscsiadm --mode node --targetname iqn.2008-09.com.example:server.target1 --portal 10.1.1.222:3260 --login
[root@localhost ~]# iscsiadm --mode node --targetname iqn.2008-09.com.example:server.target1 --portal 10.1.1.222:3260 --login
Logging in to [iface: default, target: iqn.2008-09.com.example:server.target1, portal: 10.1.1.222,3260] (multiple)
Login to [iface: default, target: iqn.2008-09.com.example:server.target1, portal: 10.1.1.222,3260] successful.
[root@localhost ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00036380
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 281 2048000 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 281 2611 18717696 83 Linux
Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x00077087
Device Boot Start End Blocks Id System