-----Original Message-----
From: Wols Lists <antlists@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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 292 |
Nodes: | 16 (2 / 14) |
Uptime: | 200:49:06 |
Calls: | 6,617 |
Calls today: | 1 |
Files: | 12,168 |
Messages: | 5,316,135 |