Вы находитесь на странице: 1из 5

iscsi server side configuration in rhel6

[root@station1 Desktop]# yum install -y [root@station1 Desktop]# yum install -y [root@station1 Desktop]# yum install -y [root@station1 Desktop]# yum install -y [root@station1 Desktop]# yum install -y scsi* libibver* libml* librdmacm* perl-Config-General

create an empty partition (in my practise its sda4). dont convert it to linuxlvm system. just create a partition write and save it and follow the steps [root@station1 Desktop]# pvcreate /dev/sda4 Writing physical volume data to disk "/dev/sda4" Physical volume "/dev/sda4" successfully created [root@station1 Desktop]# vgcreate vg_ranji /dev/sda4 Volume group "vg_ranji" successfully created [root@station1 Desktop]# vgdisplay --- Volume group --VG Name vg_ranji System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access VG Status MAX LV Cur LV Open LV Max PV Cur PV Act PV VG Size PE Size Total PE Alloc PE / Size Free PE / Size VG UUID read/write resizable 0 0 0 0 1 1 40.50 GiB 4.00 MiB 10369 0/0 10369 / 40.50 GiB D8N5om-uk36-XPRR-elwS-PVNk-VmcM-IrGPYH

[root@station1 Desktop]# lvcreate -n lv_lun0 -L 40G vg_ranji Logical volume "lv_lun0" created [root@station1 Desktop]# lvdisplay --- Logical volume --LV Name /dev/vg_ranji/lv_lun0 VG Name vg_ranji LV UUID JuJdn2-pRTl-FURv-HlBD-n3KA-wUQZ-KcHCWD LV Write Access read/write LV Status available # open 0 LV Size 40.00 GiB Current LE 10240 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 [root@station1 Desktop]# vim /etc/tgt/targets.conf 37 38 <target iqn.2012-26.com.example:ranji.lun0> 39 backing-store /dev/vg_ranji/lv_lun0 40 initiator-address 10.65.62.30 41 </target> 42 [root@station1 Desktop]# chkconfig tgtd on [root@station1 Desktop]# service tgtd restart Stopping SCSI target daemon: not running Starting SCSI target daemon:

----------> remove # add edit these lines

[FAILED] [ OK ]

[root@station1 Desktop]# tgtadm --lld iscsi --mode target --op show Target 1: iqn.2012-26.com.example:ranji.lun0 System information: Driver: iscsi State: ready I_T nexus information: LUN information: LUN: 0 Type: controller SCSI ID: IET 00010000 SCSI SN: beaf10

Size: 0 MB, Block size: 1 Online: Yes Removable media: No Readonly: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 42950 MB, Block size: 512 Online: Yes Removable media: No Readonly: No Backing store type: rdwr Backing store path: /dev/vg_ranji/lv_lun0 Backing store flags: Account information: ACL information: 10.65.62.30 [root@station1 Desktop]# yum install -y iscsi* [root@station1 Desktop]# chkconfig iscsid on dont chkconfig iscsi on because it wont start up when system boots we have to start it manually after system boots [root@station1 Desktop]# service iscsid start [root@station1 Desktop]# service iscsi start first test in server itself with the following steps [root@station1 Desktop]# iscsiadm --mode discovery --type sendtargets --portal 10.65.62.30 10.65.62.30:3260,1 iqn.2012-26.com.example:ranji.lun0 [root@station1 Desktop]# cat /proc/partitions major minor #blocks name 8 8 8 8 8 8 8 0 156290904 sda 1 512000 sda1 2 30720000 sda2 3 1 sda3 4 42475860 sda4 5 1951866 sda5 6 48829536 sda6

8 8 8 253

7 29296640 sda7 8 487424 sda8 9 1998848 sda9 0 41943040 dm-0

[root@station1 Desktop]# iscsiadm --mode node --targetname iqn.201226.com.example:ranji.lun0 --portal 10.65.62.30 --login Logging in to [iface: default, target: iqn.2012-26.com.example:ranji.lun0, portal: 10.65.62.30,3260] (multiple) Login to [iface: default, target: iqn.2012-26.com.example:ranji.lun0, portal: 10.65.62.30,3260] successful. [root@station1 Desktop]# cat /proc/partitions major minor #blocks name 8 8 8 8 8 8 8 8 8 8 253 0 156290904 sda 1 512000 sda1 2 30720000 sda2 3 1 sda3 4 42475860 sda4 5 1951866 sda5 6 48829536 sda6 7 29296640 sda7 8 487424 sda8 9 1998848 sda9 0 41943040 dm-0

8 32 41943040 sdc -----------> after login u could see a new partition sdc [root@station1 Desktop]# iscsiadm --mode node --targetname iqn.201226.com.example:ranji.lun0 --portal 10.65.62.30 --logout Logging out of session [sid: 6, target: iqn.2012-26.com.example:ranji.lun0, portal: 10.65.62.30,3260] Logout of [sid: 6, target: iqn.2012-26.com.example:ranji.lun0, portal: 10.65.62.30,3260] successful. [root@station1 Desktop]# cat /proc/partitions major minor #blocks name 8 8 8 8 8 8 8 8 8 8 0 156290904 sda 1 512000 sda1 2 30720000 sda2 3 1 sda3 4 42475860 sda4 5 1951866 sda5 6 48829536 sda6 7 29296640 sda7 8 487424 sda8 9 1998848 sda9

253

0 41943040 dm-0

No comments : Post a Comment

Вам также может понравиться