Heya folks, some people online told me I was doing partitions wrong, but I’ve been doing it this way for years. Since I’ve been doing it for years, I could be doing it in an outdated way, so I thought I should ask.

I have separate partitions for EFI, /, swap, and /home. Am I doing it wrong? Here’s how my partition table looks like:

  • FAT32: EFI
  • BTRFS: /
  • Swap: Swap
  • Ext4: /home

I set it up this way so that if I need to reinstall Linux, I can just overwrite / while preserving /home and just keep working after a new install with very few hiccups. Someone told me there’s no reason to use multiple partitions, but several times I have needed to reinstall the OS (Linux Mint) while preserving /home so this advice makes zero sense for me. But maybe it was just explained to me wrong and I really am doing it in an outdated way. I’d like to read what you say about this though.

  • PostColonialMyAss
    link
    fedilink
    0
    edit-2
    6 months ago

    Well technically, if you’re using BTRFS, you might want to check out subvolumes. Here’s my subvolume setup:

    • Subvolume 1, named @ (root subvol)
    • Subvolume 2, named @home (/home subvol)
    • Subvolume 3, named @srv (/srv subvol)
    • Subvolume 4, named @opt (/opt subvol)
    • Subvolume 5, named @swap (which is - you guessed it - the swap subvol)

    You then set up fstab to reflect each of the subvolumes, using the subvol= option. Here’s the kicker: they are all in one partition. Yes, even the swap. Though caveat, swap still has to be a swapfile, but in its own separate subvolume. Don’t ask me why, it’s just the way to do it.

    The great thing about subvolumes is that it doesn’t do any size provisioning, unless specified by the user. All subvolumes share the space available within the partition. This means you won’t have to do any soul searching when setting up the partitions regarding use of space.

    This also means that if I want to nuke and pave, I only need run a BTRFS command on my @ subvolume (which contains /usr, /share, /bin), because it won’t be touching the contents of @home, @srv, or @opt. What’s extra cool here is that I’ll lose 0% FS metadata or permission setup, since you’re technically just disassociating some blocks from a subvolume. You’re not really “formatting”… which is neat as hell.

    The only extra partitions I have is the EFI partition and an EXT4 partition for the /boot folder since I use LUKS2.

    • KiranWells
      link
      fedilink
      06 months ago

      Have you had any luck with hibernation with a BTRFS swapfile? My computer still does not start from hibernation, and I am not sure why, even though I followed the Arch wiki to set it up.

      • PostColonialMyAss
        link
        fedilink
        06 months ago

        Can’t say I have. Haven’t used hibernation mode for years even. Sleep mode is just too good nowadays for me to use it, so I guess we could chalk that up to a fault of the setup.

        According to ReadTheDocs (BTRFS, swapfile) it’s possible under certain circumstances, but requires the 6.1 kernel to do it in a relatively easy way.