# 先看需要扩空的分区(挂载点)属于哪个设备(LV)
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
...
/dev/serp01lv 60.00 2.37 97% 25 1% /testerp01
...
# 查看需要扩空的分区上的lv是否有充足的空间。
lslv -l "lv_name"
root@testerp:/>lslv -l serp01lv
serp01lv:/testerp01
PV COPIES IN BAND DISTRIBUTION
hdisk8 480:000:000 66% 022:320:080:058:000
root@testerp:/>lslv serp01lv
LOGICAL VOLUME: serp01lv VOLUME GROUP: testerp01vg
LV IDENTIFIER: 00c90e2200004c000000012543c9f12d.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: parallel
LPs: 480 PPs: 480
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /testerp01 LABEL: /testerp01
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
# 未使用空间= (MAX LVs - Lvs) X PP SIZE
# 如:(512-480)X128 = 4096 megabyte(s) = 4G ,当扩容大于4G时需要查看所在的VG是否有充足的空间。
# 假如要为分区增加6G空间,VG上的空间足够,LV需要增加2G,即16个LPs。chlv -x'528' serp01lv ,512+16=528,也可以比528大。
# chfs -a size=+6144M /testerp01
** 注意:jfs 分区的最大容量是64G,即512Lps, jfs2 分区最大容量是32TB。
# 检查vg上还有多少未使用的空间:
lsvg "vg_name"
root@testerp:/>lsvg testerp01vg
VOLUME GROUP: testerp01vg VG IDENTIFIER: 00c90e2200004c000000012543c9f12d
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1599 (204672 megabytes)
MAX LVs: 256 FREE PPs: 502 (64256 megabytes)
LVs: 4 USED PPs: 1097 (140416 megabytes)
OPEN LVs: 4 QUORUM: 1 (Disabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
# 其中 Free pps = 64256 megabytes , 即62G
# 空间充足可以进行扩容
## 扩容过程
AIX Version 5
Copyright IBM Corporation, 1982, 2011.
login: dchoper
dchoper's Password:
*******************************************************************************
* *
* *
* Welcome to AIX Version 5.3! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
*******************************************************************************
Last unsuccessful login: Mon Jan 17 15:01:33 HKG 2022 on /dev/pts/0 from 10.254.4.94
Last login: Thu Jun 8 16:42:33 HKG 2023 on ftp from ::ffff:10.3.96.7
$ vgdisplay
ksh: vgdisplay: not found.
$ vgs
ksh: vgs: not found.
$ lvs
ksh: lvs: not found.
$ su -
root's Password:
root@testerp:/>
root@testerp:/>vgdisplay
ksh: vgdisplay: not found.
root@testerp:/>vgs
ksh: vgs: not found.
root@testerp:/>history
1239 bk_testerp.sh
1240 bk_testerp.sh
1241 bk_testerp.sh
1242 bk_testerp.sh
1243 bk_testerp.sh
1244 ps -ef|grep smon
1245 bk_testerp.sh
1246 bk_testerp.sh
1247 ps -ef|grep smon
1248 clear_tlcq
1249 exit
1250 bk_testerp.sh
1251 ps -ef|grep smon
1252 vgdisplay
1253 vgs
1254 history
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.13 44% 6573 3% /
/dev/hd2 2.50 0.61 76% 45427 24% /usr
/dev/hd9var 1.00 0.42 58% 5637 5% /var
/dev/hd3 5.00 2.89 43% 100866 13% /tmp
/dev/fwdump 1.50 1.47 2% 12 1% /var/adm/ras/platform
/dev/hd1 0.50 0.30 41% 614 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.50 0.41 19% 2017 3% /opt
/dev/hytllv 30.00 7.72 75% 58031 4% /hytl
/dev/oraclelv 5.00 2.24 56% 7441 2% /oracle
/dev/ora10glv 20.00 7.83 61% 147055 8% /ora10g
/dev/arcbklv 30.00 8.78 71% 3902 1% /archback
/dev/serp01lv 60.00 2.37 97% 25 1% /testerp01
/dev/serp02lv 70.00 2.66 97% 23 1% /testerp02
/dev/serp03lv 60.00 7.97 87% 21 1% /testerp03
/dev/serp04lv 80.00 1.84 98% 16 1% /testerp04
/dev/serparlv 17.00 16.92 1% 10 1% /testerparch
/dev/serprylv 17.00 16.92 1% 11 1% /testerprcry
/dev/serpwklv 6.00 2.34 61% 771 1% /testerpwrk
/dev/serprolv 23.75 14.81 38% 36530 2% /testerppro
/dev/serpollv 10.00 4.14 59% 52792 6% /testerpoutlog
root@testerp:/>lsvg -l /dev/serp01lv
0516-306 : Unable to find volume group /dev/serp01lv in the Device
Configuration Database.
root@testerp:/>lsvg
rootvg
testerp00vg
testerp01vg
testerp02vg
testerp03vg
root@testerp:/>lsvg -l testerp00vg
testerp00vg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
testerp00vglog jfs2log 1 1 1 open/syncd N/A
oraclelv jfs2 40 40 1 open/syncd /oracle
ora10glv jfs2 160 160 1 open/syncd /ora10g
serprolv jfs2 190 190 1 open/syncd /testerppro
root@testerp:/>lsvg testerp00vg
VOLUME GROUP: testerp00vg VG IDENTIFIER: 00f7288500004c0000000134c056ddde
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1599 (204672 megabytes)
MAX LVs: 256 FREE PPs: 1208 (154624 megabytes)
LVs: 4 USED PPs: 391 (50048 megabytes)
OPEN LVs: 4 QUORUM: 1 (Disabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
root@testerp:/>lslv /dev/serp01lv
0516-306 lslv: Unable to find /dev/serp01lv in the Device
Configuration Database.
root@testerp:/>lslv
0516-602 lslv: Logical volume name not entered.
Usage: lslv [-L] [-l | -m] [-n DescriptorPV] LVname
lslv: [-L] [-n DescriptorPV] -p PVname [LVname]
Lists the characteristics of a logical volume.
root@testerp:/>lslv -l serp01lv
serp01lv:/testerp01
PV COPIES IN BAND DISTRIBUTION
hdisk8 480:000:000 66% 022:320:080:058:000
root@testerp:/>lslv serp01lv
LOGICAL VOLUME: serp01lv VOLUME GROUP: testerp01vg
LV IDENTIFIER: 00c90e2200004c000000012543c9f12d.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: parallel
LPs: 480 PPs: 480
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /testerp01 LABEL: /testerp01
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.13 44% 6573 3% /
/dev/hd2 2.50 0.61 76% 45427 24% /usr
/dev/hd9var 1.00 0.42 58% 5630 5% /var
/dev/hd3 5.00 2.89 43% 100872 13% /tmp
/dev/fwdump 1.50 1.47 2% 12 1% /var/adm/ras/platform
/dev/hd1 0.50 0.30 41% 614 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.50 0.41 19% 2017 3% /opt
/dev/hytllv 30.00 7.72 75% 58031 4% /hytl
/dev/oraclelv 5.00 2.24 56% 7441 2% /oracle
/dev/ora10glv 20.00 7.83 61% 147058 8% /ora10g
/dev/arcbklv 30.00 8.78 71% 3902 1% /archback
/dev/serp01lv 60.00 2.37 97% 25 1% /testerp01
/dev/serp02lv 70.00 2.66 97% 23 1% /testerp02
/dev/serp03lv 60.00 7.97 87% 21 1% /testerp03
/dev/serp04lv 80.00 1.84 98% 16 1% /testerp04
/dev/serparlv 17.00 16.92 1% 10 1% /testerparch
/dev/serprylv 17.00 16.92 1% 11 1% /testerprcry
/dev/serpwklv 6.00 2.34 61% 771 1% /testerpwrk
/dev/serprolv 23.75 14.81 38% 36530 2% /testerppro
/dev/serpollv 10.00 4.14 59% 52820 6% /testerpoutlog
root@testerp:/>lsvg testerp01vg
VOLUME GROUP: testerp01vg VG IDENTIFIER: 00c90e2200004c000000012543c9f12d
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1599 (204672 megabytes)
MAX LVs: 256 FREE PPs: 502 (64256 megabytes)
LVs: 4 USED PPs: 1097 (140416 megabytes)
OPEN LVs: 4 QUORUM: 1 (Disabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
root@testerp:/>chfs -a size=+3072M /testerp01
Filesystem size changed to 132120576
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.13 44% 6573 3% /
/dev/hd2 2.50 0.61 76% 45427 24% /usr
/dev/hd9var 1.00 0.42 58% 5630 5% /var
/dev/hd3 5.00 2.89 43% 100878 13% /tmp
/dev/fwdump 1.50 1.47 2% 12 1% /var/adm/ras/platform
/dev/hd1 0.50 0.30 41% 614 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.50 0.41 19% 2017 3% /opt
/dev/hytllv 30.00 7.72 75% 58031 4% /hytl
/dev/oraclelv 5.00 2.24 56% 7441 2% /oracle
/dev/ora10glv 20.00 7.83 61% 147063 8% /ora10g
/dev/arcbklv 30.00 8.78 71% 3902 1% /archback
/dev/serp01lv 63.00 5.37 92% 25 1% /testerp01
/dev/serp02lv 70.00 2.66 97% 23 1% /testerp02
/dev/serp03lv 60.00 7.97 87% 21 1% /testerp03
/dev/serp04lv 80.00 1.84 98% 16 1% /testerp04
/dev/serparlv 17.00 16.88 1% 11 1% /testerparch
/dev/serprylv 17.00 16.88 1% 12 1% /testerprcry
/dev/serpwklv 6.00 2.34 61% 771 1% /testerpwrk
/dev/serprolv 23.75 14.81 38% 36530 2% /testerppro
/dev/serpollv 10.00 4.14 59% 52831 6% /testerpoutlog
root@testerp:/>lsvg serp02lv
0516-306 : Unable to find volume group serp02lv in the Device
Configuration Database.
root@testerp:/>lslv serp02lv
LOGICAL VOLUME: serp02lv VOLUME GROUP: testerp02vg
LV IDENTIFIER: 00c90e2200004c00000001262b889de9.2 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 560 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 560 PPs: 560
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: yes
INTRA-POLICY: center UPPER BOUND: 32
MOUNT POINT: /testerp02 LABEL: /testerp02
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>lsvg testerp02vg
VOLUME GROUP: testerp02vg VG IDENTIFIER: 00c90e2200004c00000001262b889de9
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1599 (204672 megabytes)
MAX LVs: 256 FREE PPs: 854 (109312 megabytes)
LVs: 4 USED PPs: 745 (95360 megabytes)
OPEN LVs: 4 QUORUM: 1 (Disabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
root@testerp:/>
root@testerp:/>chlv -x'600' serp02lv
root@testerp:/>lslv serp02lv
LOGICAL VOLUME: serp02lv VOLUME GROUP: testerp02vg
LV IDENTIFIER: 00c90e2200004c00000001262b889de9.2 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 600 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 560 PPs: 560
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: yes
INTRA-POLICY: center UPPER BOUND: 32
MOUNT POINT: /testerp02 LABEL: /testerp02
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>chfs -a size=+3072M /testerp02
Filesystem size changed to 153092096
root@testerp:/>df -h
df: Not a recognized flag: h
Usage: df [-P] | [-IMitv] [-gkm] [-s] [filesystem ...] [file ...]
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.13 44% 6573 3% /
/dev/hd2 2.50 0.61 76% 45427 24% /usr
/dev/hd9var 1.00 0.42 58% 5632 5% /var
/dev/hd3 5.00 2.89 43% 100885 13% /tmp
/dev/fwdump 1.50 1.47 2% 12 1% /var/adm/ras/platform
/dev/hd1 0.50 0.30 41% 614 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.50 0.41 19% 2017 3% /opt
/dev/hytllv 30.00 7.72 75% 58031 4% /hytl
/dev/oraclelv 5.00 2.24 56% 7441 2% /oracle
/dev/ora10glv 20.00 7.83 61% 147066 8% /ora10g
/dev/arcbklv 30.00 8.78 71% 3902 1% /archback
/dev/serp01lv 63.00 5.37 92% 25 1% /testerp01
/dev/serp02lv 73.00 5.66 93% 23 1% /testerp02
/dev/serp03lv 60.00 7.97 87% 21 1% /testerp03
/dev/serp04lv 80.00 1.84 98% 16 1% /testerp04
/dev/serparlv 17.00 16.90 1% 11 1% /testerparch
/dev/serprylv 17.00 16.90 1% 12 1% /testerprcry
/dev/serpwklv 6.00 2.34 61% 771 1% /testerpwrk
/dev/serprolv 23.75 14.81 38% 36530 2% /testerppro
/dev/serpollv 10.00 4.14 59% 52834 6% /testerpoutlog
root@testerp:/>lslv serp03lv
LOGICAL VOLUME: serp03lv VOLUME GROUP: testerp01vg
LV IDENTIFIER: 00c90e2200004c000000012543c9f12d.3 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: parallel
LPs: 480 PPs: 480
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /testerp03 LABEL: /testerp03
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>chfs -a size=+3072M /testerp03
Filesystem size changed to 132120576
root@testerp:/>df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.13 44% 6573 3% /
/dev/hd2 2.50 0.61 76% 45427 24% /usr
/dev/hd9var 1.00 0.42 58% 5632 5% /var
/dev/hd3 5.00 2.89 43% 100884 13% /tmp
/dev/fwdump 1.50 1.47 2% 12 1% /var/adm/ras/platform
/dev/hd1 0.50 0.30 41% 614 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.50 0.41 19% 2017 3% /opt
/dev/hytllv 30.00 7.72 75% 58031 4% /hytl
/dev/oraclelv 5.00 2.24 56% 7441 2% /oracle
/dev/ora10glv 20.00 7.83 61% 147068 8% /ora10g
/dev/arcbklv 30.00 8.78 71% 3902 1% /archback
/dev/serp01lv 63.00 5.37 92% 25 1% /testerp01
/dev/serp02lv 73.00 5.66 93% 23 1% /testerp02
/dev/serp03lv 63.00 10.97 83% 21 1% /testerp03
/dev/serp04lv 80.00 1.84 98% 16 1% /testerp04
/dev/serparlv 17.00 16.90 1% 11 1% /testerparch
/dev/serprylv 17.00 16.90 1% 12 1% /testerprcry
/dev/serpwklv 6.00 2.34 61% 771 1% /testerpwrk
/dev/serprolv 23.75 14.81 38% 36530 2% /testerppro
/dev/serpollv 10.00 4.14 59% 52836 6% /testerpoutlog
root@testerp:/>lslv serp04lv
LOGICAL VOLUME: serp04lv VOLUME GROUP: testerp03vg
LV IDENTIFIER: 00c90e2200004c0000000128cd59ed80.3 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 640 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 640 PPs: 640
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /testerp04 LABEL: /testerp04
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>chlv -x'650' serp04lv
root@testerp:/>lslv serp04lv
LOGICAL VOLUME: serp04lv VOLUME GROUP: testerp03vg
LV IDENTIFIER: 00c90e2200004c0000000128cd59ed80.3 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 650 PP SIZE: 128 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 640 PPs: 640
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /testerp04 LABEL: /testerp04
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
root@testerp:/>chfs -a size=+3072M /testerp04
0516-787 extendlv: Maximum allocation for logical volume serp04lv
is 650.
root@testerp:/>chfs -a size=+1024M /testerp04
Filesystem size changed to 169869312