Gentoo Archives: gentoo-user

From: Laurence Perkins <lperkins@×××××××.net>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: RE: [gentoo-user] Re: [OT] suggest SSD partitioning
Date: Fri, 10 Dec 2021 19:51:37
Message-Id: MW2PR07MB4058871241241AA275965ACED2719@MW2PR07MB4058.namprd07.prod.outlook.com
In Reply to: Re: [gentoo-user] Re: [OT] suggest SSD partitioning by Wols Lists
1 >>
2 >>
3 >> -----Original Message-----
4 >> From: Wols Lists <antlists@××××××××××××.uk>
5 >> Sent: Friday, December 10, 2021 11:25 AM
6 >> To: gentoo-user@l.g.o
7 >> Subject: Re: [gentoo-user] Re: [OT] suggest SSD partitioning
8 >>
9 >> On 10/12/2021 15:16, Nikos Chantziaras wrote:
10 >> > If you can't do that, then it doesn't matter much whether you use a
11 >> > swap file or partition. On an SSD, both should perform about the same.
12 >> > On an HDD, swap files could run into fragmentation issues if you
13 >> > resize them or create them incorrectly. On an SSD, fragmentation
14 >> > doesn't have much of an impact. A swap file gives you the option to
15 >> > resize it later on without having to do filesystem and partition
16 >> > resizing, so I'd say a swap file sounds better.
17 >>
18 >> 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.
19 >>
20 >> 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 ...)
21 >>
22 >> Cheers,
23 >> Wol
24 >>
25 >>
26
27 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.
28
29 Since BTRFS is a storage pool model, everything else can dynamically resize similarly to using LVM.
30
31 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.
32
33 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.
34
35 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.
36
37 LMP

Replies

Subject Author
["SOLVED"] Re: [gentoo-user] Re: [OT] suggest SSD partitioning pat@××××××××.org