Wednesday, 16 October 2013

Expanding LUN size in SunCluster Environment

We have Oracle database in Sun Cluster HA configuration with two mount point /u01,/u02. Our task is to expand LUN in /u02 mountpoint.

Current configuration 

metaset configuration
root@sc01-n1:~ # metaset 

Set name = testdb-disk, Set number = 1

Host                Owner
  sc01-n1            Yes
  sc01-n2            

Drive Dbase

d12   Yes  

d13   Yes  

d16   Yes  

d17   Yes  

meta device configuration
root@sc01-n1:~ # metastat -s testdb-disk -p
testdb-disk/d20 -m testdb-disk/d21 testdb-disk/d22 1
testdb-disk/d21 1 1 /dev/did/rdsk/d16s0
testdb-disk/d22 1 1 /dev/did/rdsk/d17s0
testdb-disk/d10 -m testdb-disk/d11 1
testdb-disk/d11 2 1 /dev/did/rdsk/d12s0 \
         1 /dev/did/rdsk/d13s0

did device configuration
root@sc01-n2:~ # scdidadm -L
1        sc01-n1:/dev/rdsk/c2t1d0       /dev/did/rdsk/d1     
2        sc01-n1:/dev/rdsk/c2t0d0       /dev/did/rdsk/d2     
3        sc01-n1:/dev/rdsk/c8t60060E80056213000000621300000047d0 /dev/did/rdsk/d3     
3        sc01-n2:/dev/rdsk/c8t60060E80056213000000621300000047d0 /dev/did/rdsk/d3     
4        sc01-n1:/dev/rdsk/c8t60060E80056213000000621300000046d0 /dev/did/rdsk/d4     
4        sc01-n2:/dev/rdsk/c8t60060E80056213000000621300000046d0 /dev/did/rdsk/d4     
5        sc01-n1:/dev/rdsk/c8t60060E80056213000000621300000045d0 /dev/did/rdsk/d5     
5        sc01-n2:/dev/rdsk/c8t60060E80056213000000621300000045d0 /dev/did/rdsk/d5     
6        sc01-n1:/dev/rdsk/c0t1d0       /dev/did/rdsk/d6     
7        sc01-n1:/dev/rdsk/c0t0d0       /dev/did/rdsk/d7     
8        sc01-n2:/dev/rdsk/c1t1d0       /dev/did/rdsk/d8     
9        sc01-n2:/dev/rdsk/c1t0d0       /dev/did/rdsk/d9     
10       sc01-n2:/dev/rdsk/c0t1d0       /dev/did/rdsk/d10    
11       sc01-n2:/dev/rdsk/c0t0d0       /dev/did/rdsk/d11    
12       sc01-n1:/dev/rdsk/c8t600A0B80004781F20000A9F15212A47Cd0 /dev/did/rdsk/d12    
12       sc01-n2:/dev/rdsk/c8t600A0B80004781F20000A9F15212A47Cd0 /dev/did/rdsk/d12    
13       sc01-n1:/dev/rdsk/c8t600A0B800047A2C00000B4E85249313Cd0 /dev/did/rdsk/d13    
13       sc01-n2:/dev/rdsk/c8t600A0B800047A2C00000B4E85249313Cd0 /dev/did/rdsk/d13    
16       sc01-n1:/dev/rdsk/c8t600A0B80004781F20000ABCE525E4ACEd0 /dev/did/rdsk/d16    
16       sc01-n2:/dev/rdsk/c8t600A0B80004781F20000ABCE525E4ACEd0 /dev/did/rdsk/d16    
17       sc01-n1:/dev/rdsk/c8t600A0B800047A2C00000B508525E5523d0 /dev/did/rdsk/d17    
17       sc01-n2:/dev/rdsk/c8t600A0B800047A2C00000B508525E5523d0 /dev/did/rdsk/d17    

mount points
root@sc01-n1:~ # df -h|grep testdb
/dev/md/testdb-disk/dsk/d20    20G   1.0G    18G     6%    /u02
/dev/md/testdb-disk/dsk/d10   143G   1.3G   140G     1%    /u01
root@sc01-n1:~ # scha_resource_get -O extension -R testdb-disk -G testdb-rg FileSystemMountPoints
STRINGARRAY
/u01
/u02

