|
Re: How to shrink swap?
Late response, but you never know who's looking for answers. This worked well for me.
Issue: I like small VMs, and a 'default' (RHEL 6) install on a 10GB partition gave me 4GB / and 4GB swap. Sheesh.
vi /etc/fstab
# comment out the swap line
init 6
lvreduce -l 13%VG /dev/vg_mysys/lv_swap
lvextend -l +100%FREE /dev/vg_mysys/lv_root
resize2fs /dev/vg_mysys/lv_root
mkswap /dev/mapper/vg_mysys/lv_swap
vi /etc/fstab
# uncomment the swap line
touch /forcefsck
init 6
Voila!
Obviously the vg and lv names and the lvreduce % are my own examples, use what you like.
-Hugh
|