CentOS6调整LVM SWAP分区大小

查看当前LVM卷:

lvscan 
  ACTIVE            '/dev/VolGroup00/LogVol00' [37.88 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [2.00 GB] inherit

查看当前挂载的SWAP分区:

swapon -s
Filename				Type		Size	Used	Priority
/dev/mapper/VolGroup00-LogVol01         partition	2097144	0	-1

调整SWAP所在LV大小:

lvreduce -L 512M /dev/mapper/VolGroup00-LogVol01 
#调整为512M大小,也可使用+/-

重新挂载SWAP:

swapoff -a
#关闭SWAP
mkswap /dev/mapper/VolGroup00-LogVol01
#重新创建调整过的LV为SWAP
swapon /dev/mapper/VolGroup00-LogVol01
#开启SWAP

扩充剩余的PE到主分区LV:

lvresize -l +48  /dev/mapper/VolGroup00-LogVol00
resize2fs /dev/mapper/VolGroup00-LogVol00

调整后的LV卷:

lvscan 
  ACTIVE            '/dev/VolGroup00/LogVol00' [39.38 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [512.00 MB] inherit

还没有评论,快来抢沙发!

发表评论

  • 😉
  • 😐
  • 😡
  • 😈
  • 🙂
  • 😯
  • 🙁
  • 🙄
  • 😛
  • 😳
  • 😮
  • emoji-mrgree
  • 😆
  • 💡
  • 😀
  • 👿
  • 😥
  • 😎
  • ➡
  • 😕
  • ❓
  • ❗
  • 68 queries in 0.076 seconds