On 2021-12-10 20:51, Laurence Perkins wrote:


-----Original Message-----
From: Wols Lists <antli...@youngman.org.uk>
Sent: Friday, December 10, 2021 11:25 AM
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: [OT] suggest SSD partitioning

On 10/12/2021 15:16, Nikos Chantziaras wrote:
> If you can't do that, then it doesn't matter much whether you use a
> swap file or partition. On an SSD, both should perform about the same.
> On an HDD, swap files could run into fragmentation issues if you
> resize them or create them incorrectly. On an SSD, fragmentation
> doesn't have much of an impact. A swap file gives you the option to
> resize it later on without having to do filesystem and partition
> resizing, so I'd say a swap file sounds better.

It very much does matter whether you use a swap file or partition in practice. I've just been reading right now a discussion about systemd logging and hibernation, and how btrfs handles swap files. It sounds nasty.

If you have a swap file, linux creates an immutable file then uses direct disk i/o. There's a LOT of unnecessary crap there that could go wrong. Just avoid all that trouble and give yourself a decent swap partition. (And if you're running btrfs, a lot of this sounds experimental and dangerous ...)

Cheers,
Wol



For BTRFS I usually do one partition for the whole system and one
partition for swap and then use subvolumes for /home and anything else
I want to keep separate in case of reinstall.

Since BTRFS is a storage pool model, everything else can dynamically
resize similarly to using LVM.

Swap files in general aren't as reliable if one is planning to
hibernate the system.  Swap files on BTRFS should go through a loop
device unless you set them up really carefully.

There's no reason you can't have both swap files and a swap partition.
 I occasionally end up dynamically adding more when I get a program
that uses a terabyte of virtual but very little resident at a time or
something.

Swap onto zram devices can also be a useful tool if the data being
swapped is more highly compressible than zswap will take advantage of.

LMP

Thanks to all for hints. I've created a swap partition.

Pat

----------------------------------------
Freehosting PIPNI - http://www.pipni.cz/


Reply via email to