-------------------------------
Attension!!! Make shure that your DataStorage do not modify disk geometry while expanding your LUN, e. g. if it's change number of cylinder and sector per cylinder your data will be lost.
If it's change only number of cylinder, it's all right.

Expanding /u02 mountpoint

1) Take offline our cluster group, you need to do it because when you expand your lun, cluster will determine I/O failure and try to reallocate resource group.
root@sc01-n1:~ # clrg offline testdb
root@sc01-n1:~ # clrg status

=== Cluster Resource Groups ===

Group Name       Node Name       Suspended      Status
----------       ---------       ---------      ------
testdb           sc01-n1         No             Offline
                 sc01-n2         No             Offline

2) As you can see /dev/md/testdb-disk/dsk/d20 is a raid1 metadevice, there for we detach it's sub-mirror first:
root@sc01-n1:~ # metadetach -s testdb-disk d20 d22
testdb-disk/d20: submirror testdb-disk/d22 is detached

if something goes wrong we'll have sub-mirror with consistent filesystem.

3) Save vtoc from expanding devices
root@sc01-n1:~ # prtvtoc /dev/did/rdsk/d17s2 > d17s2.vtoc
root@sc01-n1:~ # prtvtoc /dev/did/rdsk/d16s2 > d16s2.vtoc

4) Expand our lun - testdb-disk/d21 (/dev/did/rdsk/d16)
  4.1) Expand lun in your DataStorage
  4.2) Enter format command, and choose expanded disk, in my case is a disk 7
root@sc01-n1:~ # format 
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       1. c0t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
       2. c2t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@10,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       3. c2t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@10,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
       4. c8t600A0B800047A2C00000B4E85249313Cd0 <SUN-STK6580_6780-0784 cyl 12798 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b800047a2c00000b4e85249313c
       5. c8t600A0B800047A2C00000B508525E5523d0 <SUN-STK6580_6780-0784 cyl 10238 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b800047a2c00000b508525e5523
       6. c8t600A0B80004781F20000A9F15212A47Cd0 <SUN-STK6580_6780-0784 cyl 63998 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b80004781f20000a9f15212a47c
       7. c8t600A0B80004781F20000ABCE525E4ACEd0 <SUN-STK6580_6780-0784 cyl 10238 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b80004781f20000abce525e4ace
       8. c8t60060E80056213000000621300000047d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000047
       9. c8t60060E80056213000000621300000046d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000046
      10. c8t60060E80056213000000621300000045d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000045
Specify disk (enter its number): 7
selecting c8t600A0B80004781F20000ABCE525E4ACEd0
[disk formatted]
/dev/did/dsk/d16s0 is part of SVM volume stripe:testdb-disk/d21. Please see metaclear(1M).
/dev/did/dsk/d16s7 contains an SVM mdb. Please see metadb(1M).


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 10238 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0        usr    wm       3 - 10237       19.99GB    (10235/0/0) 41922560
  1 unassigned    wm       0                0         (0/0/0)            0
  2 unassigned    wm       0                0         (0/0/0)            0
  3 unassigned    wm       0                0         (0/0/0)            0
  4 unassigned    wm       0                0         (0/0/0)            0
  5 unassigned    wm       0                0         (0/0/0)            0
  6 unassigned    wm       0                0         (0/0/0)            0
  7        usr    wu       0 -     2        6.00MB    (3/0/0)        12288

partition> q



FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit


  4.3) Now we need to tell Solaris to rescan disk geometry. In Format Menu press type, then choose auto:
format> type


AVAILABLE DRIVE TYPES:
        0. Auto configure
        1. Quantum ProDrive 80S
        2. Quantum ProDrive 105S
        3. CDC Wren IV 94171-344
        4. SUN0104
        5. SUN0207
        6. SUN0327
        7. SUN0340
        8. SUN0424
        9. SUN0535
        10. SUN0669
        11. SUN1.0G
        12. SUN1.05
        13. SUN1.3G
        14. SUN2.1G
        15. SUN2.9G
        16. Zip 100
        17. Zip 250
        18. Peerless 10GB
        19. SUN-STK6580_6780-0784
        20. HITACHI-OPEN-V-SUN-6004
        21. SUN146G
        22. SUN-STK6580_6780-0784
        23. SUN-STK6580_6780-0784
        24. other
