Linux Partitioning Recommendation

Hi,
I am a developer and recently I bought a desktop PC.
And wanna setup linux in it.
For the moment I have 2 M.2 PCIe gen4 SSD of 2TB (7000MB/s)

And on one drive I want to set up linux.
What recommendations can you give me on partitioning and on choosing a filesystem.

What I have planned is to have a data partition in which to save git repositories and builds (These can be quite large LLVM ~4G) including spack. And also the caches of the builds via ccache. And I want a performant filesystem to handle this use case.
To have good IO performance on compilation and on the caching side. And to mount some on memory filesystem for some tasks.

(I know from previous installations that ubuntu just laids out a ext4 filesystem meanwhile Fedora has a more flavored setup, including tmfs)

And I would thank some recommendations on the virtualization side, I am thinking whether using OpenStack, Proxmox or VirtManager.

A single root partition scheme will be fine:

/boot - a small 500mb FAT32 for bootloader
/     - all the rest is ext4 for the root partition. 

Follow the discoverable partition spec (UAPI) and systemd will do the rest.

For virtualization, as you’re on the desktop - libvirt with virtmanager are great

4 Likes

I prefer to have my /home partition separated… This way I can wipe the system clean and not lose my settings and files.

6 Likes

i second this. even when something catastrophic happens to my OS I am just out of commision for about 20-30 minutes. a couple lines in the terminal to reinstall apps. and then Im back up and running. hardly an inconvienence.

1 Like

I assume you will be dual booting Windows and Linux?

I would recommend having 2 separate boot partitions, one for each drive, then using your boards one time boot menu to select which you want. This can eliminate windows wiping your Linux bootloader.

For filesystem, the choices are largely personal preference. BTRFS can offer checksumming and snapshots of a single drive. EXT4 is tried and true reliable and well supported. I don’t see any need to complicate things with various partitioning schemes.

The choice of virtualization is really based on personal preference as well so I would encourage you to try out everything at some point but virtmanager is likely going to meet your need.

2 Likes

On a 1TB drive, I normally do something like this:

  • /boot - 2GB
  • / - 128GB if I am going to use ROCm drivers and a lot of Flatpaks… can be smaller if you don’t intend to install a lot of stuff
  • SWAP - depending on you RAM and recommendations
  • /home - The rest of the partition

I like to use btrfs combined with Timeshift for the main partition to get snapshots of the root partition in case of me breaking the system!

1 Like

I agree,
Avoid dual booting with grub… Windows breaks it every other day!
Use 2 hard-drives, one for Linux and one for Windows, and press “F12” when booting to select what to boot.

For virtualisation, I have been using VirtManager for the last 5 years without issues…

2 Likes

Pro enterprise tip:
ALWAYS DISABLE SWAP (for linux)
disable hibernation in Winders

If a server runs out of RAM, we’d rather it crash and reboot than hang indefinitely and have to be reset through the IPMI.

Not to mention the decreased wear on the drive(s).

RAM is cheap, data recoveries from drives beat to death are not.

2 Likes

I run without SWAP since 2020, but everytime I say that, a neck-beard person tells me I am wrong!
That is why I wrote “depending on RAM and recommendations”

Honestly, I can count on one hand the number of times no SWAP gave me issues…
If your system is below 8Gb of RAM, the debate is open!

3 Likes

One good thing SoC with SD card backed storage has given us, is an army of people swearing swap is legacy and detrimental.

1 Like

i mean sure. but if you have enough memory its not going to be using the swap anyway. ubuntu will not swap anything until you get substantially up into the memory utilization.

even with as fast as storage is now, hitting swap a lot when you never do usually feels like garbage. so if you have ignored the user complaining about the performance issues that long, the painful data recovery process is deserved.

2 Likes

I’d just go with the tried-and-true ext4. As for partitions, don’t overcomplicate it: make a simple root partition where everything will go. If you have issues booting Linux, do it again but with a separate /boot partition and have the rest go on a root one.

Today it’s not really possible not to have a separate /boot partition. UEFI doesn’t know what ext4 is, only able to boot from fat32 efi system partition.

1 Like

Aren’t /boot and /boot/efi different things? The minimal for UEFI boot is simply / and /boot/efi for the simplest of setups. /boot can be folded into / just fine unless you have some exotic file system not supported by GRUB or something.

I have the partitions:

  • / (ext4)
    • /boot (ext4)
      • /boot/efi (FAT32)
    • /home (ext4)
  • Swap (Put away your pitchforks, folks. I have a very good reason for it. :slightly_smiling_face:)

…and just leave the security/integrity to the hardware encryption and T-10 PI metadata, and just make backups. The Optane random I/O performance is hard to beat, and ext4 isn’t very much overhead.

I use zram swap on my personal machines. Moves I/O from SSD/NVME to RAM and makes applications that require swap happy.

I believe that Fedora default uses zram swap with a size of “min(ram / 2, 4096)” MB.

1 Like

I was replying to the previous comment, suggesting literally just / (ext4), and if that doesnt’ work (and sure it wouldn’t, unless you’re still in MBR/BIOS) - then split the /boot. At least that’s how the previous comment reads

I can tell you what I use and why. Whether it would be good for you to use something similar, only you can decide.

  • p1: EFI, 240MB (more than enough for GRUB and firmware updates)
  • p2: LUKS; inside: LVM PV/VG
    • LV1: swap, 16GB (large enough for the occasional hibernation)
    • LV2: root, the big remainder, btrfs, with compression and subvolumes:
      • @ for /
      • @home for /home
      • @snap for snapshots

I do my snapshots by hand occasionally, and then copy them off to external storage occasionally; this could easily be automated but at the moment I don’t care enough to do so.

This setup is about as secure as it can be made with reasonable effort, and allows for quick recovery in case of failure (which hasn’t happened to me in years except for operator error).

1 Like

Windows cant break it if Windows isnt online to update its shenanigans :yay:


I heard from ancient greybeards to also separate the /var/log as well, just in case Linux gets into full crazy mode, go into a boot loop and fill your entire drive with just logs.

Granted this was in the olden days where HDD capacity was actually smaller and not along GB or even TB capacity. This seems truer for server type deployments of Linux rather than a desktop where the user actually stares at the screen and see the problem.

I used to be of the opinion of splitting the disk up for different partitions, but for an end user system (instead of an enterprise server) just /boot and root is fine.

You’re running on SSD these days and should probably have a backup of important stuff on another disk/system anyway, so imho the seperate /home is less useful.

Yeah, /var/log /usr and /var/spool on different partitions for both the reason you describe and to use non-default mount options on different partitions like NOSUID or read only for security purposes.

But end user workstation? Less relevant. You’re just adding complexity and potentially creating more problems for future you than you’re fixing.

1 Like