public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] suggest SSD partitioning
@ 2021-12-09 19:27 pat
  2021-12-09 20:21 ` Wol
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: pat @ 2021-12-09 19:27 UTC (permalink / raw
  To: Gentoo User

Hi,

I've bought a new SSD and I want to install gentoo on it. I'd like to 
heare some suggestions how to partition it. I'm planning small /boot 
partition, / partition and /data (including home) partition. But I'm not 
sure if I should create a swap partition or swap to file. I'm daily 
hibernating the system to disk. And what should be the size od the swap 
same as RAM or bigger?

Thanks

Pat

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] [OT] suggest SSD partitioning
  2021-12-09 19:27 [gentoo-user] [OT] suggest SSD partitioning pat
@ 2021-12-09 20:21 ` Wol
  2021-12-09 21:40 ` Dale
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Wol @ 2021-12-09 20:21 UTC (permalink / raw
  To: gentoo-user

On 09/12/2021 19:27, pat@xvalheru.org wrote:
> Hi,
> 
> I've bought a new SSD and I want to install gentoo on it. I'd like to 
> heare some suggestions how to partition it. I'm planning small /boot 
> partition, / partition and /data (including home) partition. But I'm not 
> sure if I should create a swap partition or swap to file. I'm daily 
> hibernating the system to disk. And what should be the size od the swap 
> same as RAM or bigger?
> 
Swap partition. That's ALWAYS best if you can.

Bear in mind, I believe it hibernates into swap, so you need to be able 
to dump your active system into swap. So for safety's sake your swap 
should at least equal your ram. The old rule was swap should be twice 
ram, but there are arguments for and against (in these days of huge ram 
I generally allocate "swap = *max* ram" on EACH of my hard disks). On 
rotating rust that's not much - when you have a mobo that takes four 
16GB chips and your SSD is 256GB that's a lot ...

You only need about 32GB for / - I think I run about 20GB used, but you 
need to configure portage to use tmpfs for as much as possible. It's all 
the "useful" files it leaves lying around that use up the space.

Beyond this, not knowing how big your ram and swap actually are, it's 
hard to provide better advice ...

Cheers,
Wol


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] [OT] suggest SSD partitioning
  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
  3 siblings, 0 replies; 10+ messages in thread
From: Dale @ 2021-12-09 21:40 UTC (permalink / raw
  To: gentoo-user

pat@xvalheru.org wrote:
> Hi,
>
> I've bought a new SSD and I want to install gentoo on it. I'd like to
> heare some suggestions how to partition it. I'm planning small /boot
> partition, / partition and /data (including home) partition. But I'm
> not sure if I should create a swap partition or swap to file. I'm
> daily hibernating the system to disk. And what should be the size od
> the swap same as RAM or bigger?
>
> Thanks
>
> Pat
>
> ----------------------------------------
> Freehosting PIPNI - http://www.pipni.cz/
>
>
>


This is some info from my system.  I use KDE and the size of /usr is a
bit large since I have Kicad and some other software I can't recall the
name of installed.  Kicad has some huge libraries installed so it takes
up a little over 5GBs of space on its own.  That said, allowing extra
space if you don't use something like LVM that can be expanded is a good
idea.  Software is growing.  You may need to add some directories
together depending on how or even if you have separate partitions for
some things.  Ignore /home here.  Info: 


root@fireball / # du -shc /*
144G    /backup
11M     /bin
159M    /boot
33M     /etc
8.4T    /home
1.8G    /lib
19M     /lib64
16K     /lost+found
24K     /mnt
741M    /opt
0       /proc
193M    /root
1.6M    /run
16M     /sbin
5.8M    /tmp
20G     /usr
21G     /var
8.6T    total
root@fireball / #


In the past, I had log files go weird and fill up /var.  Since then,
I've put /var on a separate partition.  On mine, yours may be as well,
the portage tree, distfiles and packages are also in /var. 

If you need additional info, just post back.  Otherwise, hope this helps.

Dale

:-)  :-) 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] [OT] suggest SSD partitioning
  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
  3 siblings, 0 replies; 10+ messages in thread
From: Nils Freydank @ 2021-12-09 22:53 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

Hi,

my thoughts:

If you use an EFI/UEFI you will need a so called ESP, i.e. a FAT32 partition.
FAT32 is ugly from a linux user's perspective (e.g. it doesn't support symlinks
as far as I know and being regularly told by other users), but I'm putting
/boot on that partition for at least seven years now without any trouble.

I would always tend for a swap partition to avoid additional overhead from
filesystems in between (beside the fact that I'm using mostly btrfs which
couldn't host swap files for a long time).

AFAIR a binary distribution I used lately takes RAM size for systems without
hibernation and double the size for hibernation (it was most probably either
linux mint or manjaro).
Just imagine your system was already swapping and then you would hibernate, so
you would need your 'normal' swap space plus enough free space to save all data
from RAM on your SSD.

Last but not least I try out too much different software and have full disk
encryption with LUKS literally everywhere a x86 CPU runs, so _my_ favorite
layout is:

first partition: /boot inside the ESP for UEFI
second partition: LUKS with btrfs inside (or LVM + ext4 if I didn't need
                  btrfs features)
third partition: encrypted swap (LUKS, too)

My system is a Notebook with 32 GiB RAM and I choose arbitrarily 18 GiB for
swap wich is empty or filled with a few hundred megabytes most of the time.
I don't use hibernation.

My /var/tmp/portage has a size of 14 GiB wich is enough to compile firefox,
rust, libreoffice and qtwebengine (not at once, of course).

Hope that helps you and much fun with your new drive!

Kind regards,
Nils

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-user] Re: [OT] suggest SSD partitioning
  2021-12-09 19:27 [gentoo-user] [OT] suggest SSD partitioning pat
                   ` (2 preceding siblings ...)
  2021-12-09 22:53 ` Nils Freydank
@ 2021-12-10 15:16 ` Nikos Chantziaras
  2021-12-10 17:01   ` Grant Edwards
  2021-12-10 19:25   ` Wols Lists
  3 siblings, 2 replies; 10+ messages in thread
From: Nikos Chantziaras @ 2021-12-10 15:16 UTC (permalink / raw
  To: gentoo-user

On 09/12/2021 21:27, pat@xvalheru.org wrote:
> I'm planning small /boot partition, / partition and /data (including 
> home) partition.

I just use one partition. What's the point of having multiple ones if
they're all on the same storage device?


> But I'm not sure if I should create a swap partition or swap to 
> file. I'm daily hibernating the system to disk. And what should be 
> the size od the swap same as RAM or bigger?
The "perfect" setup here would be to get a very small SSD (and those 
tend to be very cheap), like a 64GB one for $20 or thereabout, and use 
that as your swap. Just a single swap partition that uses all available 
storage space.

I don't like swap being on my main SSD, since SSDs wear out when you 
write to them. If you're hibernating the system all the time, that 
results in quite a lot of data being written. Having a cheap small 
dedicated SSD for that where you don't care much about its longevity 
sounds like a good idea to me.

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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-user] Re: [OT] suggest SSD partitioning
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2021-12-10 17:01 UTC (permalink / raw
  To: gentoo-user

On 2021-12-10, Nikos Chantziaras <realnc@gmail.com> wrote:
> On 09/12/2021 21:27, pat@xvalheru.org wrote:
>> I'm planning small /boot partition, / partition and /data (including 
>> home) partition.
>
> I just use one partition. What's the point of having multiple ones if
> they're all on the same storage device?

I find it easier to re-install if home and data directories are on a
different filesystem than the system stuff.

--
Grant



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Re: [OT] suggest SSD partitioning
  2021-12-10 17:01   ` Grant Edwards
@ 2021-12-10 17:49     ` Dale
  0 siblings, 0 replies; 10+ messages in thread
From: Dale @ 2021-12-10 17:49 UTC (permalink / raw
  To: gentoo-user

Grant Edwards wrote:
> On 2021-12-10, Nikos Chantziaras <realnc@gmail.com> wrote:
>> On 09/12/2021 21:27, pat@xvalheru.org wrote:
>>> I'm planning small /boot partition, / partition and /data (including 
>>> home) partition.
>> I just use one partition. What's the point of having multiple ones if
>> they're all on the same storage device?
> I find it easier to re-install if home and data directories are on a
> different filesystem than the system stuff.
>
> --
> Grant
>
>
>


Plus if you use LVM or some other similar software, you can expand as
needed.  I have /boot and / on regular file systems for simple booting. 
I have /usr and /var on their own partition.  Obviously /home is on it's
own and on multiple hard drives at that.  Since I did my install on this
rig, I've had to expand /usr at least twice, maybe three times.  I've
also had to expand /var as well.  If one doesn't use LVM or similar,
then you have to redo pretty much everything or reinstall.  I've done
that in the past and I learned to use LVM.  One day, I may switch to
BTFS, sp?, or similar.  That said, LVM works fine for me at the moment.

As I mentioned in a previous post, I've had a log file go crazy and fill
up /var.  My system continued to run just fine.  However, if it was on
the same file system as / is on, that could have created problems. 
Could even cause a crash and may not even reboot normally either.  Just
depends on what must store things there I guess. 

Just thoughts.  Each has to do things to suit their situation. 

Dale

:-)  :-) 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Re: [OT] suggest SSD partitioning
  2021-12-10 15:16 ` [gentoo-user] " Nikos Chantziaras
  2021-12-10 17:01   ` Grant Edwards
@ 2021-12-10 19:25   ` Wols Lists
  2021-12-10 19:51     ` Laurence Perkins
  1 sibling, 1 reply; 10+ messages in thread
From: Wols Lists @ 2021-12-10 19:25 UTC (permalink / raw
  To: gentoo-user

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [gentoo-user] Re: [OT] suggest SSD partitioning
  2021-12-10 19:25   ` Wols Lists
@ 2021-12-10 19:51     ` Laurence Perkins
  2021-12-12  9:43       ` ["SOLVED"] " pat
  0 siblings, 1 reply; 10+ messages in thread
From: Laurence Perkins @ 2021-12-10 19:51 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ["SOLVED"] Re: [gentoo-user] Re: [OT] suggest SSD partitioning
  2021-12-10 19:51     ` Laurence Perkins
@ 2021-12-12  9:43       ` pat
  0 siblings, 0 replies; 10+ messages in thread
From: pat @ 2021-12-12  9:43 UTC (permalink / raw
  To: gentoo-user

On 2021-12-10 20:51, Laurence Perkins wrote:
>>> 
>>> 
>>> -----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

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

Pat

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-12-12  9:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-12-12  9:43       ` ["SOLVED"] " pat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox