Automatic or Custom Partitioning

DeaconFrost

[H]F Junkie
Joined
Sep 6, 2007
Messages
11,582
In moving along with my Linux learning, I've decided to tackle disk partitioning. Let's say I'm about to reinstall *insert whatever distro here* on my personal laptop as the primary and only OS. It has a 500 GB Samsung NVME drive.

Every time I've install Linux, I choose automatic partitioning. Is that the best way for a clean, empty drive? When (and maybe more importantly, why) would I choose custom, aside from a drive with existing partitions/OS.

That may be a vague question, so, maybe better, is there a good "best practices" way of partitioning a drive?
 
Last edited:
I always let it do its thing. I can't see any good reason to separate partitions.
 
I always do it by hand but that's because I want things a certain way. If you don't or don't care, then sure, go automatic.
 
That may be a vague question, so, maybe better, is there a good "best practices" way of partitioning a drive?

As I dual-boot on all of my desktop / laptop systems that run Linux (or other), I always do a custom setup.

You need two total partitions to get Linux running. One for the EFI mounted at /boot/efi and one for the OS mounted at root ( / ).

In addition, you can have a swap partition. For regular swap use there are guidelines, and for hibernation where the contents of system RAM are copied to swap, you'll probably want a swap partition that's a little larger than total system RAM.

Something else to consider is putting your /home directory on another partition. This makes reinstalling or moving distros much easier.

And when you inevitably do need to reinstall or wish to try another distro on the hardware (as opposed to a VM), you can tell the installer to use the existing partitions by adding them as mount points. Only the root ( / ) will need to be formatted.

So, minimal installation:
  • / (for root)
  • /boot/efi
Normal installation:
  • / (for root)
  • /boot/efi
  • swap (not mounted, but you do select it in the partition tool)
  • /home

I will say that when I toss a distro into a VM, I typically don't bother with partitioning.

Beyond that, you can easily go back and make changes to partitions. Some can be done with the system booted, and almost everything else can be done by booting the install image up again and starting GParted, which gives you a 'partition magic'-like GUI tool.
 
I always let the installer handle it automatically since I have no need for multiple partitions. If I ever intended to run multiple distros on a machine I might manually partition the drive.
 
"Want things a certain way". Can you give examples?

Typically because I might want LVM setup a certain way, with certain naming conventions, or just want to pick certain sizes for things, maybe setup a swap partition in a specific way, or maybe I am doing encryption or something. Maybe I want to pick the file systems being used or something. I am not one to go crazy and make a million partitions, but maybe I want to do something like setup LVM with mirrored /boot partitions and a mirror-striped root partition or something. It just depends.
 
In general for most people automatic is fine. But it still nice to know what is actually going on.... and also every distro has a different idea of what the default part will look like.

Some distros still by default create a /root and a /home.... some create a /swap some don't. Most use EXT4 byt default some use XFS or BtrFS and a few odd balls might use something completely different.

https://en.opensuse.org/SDB:Basics_of_partitions,_filesystems,_mount_points

Suse has a pretty indepth page on the basics.

Here are a few reasons to do your own partioning.

1) File system selection. Most distros default to ext4 and for the most part that is the way to go. Some people like BtrFS for copy on write support and easy quick snapshots. You give up speed using copy on write which is why some people use multiple file systems.
1a) Some distros (suse) will create a /root part for the OS and use BtrFS which allows for snap shoting of the OS while creating a /home part using XFS which is in some regards a faster file system then ext4 and makes a good pure data file system. Not saying its better or not... just a logical setup if system backups are your thing I guess.
2) keeping a part for /home can allow for easier reinstallation... allowing you to reformate the /root and just remounting the old /home
2a) switching distros can be easy or a mess... but in general its possible to use a /home part from another install. If you where to say move from ubuntu to pop or mint or even pure debian as examples in general you can use the same /home. Distros that are drastically different may cause some issues but in general all distros store .conf files in the proper places in the users /home and swapping distros is mostly painless if your home is on its own part.
3) seemlessly spanning physical hardware. It sounds this doesn't apply to you... but some people will put /root and perhaps /swap on smaller faster drives... and mount /home on another drive. On the crazy side of things I have seen systems with /root mounted on one drive... /home on another... and even /opt on yet another.
 
When I start using these systems as primary-ish....something more than just learning, I'll probably follow that advice, in keeping a separate /home drive or partition.
 
I always do automatic. I don't like having to think about swap and whatnot and I've never had a problem with a modern linux OS installer making the wrong choice for me. I just choose to clean wipe the drive and roll with whatever it sets my partitions to.
 
My 2c. If I think a system will be around long enough for me to really grow into it, (eg. a server with a real job, or my desktop) I'll take the time to at least review the partition scheme and modify it if there's something I don't like.
Things I may not like:
  • No or broadly configured volumes in a volume group - LVM is a great way to allocate and reallocate storage to particular volumes as you may need it. It's a bit annoying when something defaults to giving you 1TB of /home when you're not even planning on storing things there. Then you have to work to reduce a volume and expand another. It's easier to get it setup from the get go, and/or use the minimum needed to get started and grow your volumes as you need to. Not using LVM would be rare for a distro now a days.
  • XFS filesystems - If the system has some ambiguous growth outlook, I'll opt for EXT4 as it has tools to shrink partitions. Makes it easier to say reduce /home in order to allocate it to /var.
  • /var not being a separate mount point - /var generally holds dynamically growing thing. Typically the default place for logs, databases, web content. If you don't keep an eye on usage and are playing with those types of services, you can potentially be storing a lot of extras and fill up /var. dealing with a full /var is easier than a full /. A few distros will just drop most of your storage on / and /home.
 
Last edited:
Back
Top