linux 扩充SWAP空间

 

一、创建PV

[root@rac1 ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created

二、扩成VG

[root@rac1 ~]# vgextend VolGroup00 /dev/sda3
  /dev/hdc: open failed: Read-only file system
  /dev/cdrom: open failed: Read-only file system
  Attempt to close device '/dev/cdrom' which is not open.
  Volume group "VolGroup00" successfully extended

三、关闭SWAP

[root@rac1 ~]# swapoff -v /dev/VolGroup00/LogVol00
swapoff on /dev/VolGroup00/LogVol00
[root@rac1 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1217        198       1018          0         12        147
-/+ buffers/cache:         38       1179
Swap:            0          0          0

四、扩充SWAP所在的LV
[root@rac1 ~]# lvm lvresize /dev/VolGroup00/LogVol00 -L +256M
  /dev/hdc: open failed: Read-only file system
  Extending logical volume LogVol00 to 1.25 GB
  Logical volume LogVol00 successfully resized

五、扩成SWAP
[root@rac1 ~]#
[root@rac1 ~]# mkswap /dev/VolGroup00/LogVol00
Setting up swapspace version 1, size = 1342173 kB

六、启用SWAP
[root@rac1 ~]# swapon -va
swapon on /dev/VolGroup00/LogVol00

七、查看结果
[root@rac1 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1217        199       1017          0         12        148
-/+ buffers/cache:         38       1178
Swap:         1279          0       1279

你可能感兴趣的:(linux 扩充SWAP空间)