[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC: swap on a LVM volume in debian-installer



Hi all,

in debian-installer, there is a package - partman-auto-lvm - which can setup an entire disk to be used for the debian installation with the use of lvm for most partitions.

Currently it sets up one boot partition, one swap partition and one lvm PV which is used for the rest of the partitions (usually root and possibly home depending on the recipe used).

I'm currently considering whether to change partman-auto-lvm so that the swap partition is created as a lvm lv rather than a separate partition, and I'd like to ask for some comments and feedback before doing so.

The last discussion of this feature seems to have been in this thread:
http://lists.debian.org/debian-boot/2005/10/msg00842.html

===

So far, I've seen the following advantages and disadvantages of swap-on-lvm mentioned:

Advantages
==========
o makes more partitions available to LVM

This means that the swap space can also be managed via the regular lvm tools. Swap space can be reclaimed, enlarged and shrunk using the regular tools when needed. E.g. if a larger swap space is needed, one can do a swapoff, lvextend, mkswap, swapon. In general, to get the most out of lvm, as many partitions as possible should use it.

Disadvantages
=============
These are mostly gathered from the above thread:

o lowmem
I'm not sure this is an issue. If root is already accessed via lvm, will accessing swap via lvm make a difference in lowmem situations?

o suspend-to-disk
There have been concerns that suspend/resume may not work with swap on a lvm volume.

Using initramfs-tools, it seems perfectly possible to resume from a swap partition on lvm (I do so daily). I am not sure whether yaird supports this feature.

o overhead
Accessing swap via the LVM layer might introduce additional overhead.

However, the LVM maintainer disagreed in the above thread, noting that swap should be an io-bound operation and I tend to agree.

Note that these disadvantages might be i386 oriented, are there any other disadvantages on other arches, or on i386 for that matter, that I've overlooked?

Discussion of additional advantages would also be welcome of course :)

===

The reason that I'm personally interested is that swap-on-lvm as the default for a lvm install would allow the experimental partman-auto-crypto (a package which uses partman-crypto and partman-auto-lvm to automatically partition a disk so that any partition except /boot will be encrypted) to share 90% of its code with partman-auto-lvm.

Comments welcome.

Regards,
David



Reply to: