Skip to content

What are the pros and cons of having one partition or multiple partitions?

Hi,

What are the pros and cons of having one partition or multiple partitions? In other words:

  • having only root (/) and /swap or
  • /, /boot, /home, and /swap as separate partitions?

Also if your system had two (or more) disks, what partitioning scheme and directory mapping would you use?

And this is for the purpose of my home workstation, not an organization PC.

Finally is it possible to have more than one EFI System Partition, one per disk, on a given system?

I think at the moment one of my disks has an EFI as well as Windows 10 and the other one its own EFI parition as well as KaOS partitions.

Thanks in advance.

11 points58 comments
Open on Reddit
About this post
Posted
Archived
Score
11 · 100% up
Kind
Text
ID
4ek4wt

Author

29
posts
48
comments
9
media
View profile

60 comments

I always separate / and /home for easy reinstalling and backup and because I can set up /home with noexec for security reasons. In reality for end-user setup there are no more partitions necessary.

Also if your system had two (or more) disks, what partitioning scheme and directory mapping would you use?

Depends on the storage. If this are two HDDs I'd use the larger one for /home and the smaller one for /. If it's SSD and HDD I'd use the SSD for / because of performance.

4 points

I'd wager it'd be better to put your /home on the ssd.. All your configs, cache, and everyday usage is done in your home folder, speeding up general usage.

Then you could partition the HDD and mount one of the partitions to /mnt/data for large data storage (media, etc).

Edit: personally, I have / on the ssd, and my spinning disk is mounted entirely on /mnt/data. Just personal preference I guess =}

3 points

cache

Cache is held in the RAM and gets written in the background anyway. I prefer fast startup of tools over fast writing cache to storage. And loading a few kB small config file isn't that important to me when there will be a few MB large binary file to load. But that might be psychological because nowadays the bus will be the real bottleneck.

5 points

I agree about /home being in ssd:

  • In systems without enough RAM you'd want to build packages outside of /tmp/ so the easiest solution is to build them in your homedir. Of course you probably can set up a custom dir somewhere in /.

  • Apps during startup sometimes need to read lots of stuff from ~/.config and ~/.cache. In my pc:

    • chromium's cache is 500MB.
    • spotify's cache is 400MB.
    • jetbrain's ides each use 200MB dirs.
    • ~/.vim is 200MB.
  • wine apps need to start from ~/.wine.

  • locally installed npm packages, virtualenvs, fonts, apps (~/.local/bin).

2 points

or just put both on ssd and keep your multimedia files on hdds... it's not like they are that expensive anymore... 250gb and 500gb models should be affordable for most and are quite cheap (250gb especially) and should be enough......

Don't buy anything smaller than 250gb as the performance is lower since they don't have enough flash chips for the controller to do it's magic (inside a ssd is a raid 0 array of flash chips, anything below 250gb has 4 channels, others have at least 8). After 8 flash chips the bus becomes the bottleneck that's why ssds are slowly moving away from sata and why you don't really see speeds above ~500mb/s from any sata ssd (the more expensive models do have faster writes, more iops, faster random reads/writes and more endurance than the cheap ones).

1 points

Don't buy anything smaller than 250gb

I have 110 GB SSD for /, 3 TB HDD for /home (noexec and I actually use the system as multi-user system) and another 10 TB HDD for storage.

1 points

I personally have a bigger / than /home, mostly because I kept running out of storage when installing stuff with pacman

1 points

I have a 128 GB SSD for / and a 3 TB HDD that I use entirely for /home.

3 points

Big pro for having a seperate /boot partition: Full-Disk encryption.

2 points

Could you please elaborate?

1 points

Sorry for taking so long to respond!

It's not that complicated.
Encryption/Decryption is done by the linux kernel. When your PC boots, first the booloader (grub, syslinux, whatever) gets loaded. The bootloader subsequently loads the linux kernel, which resides in /boot. If your boot partition is encrypted, the bootloader can't find the kernel, because it first should get decrypted by the kernel.

As pointed out by others, Grub somehow has a solution to this, meaning it has built in encryption-support. But I don't like Grub, so this means a seperate boot partition for me!

1 points
  • Multiple partitions allow you to mix different types of filesystem: create a ntfs partition for your data that you can share with Windows, something else than ext3/4 for /var that has plenty of small files, or make your life easier if you are trying to run a website or anything that requires isolation/special permissions, like /srv. Also if you have multiple drives you don't really have a choice (you can try a spanned volume, but if a drive crashes you are in quite a pickle....), backups will be easier
  • you can have multiple EFI partitions as long Grub/your bootloader knows where they are. rEFInd is really useful as well on a USB key in case of issues. Also, Windows is not always nice, but on the other hand finding yourself in front of a UEFI shell because you borked something is terrifying
  • a lot of people swear by using a swap partition. It will not cause issues, but you can live with no swap. I do some bioinformatics/simulations, and prefer my memory intensive jobs to be killed quickly rather than be slowed to a crawl silently. Swap mitigates your issues for a while - IF you have many INACTIVE stuff in RAM - but there is a point where it is better to just use a cluster or add more RAM
  • you can use a tmpfs partition to compile stuff faster; there are very few packages that require several Gb for compiling and they get updated once in 6 months maybe (thinking about Intel-mkl).

Cons: Resizing a partition because you allotted to little space to it is painful

2 points

Cons: Resizing a partition because you allotted to little space to it is painful

Some filesystems are meant to cater to resizing better aren't they? Sure would be useful :) Or are you saying it's still painful even then? I've not had to resize yet but kept some extra space in case.

1 points

Let's suppose you have two partitions, A and B in this order on the disk. A is getting full and B has some space. You can shrink B, but this won't allow you to extend A directly because the space you freed is after B, not between A and B. You first must move B to the right, and this is a potentially long and very risky operation.

1 points

something else than ext3/4 for /var that has plenty of small files

What FS is suitable for this use case?

1 points

Partitioning and File systems are your allies. Reiser4 was supposed to be more efficient for /var, but it is pretty negligible and lately it did not play nicely with journaling - in hindsight I would skip it. That being said, a ntfs partition for a dualboot with Windows is pretty useful.

1 points

Edit: see ropid's reply below instead of reading this.

On an SSD there isn't really a point in having a separate / and /home, etc. unless you're using ABS or gentoo then it's wise to have /var on a separate partition so you don't reach the maximum inode limit.

However on a mechanical drive, the original reason is due to data placement: the first partition is nearest the centre of the disk, this means seek time is lower than if it's on the outside of the disk. So if you have separate partitions it makes loading the OS and programs quicker. Another similar trick is some hard drive manufacturers allow you to set the maximum size of the disk (no not increase it but decrease it), generally only with business/enterprise class SCSI drives. This was again used to speed up reading as the smaller drive size means you don't get as close to the edge of the disk meaning seek times are faster.

2 points

You mixed things up a little with the inner and outer parts of the disc. The outer parts are faster than the inner parts. What you write about the first partition being the fastest is still true, because the "start" is towards the outer edge, not towards the center.

Here's a screenshot about a HDD I have from that benchmark thingy in Gnome's "Disks" tool:

http://i.imgur.com/r8m0a5g.png

The blue line is transfer speed with the scale on the left, the green dots is seek time with the scale on the right. The transfer speed difference is pretty spectacular. The seek times seem to stay the same.

2 points

Nice, not really sure why I thought the inside would be faster, added an edit to my original post.

1 points

On an SSD there isn't really a point in having a separate / and /home,

One reason if for easy reinstall or having multiple installations using the same /home.

1 points

IMHO main thing is portability.

If you have separated partitions, you can do whatever you want with the others and nothing would to your /home for instance. encrypt some of them and not all of them. Have the ability to quickly move any one of the parts from a different drive. (bought a new ssd, quickly move your /home to it, without real downtime). Partition wide backups etc. etc. etc.

2 points

True, but if you use btrfs subvolumes, you get the same effect with the advantage of snapshots.

1 points

I run BTRFS so everything is on one partition.

I see no cons with my usage.

1 points

