• [gentoo-user] [OT] suggest SSD partitioning

    From pat@xvalheru.org@21:1/5 to All on Thu Dec 9 20:30:02 2021
    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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wol@21:1/5 to pat@xvalheru.org on Thu Dec 9 21:30:01 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to pat@xvalheru.org on Thu Dec 9 22:50:02 2021
    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

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nils Freydank@21:1/5 to All on Fri Dec 10 00:00:03 2021
    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

    -----BEGIN PGP SIGNATURE-----

    iNUEABYKAH0WIQTgmjCviHEzQ7wFgdAPHeqy02rREgUCYbKIzl8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RTA5 QTMwQUY4ODcxMzM0M0JDMDU4MUQwMEYxREVBQjJEMzZBRDExMgAKCRAPHeqy02rR EmHLAP44TbkBdXvj1aXTVyUSfPaercy6WxT0vk+fDeYFKEDxGwD+OLQcBlNs2kWo B2lpkLO1RfKXE7FBPw/Q4SkpKYxEQw0=
    =MP+M
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nikos Chantziaras@21:1/5 to pat@xvalheru.org on Fri Dec 10 16:40:03 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Edwards@21:1/5 to Nikos Chantziaras on Fri Dec 10 18:20:04 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Grant Edwards on Fri Dec 10 18:50:01 2021
    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

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Nikos Chantziaras on Fri Dec 10 20:30:01 2021
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)