Adjust CentOS6LVMSWAP partition size

Source: Internet
Author: User
You cannot customize partitions when creating a Centos6 template for XenServer in the TXT network mode. after the installation is complete, SWAP is a little large, which wastes a limited space of the system and records the LVMSWAP reduction process. View the current LVM volume: 123 lvscanACTIVE & #39;/dev/

You cannot customize partitions when creating a Centos6 template for XenServer in the TXT network mode. after the installation is complete, SWAP is a little large, which wastes a limited space of the system and records the lvm swap reduction process.
View the current LVM volume:

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

View the currently mounted SWAP partition:
123
swapon -sFilenameTypeSizeUsedPriority/dev/mapper/VolGroup00-LogVol01         partition20971440-1

Adjust the LV size of the SWAP:
12
Lvreduce-L 512 M/dev/mapper/VolGroup00-LogVol01 # adjusted to M size, can also be used + /-

Remount SWAP:
123456
Swapoff-a # Disable SWAPmkswap/dev/mapper/VolGroup00-LogVol01 # recreate the adjusted LV for SWAPswapon/dev/mapper/VolGroup00-LogVol01 # enable SWAP

Expand the remaining PE to the primary partition LV:
12
lvresize -l +48  /dev/mapper/VolGroup00-LogVol00resize2fs /dev/mapper/VolGroup00-LogVol00

Adjusted LV volume:
123
lvscan   ACTIVE            '/dev/VolGroup00/LogVol00' [39.38 GB] inherit  ACTIVE            '/dev/VolGroup00/LogVol01' [512.00 MB] inherit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.