supersun's space

  • 增大字号
  • 默认文字大小
  • 减小字号

AIX页面空间管理的一些操作


查看页面空间的信息

# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv

# lsps -c hd6
#Psname:Pvname:Vgname:Size:Used:Active:Auto:Type
hd6:hdisk0:rootvg:8:1:y:y:lv

# lsps -s
Total Paging Space   Percent Used
512MB               1%

清理无用的模块或代码
# slibclean

查看内存设备

# lsdev -Cc memory
L2cache0 Available  L2 Cache
mem0     Available  Memory

查看内存设备的属性
# lsattr -El mem0 -H
attribute value description                                user_settable
goodsize  1024  Amount of usable physical memory in Mbytes False
size      1024  Total amount of physical memory in Mbytes  False
查看二级缓存的属性
# lsattr -El L2cache0 -H
attribute value description                user_settable
size      1024  Size of L2 cache in Kbytes False


添加页面空间
# smit mkps
查看卷组的逻辑分区大小
# lsvg datavg
VOLUME GROUP:       datavg                   VG IDENTIFIER:  000c78cc00004c000000012567d527a9
VG STATE:           active                   PP SIZE:        16 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      2170 (34720 megabytes)
MAX LVs:            256                      FREE PPs:       2170 (34720 megabytes)
LVs:                0                        USED PPs:       0 (0 megabytes)
OPEN LVs:           0                        QUORUM:         2
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:     3048                     MAX PVs:        10
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable

# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv
创建页面空间:5个逻缉分区,-a系统启动时自动激活 -n 立即激活页面空间
# mkps -s5 -a -n datavg hdisk4
paging00

# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
paging00        hdisk4            datavg          80MB     1   yes   yes    lv
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv

使用mklv的方式添加页面空间,三步:
创建逻缉卷,指定类型为页面空间
# mklv -y pagespace00 -t paging datavg 5
pagespace00
设置系统启动时自动激活
# chps -a y pagespace00
当前激添页面空间
# swapon /dev/pagespace00

激活所有页面空间
# swapon -a
0517-075 swapon: Paging device /dev/hd6 is already active.
0517-075 swapon: Paging device /dev/pagespace00 is already active.

修改页面空间的属性
1、页面空间的大小更改;2、页面空间在系统启动时是否自动激活。
显示页面空间
# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
pagespace00     hdisk4            datavg          80MB     1   yes   yes    lv
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv
将页面空间pagespace00增加5个逻缉分区
# chps -s 5 pagespace00
显示页面空间
# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
pagespace00     hdisk4            datavg         160MB     1   yes   yes    lv
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv
将页面空间pagespace00减少8个逻缉分区
# chps -d 8 pagespace00
shrinkps: Temporary paging space paging00 created.
shrinkps: Paging space pagespace00 removed.
shrinkps: Paging space pagespace00 recreated with new size.
shrinkps: Resized and original paging space characteristics differ,
check the lslv command output.
显示页面空间
# lsps -a
Page Space      Physical Volume   Volume Group    Size %Used Active  Auto  Type
pagespace00     hdisk4            datavg          32MB     1   yes   yes    lv
hd6             hdisk0            rootvg         512MB     1   yes   yes    lv

# cat /etc/swapspaces
* /etc/swapspaces
*
* This file lists all the paging spaces that are automatically put into
* service on each system restart (the 'swapon -a' command executed from
* /etc/rc swaps on every device listed here).
*
* WARNING: Only paging space devices should be listed here.
*
* This file is modified by the chps, mkps and rmps commands and referenced
* by the lsps and swapon commands.

hd6:
dev = /dev/hd6

pagespace00:
dev = /dev/pagespace00

设置启动系统时不自动激活pagespace00
# chps -a n pagespace00
查看启动系统时自动激活的页面空间
# cat /etc/swapspaces
* /etc/swapspaces
*
* This file lists all the paging spaces that are automatically put into
* service on each system restart (the 'swapon -a' command executed from
* /etc/rc swaps on every device listed here).
*
* WARNING: Only paging space devices should be listed here.
*
* This file is modified by the chps, mkps and rmps commands and referenced
* by the lsps and swapon commands.

hd6:
dev = /dev/hd6



删除页面空间
1、查看系统启动时加载页面空间的列表配置文件
# cat /etc/swapspaces
* /etc/swapspaces
*
* This file lists all the paging spaces that are automatically put into
* service on each system restart (the 'swapon -a' command executed from
* /etc/rc swaps on every device listed here).
*
* WARNING: Only paging space devices should be listed here.
*
* This file is modified by the chps, mkps and rmps commands and referenced
* by the lsps and swapon commands.

hd6:
dev = /dev/hd6


paging00:
dev = /dev/paging00
2、关闭要卸载的交换空间
# swapoff /dev/paging00
3、删除页面空间
# rmps paging00
rmlv: Logical volume paging00 is removed.
4、查看系统启动时加载页面空间的列表配置文件
# cat /etc/swapspaces
* /etc/swapspaces
*
* This file lists all the paging spaces that are automatically put into
* service on each system restart (the 'swapon -a' command executed from
* /etc/rc swaps on every device listed here).
*
* WARNING: Only paging space devices should be listed here.
*
* This file is modified by the chps, mkps and rmps commands and referenced
* by the lsps and swapon commands.

hd6:
dev = /dev/hd6