Specify disk type (enter its number)[23]: 0
c8t600A0B80004781F20000ABCE525E4ACEd0: configured with capacity of 25.00GB
<SUN-STK6580_6780-0784 cyl 12798 alt 2 hd 64 sec 64>
selecting c8t600A0B80004781F20000ABCE525E4ACEd0
[disk formatted]
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 12798 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0        usr    wm       3 - 12797       24.99GB    (12795/0/0) 52408320
  1 unassigned    wu       0                0         (0/0/0)            0
  2     backup    wu       0 - 12797       25.00GB    (12798/0/0) 52420608
  3 unassigned    wu       0                0         (0/0/0)            0
  4 unassigned    wu       0                0         (0/0/0)            0
  5 unassigned    wu       0                0         (0/0/0)            0
  6 unassigned    wu       0                0         (0/0/0)            0
  7        usr    wu       0 -     2        6.00MB    (3/0/0)        12288



partition> label
Ready to label disk, continue? y

I don't know why sometimes need to place old vtoc to device and then resize slice 0 manually  but sometimes everything is done as i need.

  4.4) mount did device, and expand filesystem
root@sc01-n1:~ # mount /dev/did/dsk/d16s0 /mnt
root@sc01-n1:~ # growfs -M /mnt /dev/did/rdsk/d16s0 
/dev/did/rdsk/d16s0:    52408320 sectors in 8530 cylinders of 48 tracks, 128 sectors
        25590.0MB in 534 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
..........
super-block backups for last 10 cylinder groups at:
 51512864, 51611296, 51709728, 51808160, 51906592, 52005024, 52103456,
 52201888, 52300320, 52398752
root@sc01-n1:~ # umount /mnt/
  4.5) check filesystem on /dev/did/rdsk/d16s0, and recreate metadevice
root@sc01-n1:~ # fsck /dev/did/rdsk/d16s0 
** /dev/did/rdsk/d16s0
** Last Mounted on /u02
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
4 files, 1049114 used, 24732125 free (13 frags, 3091514 blocks, 0.0% fragmentation)
root@sc01-n1:~ # metaclear -s testdb-disk d20
testdb-disk/d20: Mirror is cleared
root@sc01-n1:~ # metaclear -s testdb-disk d21
testdb-disk/d21: Concat/Stripe is cleared
root@sc01-n1:~ # metainit -s testdb-disk d21 1 1 /dev/did/rdsk/d16s0
testdb-disk/d21: Concat/Stripe is setup

root@sc01-n1:~ # fsck /dev/md/testdb-disk/rdsk/d20

** /dev/md/testdb-disk/rdsk/d20
** Last Mounted on /u02
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
4 files, 1049114 used, 24732125 free (13 frags, 3091514 blocks, 0.0% fragmentation)

-------------------------------
If you don't recreate your metadevice following situation my occur:
root@sc01-n1:~ # fsck /dev/did/rdsk/d16s0 
** /dev/did/rdsk/d16s0
** Last Mounted on /u02
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
4 files, 1049114 used, 24732125 free (13 frags, 3091514 blocks, 0.0% fragmentation)
root@sc01-n1:~ # fsck /dev/md/testdb-disk/rdsk/d20
** /dev/md/testdb-disk/rdsk/d20

CANNOT READ: DISK BLOCK 52398752: Invalid argument

5) Try to online our resource group
root@sc01-n1:~ # clrg online testdb
root@sc01-n1:~ # clrg status

=== Cluster Resource Groups ===

Group Name       Node Name       Suspended      Status
----------       ---------       ---------      ------
testdb           sc01-n1         No             Online
                 sc01-n2         No             Offline

6) When we'll see that our database is online, expand sub-mirror - d22

