2/5/09

5 Steps To Increase Storage for Your Existing Logical Volume (AIX)

Steps taken to to increase the storage for an existing logical volume. The following commands
are for AIX. The steps, however, are universal. You only need to substitute the commands for other platforms.

1) How big is the vg?

/home/oracle $ lsvg oradata_vg
VOLUME GROUP: oradata_vg VG IDENTIFIER: 00224ada00004c000000010f64352701
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL
PPs: 1086 (139008 megabytes)
MAX LVs: 256 FREE PPs: 685 (87680 megabytes)
LVs: 2 USED PPs: 401 (51328 megabytes)
OPEN LVs: 2 QUORUM: 2
TOTAL PVs:
2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 128
kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

2) Use lspv to find out which hdisk belong to which vg:

/home/oracle $ lspv
hdisk2 00224ada0abc41b2 rootvg active
hdisk0 00224adaee4d5b0e None
hdisk1 00224adaa0d19b45 None
hdisk3 00224ada432ae745 oradata_vg active
hdisk4 00224adaf645417c oradata_vg active
hdisk5 00224adafc227f17 udbdata_vg active
hdisk6 00224adafc22d1ed udbdata_vg active
hdisk7 00224adafc3ab232 udbdata_vg active
hdisk8 00224adafc3ab64b udbdata_vg active
hdisk9 0003321524243690 udbdata_vg active
hdisk10 00033215242458d4 udbdata_vg active
hdisk11 00224adab4c1999c pagevg active
hdisk12 00224adab4c199c9 oracle_vg active
hdisk13 00224adafc20bbc5 oracle_vg active
hdisk14 00224adafc20bed6 oracle_vg active

hdisk3 and hdisk4 belong to oradata_vg.

3) how large is each hdisk?

/home/oracle $ lspv hdisk3
PHYSICAL VOLUME: hdisk3 VOLUME GROUP: oradata_vg
PV IDENTIFIER: 00224ada432ae745 VG IDENTIFIER 00224ada00004c000000010f64352701
PV STATE: active
STALE PARTITIONS:
0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 2
TOTAL PPs: 543 (69504 megabytes) VG DESCRIPTORS: 2
FREE PPs: 342 (43776 megabytes) HOT SPARE: no
USED PPs: 201 (25728 megabytes) MAX REQUEST: 128 kilobytes
FREE DISTRIBUTION: 108..00..17..108..109
USED DISTRIBUTION: 01..109..91..00..00
/home/oracle $
lspv hdisk4
PHYSICAL VOLUME: hdisk4 VOLUME GROUP: oradata_vg
PV IDENTIFIER: 00224adaf645417c VG IDENTIFIER 00224ada00004c000000010f64352701
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 1
TOTAL PPs: 543 (69504 megabytes) VG DESCRIPTORS: 1
FREE
PPs: 343 (43904 megabytes) HOT SPARE: no
USED PPs: 200 (25600 megabytes) MAX REQUEST: 128 kilobytes
FREE DISTRIBUTION: 109..00..17..108..109
USED DISTRIBUTION: 00..109..91..00..00

so total about 69G _ 69G = 140G.

4) now, how large is the oradata_lv currently?

/home/oracle $ lslv oradata_lv
LOGICAL VOLUME: oradata_lv VOLUME GROUP: oradata_vg
LV IDENTIFIER: 00224ada00004c000000010f64352701.1 PERMISSION: read/write
VG
STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY:
striped
LPs: 400 PPs: 400
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 2
MOUNT POINT:
/oradata LABEL: /oradata
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes (superstrict)
Serialize IO ?: NO
STRIPE WIDTH: 2
STRIPE SIZE: 128K

looks like LPs=400 each is 128M = 51GB.
Still available 140G - 51GB = 90GB.

and from the lsvg, we know that:

VG PERMISSION: read/write TOTAL PPs: 1086 (139008 megabytes)
MAX LVs: 256 FREE
PPs: 685 (87680 megabytes)
LVs: 2 USED PPs: 401 (51328 megabytes)

5a) unmount the fs first
5b) change the logical volume in smitty - increase MAXIMUM NUMBER OF LOGICAL PARTITIONS to 1086 - ran OK
5c) increase size of lv, enter number of ADDITIONAL LPs: to 684 (not 685 because stripped volumes require even numbers; also don’t choose PVs) - ran OK
5d) change file system, Change/Show characteristics of an Enhanced JFS; set the new
“number of units (of 512)” to 283978437 - ran OK

5e) check the new fs:

6) Validate everything:

bash-2.05b# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/oradata_lv 142082048 106387720 26% 22 1% /oradata

the logical volume is now 142GB! It worked.


No comments:

Post a Comment