How to Create a LVM2 Logical Volume for Swap (CentOS 5)

Creating an LVM2 Logical Volume for Swap

To add a swap volume group (assuming /dev/VolGroup00/LogVol02 is the swap volume you want to add):

  1. Create the LVM2 logical volume of size 256 MB:

    # lvm lvcreate VolGroup00 -n LogVol02 -L 256M
  2. Format the new swap space:

    # mkswap /dev/VolGroup00/LogVol02
  3. Add the following entry to the /etc/fstab file:

    /dev/VolGroup00/LogVol02   swap     swap    defaults     0 0
  4. Enable the extended logical volume:

    # swapon -va
  5. Test that the logical volume has been extended properly:

    # cat /proc/swaps # free
  • 9 Users Found This Useful
Was this answer helpful?

Related Articles

How do i disable IPV6 on Cent OS

disable ipv6 on centos then you can do this :-Log in via ssh and type this :-service ipv6tables...

4gb seg fixup,how to solve (CentOS)

Xen DomU: 4gb seg fixup, process A common error on a Xen DomU (as well as Dom0) in...

How can I add more CentOS repositories?

How can I add more CentOS repositories? It is possible to add more repositories that are...

How can I find the Cent OS version?

To check which release your are running you can type this into the console (bash / shell) via SSH...

How can i show my cpu info (linux)?

How can i show my cpu info? Log in to your server via SSH then typ;e the following command...