root@sc01-n1:~ # format 
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       1. c0t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
       2. c2t0d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@10,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       3. c2t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@10,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0
       4. c8t600A0B800047A2C00000B4E85249313Cd0 <SUN-STK6580_6780-0784 cyl 12798 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b800047a2c00000b4e85249313c
       5. c8t600A0B800047A2C00000B508525E5523d0 <SUN-STK6580_6780-0784 cyl 10238 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b800047a2c00000b508525e5523
       6. c8t600A0B80004781F20000A9F15212A47Cd0 <SUN-STK6580_6780-0784 cyl 63998 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b80004781f20000a9f15212a47c
       7. c8t600A0B80004781F20000ABCE525E4ACEd0 <SUN-STK6580_6780-0784 cyl 12798 alt 2 hd 64 sec 64>
          /scsi_vhci/ssd@g600a0b80004781f20000abce525e4ace
       8. c8t60060E80056213000000621300000047d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000047
       9. c8t60060E80056213000000621300000046d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000046
      10. c8t60060E80056213000000621300000045d0 <HITACHI-OPEN-V-SUN-6004 cyl 134 alt 2 hd 15 sec 512>
          /scsi_vhci/ssd@g60060e80056213000000621300000045
Specify disk (enter its number): 5
selecting c8t600A0B800047A2C00000B508525E5523d0
[disk formatted]
/dev/did/dsk/d17s0 is part of SVM volume stripe:testdb-disk/d22. Please see metaclear(1M).
/dev/did/dsk/d17s7 contains an SVM mdb. Please see metadb(1M).


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 10238 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0        usr    wm       3 - 10237       19.99GB    (10235/0/0) 41922560
  1 unassigned    wm       0                0         (0/0/0)            0
  2 unassigned    wm       0                0         (0/0/0)            0
  3 unassigned    wm       0                0         (0/0/0)            0
  4 unassigned    wm       0                0         (0/0/0)            0
  5 unassigned    wm       0                0         (0/0/0)            0
  6 unassigned    wm       0                0         (0/0/0)            0
  7        usr    wu       0 -     2        6.00MB    (3/0/0)        12288

partition> q


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> t


AVAILABLE DRIVE TYPES:
        0. Auto configure
        1. Quantum ProDrive 80S
        2. Quantum ProDrive 105S
        3. CDC Wren IV 94171-344
        4. SUN0104
        5. SUN0207
        6. SUN0327
        7. SUN0340
        8. SUN0424
        9. SUN0535
        10. SUN0669
        11. SUN1.0G
        12. SUN1.05
        13. SUN1.3G
        14. SUN2.1G
        15. SUN2.9G
        16. Zip 100
        17. Zip 250
        18. Peerless 10GB
        19. SUN-STK6580_6780-0784
        20. HITACHI-OPEN-V-SUN-6004
        21. SUN146G
        22. SUN-STK6580_6780-0784
        23. SUN-STK6580_6780-0784
        24. other
Specify disk type (enter its number)[23]: 0
c8t600A0B800047A2C00000B508525E5523d0: configured with capacity of 25.00GB
<SUN-STK6580_6780-0784 cyl 12798 alt 2 hd 64 sec 64>
selecting c8t600A0B800047A2C00000B508525E5523d0
[disk formatted]
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 12798 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0        usr    wm       3 - 12797       24.99GB    (12795/0/0) 52408320
  1 unassigned    wu       0                0         (0/0/0)            0
  2     backup    wu       0 - 12797       25.00GB    (12798/0/0) 52420608
  3 unassigned    wu       0                0         (0/0/0)            0
  4 unassigned    wu       0                0         (0/0/0)            0
  5 unassigned    wu       0                0         (0/0/0)            0
  6 unassigned    wu       0                0         (0/0/0)            0
  7        usr    wu       0 -     2        6.00MB    (3/0/0)        12288

partition> label
Ready to label disk, continue? y

partition> ^D
root@sc01-n1:~ # metaclear -s testdb-disk d22
testdb-disk/d22: Concat/Stripe is cleared
root@sc01-n1:~ # metainit -s testdb-disk d22 1 1 /dev/did/rdsk/d17s0 
testdb-disk/d22: Concat/Stripe is setup
root@sc01-n1:~ # metattach -s testdb-disk d20 d22
testdb-disk/d20: submirror testdb-disk/d22 is attached
root@sc01-n1:~ # metastat -s testdb-disk |grep sync
      State: Resyncing    
    Resync in progress: 2 % done
    State: Resyncing    

        

No comments:

Post a Comment