Sometimes it can be prudent to reduce swap space after installation.
For example, say you downgraded the amount of RAM in your system from 1 GB to 512 MB, but there is 2 GB of swap space still assigned.
You have three options:
lvs
returns:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert backup vg01 -wi-ao---- 3.72g home vg01 -wi-ao---- 11.86g opt vg01 -wi-ao---- 1.86g root vg01 -wi-ao---- 3.86g sharewiz vg01 -wi-ao---- 9.86g srv vg01 -wi-ao---- 90.86g swap vg01 -wi-ao---- 4.00g usr vg01 -wi-ao---- 3.86g var vg01 -wi-ao---- 6.86g
Disable swapping for the associated logical volume:
swapoff -v /dev/mapper/vg01-swap
Reduce the LVM2 logical volume by 512 MB:
lvm lvreduce /dev/mapper/vg01-swap -L -512M
mkswap /dev/mapper/vg01-swap
swapon -va
cat /proc/swaps # free
returns:
Filename Type Size Used Priority /dev/dm-1 partition 4198396 0 -1
free -tm | grep -i swap
returns:
Swap: 4099 0 4099