I am setting up a machine to run a number of virtual machines. I am using a single HDD with a boot partition and an LVM partition. I read on the Arch wiki that logcial volumes which will be used for swap should be setup with -C y

To create a contiguous partition, which means that your swap space does not get partitioned over one or more disks nor over non-contiguous physical extents.

How important is this? If i have a dozen VMs each with a contiguous logical volume for swap and a non-contiguous logical volume for /, how will having so many contiguous logical volumes affect my ability to resize logical volumes (either contiguous or non-contiguous)?

  • That instruction was removed from ArchWiki. Here it was discussed (now closed and removed): wiki.archlinux.org/…
    – Ashark
    Oct 16, 2020 at 10:26

2 Answers 2


I am not aware of any requirement that swap space be contiguous on disk under Linux, with LVM or otherwise. I have never arranged for my swap LVs to be contiguous and have never run into any problem (it's possible that all my swap LVs just happened to be contiguous, I've never looked).

Linux supports non-contiguous swap files, it would be odd to have such a restriction on LVM volumes. I can't find any reference to this in any official documentation or anyone explaning why swap LVs should be contiguous. This has all the hallmarks of an urban legend.

The origin may lie in HP-UX, which Linux's LVM is partly inspired from, and which did (does?) require swap space to be contiguous. I don't know that this has ever been the case on Linux.

There may be a perceived performance benefit, but with 4MB extents, I very much doubt there is any performance benefit, and I can't find any benchmark.

If you have volume groups that span over multiple disks, you may want to constrain what PV the swap LV is on. But I wouldn't require a contiguous volume.


If these volumes are to be exposed to the VM's as their own devices, then they won't be able to tell the difference. Unless your PE size is really small, it shouldn't matter if the extents are contiguous or not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .