Chinaunix首页 | 论坛 | 博客
  • 博客访问: 337954
  • 博文数量: 62
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-14 14:12
个人简介

太懒

文章分类

全部博文(62)

文章存档

2015年(8)

2014年(20)

2013年(34)

我的朋友

分类: LINUX

2013-05-21 14:19:44

ISCSI VOLUME 扩容

10.1010.17作为iscsi target为oracle rac提供共享存储



[root@my2950 ~]# lvdisplay  /dev/datavg/ocr*
  --- Logical volume ---
  LV Path                /dev/datavg/ocr1
  LV Name                ocr1
  VG Name                datavg
  LV UUID                1tbPH2-QC33-25mY-tPG9-BU2p-jjRp-BRKi7p
  LV Write Access        read/write
  LV Creation host, time my2950, 2013-05-17 16:53:37 +0800
  LV Status              available
  # open                 1
  LV Size                512.00 MiB
  Current LE             8
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:7
  
  --- Logical volume ---
  LV Path                /dev/datavg/ocr2
  LV Name                ocr2
  VG Name                datavg
  LV UUID                MWGAet-Nz1W-wh44-LELL-wVEd-7LGu-Z0ZEnL
  LV Write Access        read/write
  LV Creation host, time my2950, 2013-05-17 16:53:42 +0800
  LV Status              available
  # open                 1
  LV Size                512.00 MiB
  Current LE             8
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:8
  
  --- Logical volume ---
  LV Path                /dev/datavg/ocr3
  LV Name                ocr3
  VG Name                datavg
  LV UUID                sh5Y0g-7o5c-fQdq-tVWq-wN1X-kQW2-lMzp7C
  LV Write Access        read/write
  LV Creation host, time my2950, 2013-05-17 16:53:46 +0800
  LV Status              available
  # open                 1
  LV Size                512.00 MiB
  Current LE             8
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:9
  
[root@my2950 ~]# 

需要把这三个逻辑卷扩到2G



Target 1: iqn.2013-05.01.org.momo:ocr1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 15
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: 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: 537 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr1
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 2: iqn.2013-05.02.org.momo:ocr2
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 2
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 16
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00020000
            SCSI SN: beaf20
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 2
            Type: disk
            SCSI ID: IET     00020002
            SCSI SN: beaf22
            Size: 537 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr2
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 3: iqn.2013-05.03.org.momo:ocr3
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 3
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 17
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00030000
            SCSI SN: beaf30
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 2
            Type: disk
            SCSI ID: IET     00030002
            SCSI SN: beaf32
            Size: 537 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr3
            Backing store flags:
    Account information:
    ACL information:
        ALL



先扩OCR1


  backing-store /dev/datavg/ocr1
  write-cache off 
  lun 1
        HeaderDigest None
        DataDigest None
        InitialR2T Yes
        ImmediateData No
        MaxRecvDataSegmentLength 8192
        MaxXmitDataSegmentLength 8192
        MaxBurstLength 262144
        FirstBurstLength 65536
        DefaultTime2Wait 2
        DefaultTime2Retain 20
        MaxOutstandingR2T 8
        DataPDUInOrder Yes
        DataSequenceInOrder Yes
        ErrorRecoveryLevel 0
  #MaxConnections 1
  #initiator-address 10.101.7.123


[root@my2950 ~]# lvdisplay /dev/datavg/ocr1
  --- Logical volume ---
  LV Path                /dev/datavg/ocr1
  LV Name                ocr1
  VG Name                datavg
  LV UUID                1tbPH2-QC33-25mY-tPG9-BU2p-jjRp-BRKi7p
  LV Write Access        read/write
  LV Creation host, time my2950, 2013-05-17 16:53:37 +0800
  LV Status              available
  # open                 1
  LV Size                512.00 MiB
  Current LE             8
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:7
  
[root@my2950 ~]#
[root@my2950 ~]# lvextend -L 2G /dev/datavg/ocr1
  Extending logical volume ocr1 to 2.00 GiB
  Logical volume ocr1 successfully resized
[root@my2950 ~]#
[root@my2950 ~]# lvdisplay /dev/datavg/ocr1    
  --- Logical volume ---
  LV Path                /dev/datavg/ocr1
  LV Name                ocr1
  VG Name                datavg
  LV UUID                1tbPH2-QC33-25mY-tPG9-BU2p-jjRp-BRKi7p
  LV Write Access        read/write
  LV Creation host, time my2950, 2013-05-17 16:53:37 +0800
  LV Status              available
  # open                 1
  LV Size                2.00 GiB
  Current LE             32
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:7
  
[root@my2950 ~]# 

[root@my2950 ~]# lvextend -L 2G /dev/datavg/ocr2
  Extending logical volume ocr2 to 2.00 GiB
  Logical volume ocr2 successfully resized
[root@my2950 ~]# lvextend -L 2G /dev/datavg/ocr3
  Extending logical volume ocr3 to 2.00 GiB
  Logical volume ocr3 successfully resized


 tgt-admin --show 查看一下

Target 1: iqn.2013-05.01.org.momo:ocr1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 15
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: 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: 537 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr1
            Backing store flags:
    Account information:
    ACL information:
        ALL

可以看到并没有随着lv的扩展自动扩展


先删除LUN映射

tgtadm --op delete --mode logicalunit --tid=1 --lun=1
tgtadm --op new --mode logicalunit --tid=1 --lun=1 --backing-store=/dev/datavg/ocr1

然后重新查看

Target 1: iqn.2013-05.01.org.momo:ocr1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 15
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: 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: 2147 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr1
            Backing store flags:
    Account information:
    ACL information:
        ALL

orc2 3依次执行


tgtadm --op delete --mode logicalunit --tid=2 --lun=2
tgtadm --op new --mode logicalunit --tid=2 --lun=2 --backing-store=/dev/datavg/ocr2


tgtadm --op delete --mode logicalunit --tid=3 --lun=3
tgtadm --op new --mode logicalunit --tid=3 --lun=3 --backing-store=/dev/datavg/ocr3


依次检查一下

Target 1: iqn.2013-05.01.org.momo:ocr1
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 15
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: 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: 2147 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr1
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 2: iqn.2013-05.02.org.momo:ocr2
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 2
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 16
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00020000
            SCSI SN: beaf20
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 2
            Type: disk
            SCSI ID: IET     00020002
            SCSI SN: beaf22
            Size: 2147 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr2
            Backing store flags:
    Account information:
    ACL information:
        ALL
Target 3: iqn.2013-05.03.org.momo:ocr3
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 3
            Initiator: iqn.1988-12.com.oracle:56d58188b650
            Connection: 0
                IP Address: 10.101.5.70
        I_T nexus: 17
            Initiator: iqn.1988-12.com.oracle:a5636a6279f2
            Connection: 0
                IP Address: 10.101.5.71
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00030000
            SCSI SN: beaf30
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 3
            Type: disk
            SCSI ID: IET     00030003
            SCSI SN: beaf33
            Size: 2147 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/datavg/ocr3
            Backing store flags:
    Account information:
    ACL information:
        ALL


登陆到客户端查看

[root@node1 ~]# fdisk -l /dev/asm-diskf

Disk /dev/asm-diskf: 536 MB, 536870912 bytes
17 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1037 * 512 = 530944 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

You have new mail in /var/spool/mail/root
[root@node1 ~]#

[root@node1 ~]# iscsiadm --mode node --targetname iqn.2013-05.01.org.momo:ocr1 -                    R
Rescanning session [sid: 1, target: iqn.2013-05.01.org.momo:ocr1, portal: 10.101                    .0.17,3260]
[root@node1 ~]#

[root@node1 ~]# fdisk -l /dev/asm-diskf

Disk /dev/asm-diskf: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@node1 ~]#

依次处理 ocr2 ocr3

[root@node1 ~]# iscsiadm --mode node --targetname iqn.2013-05.02.org.momo:ocr2 -R
Rescanning session [sid: 2, target: iqn.2013-05.02.org.momo:ocr2, portal: 10.101.0.17,3260]
[root@node1 ~]# iscsiadm --mode node --targetname iqn.2013-05.03.org.momo:ocr3 -R
Rescanning session [sid: 3, target: iqn.2013-05.03.org.momo:ocr3, portal: 10.101.0.17,3260]
[root@node1 ~]#

[root@node1 ~]# fdisk -l /dev/asm-diskg

Disk /dev/asm-diskg: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@node1 ~]# 







阅读(2010) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~