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

Re: Recommendation on partition sizes

Andy Smith <andy@strugglers.net> writes:

I definitely stand by your recommendation of LVM and most of what you
said, but you seem to assume a "server" context, whereas we're talking
about a laptop, so there are a few differences:

> Seems excessive. Without service-specific data or /var, my servers
> generally use under 2GiB for /, so dedicating 40GiB to it is likely
> to be wasteful.

Not sure what your servers run, but my desktops and laptops use up
somewhere between 10GB and 15GB in / (with no special data in /var).
That will largely depend on the amount and kind of packages you install.

>> /swap, encrypted, 16GB (same as RAM)
> Hugely overkill. You do not need for your swap to be as large as
> your RAM unless you are intending to hibernate to disk. If you are
> intending to do that, fair enough, but if not, that's probably 12+
> GiB of expensive SSD that sits idle forever.

A large part of the data in RAM is made up of the disk-cache, and that
doesn't need to go to swap during hibernation.  Furthermore, the
remaining data can be compressed before being written to swap, so the
hibernation data takes a lot less space than your RAM, something like
1/3 maybe, in my experience.

IOW 8GB of swap should be plenty even in case of hibernation.

> There are exceptions to that, but for those times you can simply
> create a swap file and add it.  There is no performance difference
> between a swap file and a dedicated swap partition.

I use LVM volumes for my swap space, which is yet another option, one
that can be grown and shrunk easily, online.

> "How much swap do I require?" is a little bit of a holy war, with
> some even taking the position that the answer is "zero".

It depends on your use case, indeed (e.g. if you store large files in
tmpfs you may like swap space to match).

> So, if I were you, I'd be doing something like:
> - 512MiB /boot
> - 2 GiB swap, or 16GiB if you intend to use it as a hibernate device
> - Rest as LVM volume group
>     - 4 GiB / as logical volume
>     - 4 GiB /var as logical volume
>     - 50GiB (or whatever satisfies initial demand) /home as logical
>       volume

I don't see a strong reason to put swap space in a dedicated partition,
so I put mine in LVM.

> If you suddenly find yourself needing something extra, you can
> easily create a new logical volume and mount it. When you get close
> to filling your /home, you can just grow it a bit and grow the
> filesystem online¹.

Indeed, I'd likely use an LVM volume for the VM, for example.

> I would want to be putting all of this on top of software RAID, so
> my system doesn't die when one of the storage devices dies.

But since we're talking about a laptop, it might be impractical.

> If you've never used LVM before then all of this may seem like
> unwanted complexity, but it's a small set of self-contained concepts
> that are very well supported by the Debian installer so to me it's
> well worth getting to grips with.  It will provide you with a lot of
> flexibility throughout the life of the system.

Very much so.  One of the benefits also is that you get to *name* your
volumes, so you don't need to mess with meaningless UUIDs.


Reply to: