Lvm – Should swap space be in a logical volume, or directly on disk

lvmpartitionrhel5rhel6swap

What are the benefits of putting swap into a logical volume over using direct disk access?

For example, with a fresh, default install of RHEL5 or 6, a volume group is created on the default disk along with one other small non-logical partition (for /boot). Inside the volume group, a swap space is created along with the mount point for /.

What are the benefits (if any) to having swap be inside a logical group instead of directly on the disk?

Best Answer

The benefits are:

  • more flexibilty if you want to change the size of swap
  • you don`t need a partition for swap

AFAIK this - once existing drawback does NOT exist any more:

  • not possible to resume from swap