Can you explain how BTRFS makes it better as one partition instead of say you were using EXT4? Is it the subvolume feature? Do you still have the /home split off from /? For development if you want to avoid problems such as logs filling up /var (I have had some naughty software break and spam large log files before), having this as it's own partition(or subvolume? I'm not familiar with these yet) to prevent it from using up the disk so that other partitions function fine avoiding the system breaking is nice.

1 points

BTRFS has a number of features that I find to be quite handy and useful. Filesystem snapshots are my number one. But, yes, sub-volumes are handy too.

Also, consider automatically pruning your logs.

1 points

I'll answer from a default Red Hat Enterprise Linux perspective:

By default, the RHEL installer uses LVM for partitioning. However, the grub bootloader cannot boot from LVM directly. For this reason, a seperate boot partition and filesystem are created to contain the grub files and initramfs. The rest of the space is formatted as an LVM Physical Volume, a Volume Group is created and then one Logical Volume for the root filesystem.

So basically you end up with a boot filesystem and a root filesystem and this is because of lvm. In other words, there's no particular reason for separate partitions or filesystems unless you have some very specific requirements.

1 points

grub bootloader cannot boot from LVM directly

Grub 2 can boot entirely from a LVM LV as I proved last night. Maybe RH uses legacy grub? See here https://wiki.archlinux.org/index.php/LVM#Installing_Arch_Linux_on_LVM

Warning: /boot cannot reside in LVM when using GRUB Legacy, which does not support LVM. GRUB users do not have this limitation. If you need to use GRUB Legacy, you must create a separate /boot partition and format it directly.

I have everything inside one LV to be clear.

2 points

Yep,

But you can't do it in RHEL yet, which is why I gave it as an example of a use case for having more than one partitions.

RHEL 7 Installation Guide
6.14. Installation Destination
6.14.4. Manual Partitioning
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html#sect-custom-partitioning-x86

Warning
Placing the /boot partition on an LVM volume is not supported.

So maybe that's not a great example from an Arch Linux perspective. A better example might be if you want LUKS encryption. You still need some /boot filesystem that will not be encrypted and it is going to need its own partition.

1 points

I have a separate /boot (also efi), swap (as you can't have a swap file on btrfs), /tmp (in tmpfs), /media (huge btrfs raid10 (let the flamewars start) array on a bunch of hard drives), /vms (xfs on on mdraid), / is and everything else is on one btrfs partition ontop of dm_crypt (some things should have their own subvolumes but I'm to lazy so they don't yet), ~/.cache is on tmpfs, browser profiles are managed by psd and are on their own partitions temporarily, hugepages have their own partition too, and I have a 5GB zram partition just because (32gb ram so it's not like I'm short on it...).

/, boot and swap are on a ssd, /media and vms are on hard drives, the tmpfs stuff is in ram (duh), swap and / are encrypted with dm_crypt, the hdd_stuff isn't as there's no sensitive data there. I'd like a few more hdds and ssds but don't have any more sata ports left.

1 points

it's perfectly fine to have more than one ESP per disk/system

1 points

As per Linuxdirk's comment below, I used to put /home on a separate partition for ease of user data backup, reinstallation, etc.. However, some machines include web space files, IMAP data, etc.. What I do now on all machines is set up 3 partitions:

  • /
  • swap
  • /data

Then /home is just either a bind mount to /data/home (in /etc/fstab):

/data/home  /home  none  defaults,bind  0  0

or can be a soft link:

ln -s /data/home /home

This provides maximum flexibility; e.g. putting / on an SSD and /data on a normal disk, or setting up separate software raids for each (I like to use a RAID 1 for / and RAID 5 or 6 for /data).

1 points
unknown author

Deleted before we saved it.

1 points

Pros

  • you can share access on one partition with other users and still have private files

  • you can shortstroke your HD

  • if you had a server you could put public content on a separate partition from your private files

  • anything else that could benefit from having files on separate partitions

Cons

  • some distros can have issues with having one partition full when others are empty

  • takes more time to setup handle files

  • makes a system ore difficult to manage (in my experience)

Not sure about multiple EFI partitions. However, I don't see why not. As long as the different OSs were able to tell which one to boot from which is doable

EDIT: formatting

-1 points
unknown author

Deleted before we saved it.

-10 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.