public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Laurence Perkins <lperkins@openeye.net>
To: "gentoo-user@lists.gentoo.org" <gentoo-user@lists.gentoo.org>
Subject: RE: [gentoo-user] Re: [OT] suggest SSD partitioning
Date: Fri, 10 Dec 2021 19:51:19 +0000	[thread overview]
Message-ID: <MW2PR07MB4058871241241AA275965ACED2719@MW2PR07MB4058.namprd07.prod.outlook.com> (raw)
In-Reply-To: <c8528d8e-5bac-50f2-8942-cea341f89182@youngman.org.uk>

>> 
>> 
>> -----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

  reply	other threads:[~2021-12-10 19:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 19:27 [gentoo-user] [OT] suggest SSD partitioning pat
2021-12-09 20:21 ` Wol
2021-12-09 21:40 ` Dale
2021-12-09 22:53 ` Nils Freydank
2021-12-10 15:16 ` [gentoo-user] " Nikos Chantziaras
2021-12-10 17:01   ` Grant Edwards
2021-12-10 17:49     ` Dale
2021-12-10 19:25   ` Wols Lists
2021-12-10 19:51     ` Laurence Perkins [this message]
2021-12-12  9:43       ` ["SOLVED"] " pat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW2PR07MB4058871241241AA275965ACED2719@MW2PR07MB4058.namprd07.prod.outlook.com \
    --to=lperkins@openeye.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox