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 |