Slow 12.04 on a Netbook with LVMs

Liam Proven lproven at gmail.com
Fri Apr 26 10:37:24 UTC 2013


On 26 April 2013 11:22, Avi Greenbury <lists at avi.co> wrote:
> Liam Proven wrote:
>> > I'd like to create the swap space as a file, not a partition.
>>
>> Possible but saps performance (marginally, in theory; allegedly Linux
>> >=2.6 ameliorates this).
>
> As of an early 2.6 they're identical, assuming that the swap file
> isn't sparse. The easiest way to do that is to dd /dev/zero into the
> file then mkswap it; modern swapons wont let you use a sparse swap
> file.

Thanks for the additional info.

(& how's the head this morning? ;¬) )

>> If you have 1-2GB of RAM, try zRam and no swap at all. Works well for me.
>
> Does that still permit suspend/resume? That's the only reason I have
> swap configured anywhere.

Suspend yes. Hibernate, no. I have been evaluating zRam both with and
without swap, but only on desktop boxes or ones where I have manually
disabled suspend/resume. Suspend/hibernate is a feature I only use on
notebooks/laptops. Desktops I either leave running or shut down
completely.

>> primary, 8GB, for /
>> Extended for all the rest
>> Inside that, (all the available space - (RAM × 2) as /home, encrypted
>> if you feel you need to), and at the end, (2×RAM as swap). That gives
>> you plenty of space for hibernation support.
>
> You only need swap that is as big as (1 x used RAM + (2 x used swap) ) for
> suspend to work.

True, but how does one know in advance how much swap one's going to be
using when one wants to hibernate? With great difficulty, I submit.
The old 2×RAM thing is easy to calculate, should be more than enough
for anyone, and disk space is cheap and plentiful these days.

> Personally, here I'd have a single / partition, use the loopback
> method for encrypting /home and have a swap file. All the convenience
> of LVM (directories can grow as they please) without actually having
> to do anything. If you do suddenly need some extra space for a bit,
> you can just delete the swap file and reinstate it when you're done.

Interesting. I defer to your superior knowledge.

Questions:

* what is " the loopback method for encrypting /home"?
* can one hibernate with a swap _file_ as opposed to a swap _partition_?

And a comment:

I recommend a separate /home filesystem (i.e. partition) because it
vastly facilitates upgrades - one can parallel-run 2 different
versions of the distro, or 2 different distros, sharing a single /home
partition, using different usernames if one is paranoid. Having it
inside a file on / -- encrypted or otherwise -- would make this
difficult or impossible, no?



--
Liam Proven • Profile: http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk • GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at hotmail.com • Skype/AIM/Yahoo/LinkedIn: liamproven
Tel: +44 20-8685-0498 • Cell: +44 7939-087884




More information about the ubuntu-users mailing list