ArchLinux's Partition Suggestions

12,596

Solution 1

'Incorrect' is perhaps a strong term, but my experience over the last few years has been that making a lot of partitions tends to be a mistake -- specifically, later on, I'll want /home or /var or what-have-you to contain more bytes than the partition size permits, which results in a big pain in the neck no matter how it's solved. I've lost track of how many times I've needed to do this, and it just never gets any easier.

This being the case, unless you've got a really strong reason to do otherwise (or you just really love doing sysadmin work, which I did until I'd had my fill of it), I'd recommend simply making one big / partition on the disk, along with a swap partition if you feel the need for one. (I've lately been just swapping to a file; see 9.2 here for how that's done. You might need to add the swapon command there to /etc/rc.local or some similarly suitable place to ensure it persists across boots.)

Granted there's a slight additional risk here that /home will grow too large and starve the system, or similar, but as long as you keep a decent eye on how much space you're using, you shouldn't need to worry too hard on that score -- and the additional convenience of not having to, for example, periodically transfer /var to another disk, mess with /etc/fstab, and reboot, far outweighs the slight risk in my experience.

Solution 2

I generally use the following:

/
/home
/boot
swap

On a 1TB drive, I'd look at something like the following:

swap       18GB
/home      500GB
/boot      1GB
/          remainder

Solution 3

I generally use the following:

/ 30 ~ 40 GB
/boot 256 MB
swap    4 GB (might need more if you want to use hibernation)
/home   20 GB
/mnt/data  the rest

In /home I will usually have only dotfiles; all my data is stored in /mnt/data - this is mostly personal choice; also, if you dual-boot Windows/Linux you can have this partition as NTFS for accessing from both OSes.

The point of having a separate /home partition is that:

  1. if you wipe your root partition, you don't lose settings/personal files
  2. if you dual-boot Linux distributions, you can use the same /home everywhere

As for swap, I have 6 GB RAM and the 6 GB swap partition I have is barely touched.

Share:
12,596

Related videos on Youtube

monksy
Author by

monksy

Personal Website: http://stevenkhicks.de

Updated on September 18, 2022

Comments

  • monksy
    monksy over 1 year

    I'm trying to install ArchLinux and I've run into something extremely weird.

    Its guide suggests that you should create 2 partitions:

    1. ~15gb root partition
    2. Home partition [filling the rest of the space].

    I have a few issues with this:

    1. Where is the boot partition [and bootable flag, which I can't seem to find in cgdisk]?
    2. Where are its swap recommendations?
    3. Why separate the root space [which includes installed applications] from the home directories?

    Are the instructions incorrect about this?

  • Sekhemty
    Sekhemty about 11 years
    Why a swap so huge?
  • Aaron Miller
    Aaron Miller about 11 years
    @Sekhemty Good question -- I was wondering that myself. Assuming the usual advice of 'make your swap as big as your RAM', maybe the box just has a lot of memory?
  • monksy
    monksy about 11 years
    /home growing too large isn't really an issue... since you can only use the space that you have.
  • David Yates
    David Yates about 11 years
    @Sekhemty - I always follow the RHEL standard of RAM+2GB because it's "safest" (and vital if you run JVM - as I found out a couple years ago (antipaucity.com/2011/08/08/why-technical-intricacies-matter‌​/…)). If I don't have 16GB of RAM, I'm safe for my expansion. If I have 32GB, I bump to 34GB swap.
  • Aaron Miller
    Aaron Miller about 11 years
    @monksy What I mean by this is, if you've got one big bucket of bytes as I'm recommending, then if /home gets large enough that, for example, services lack space to write tempfiles in /var, you can end up in a weird and broken state requiring careful intervention to resolve -- something else I've seen happen. Again, though, as long as you keep an eye on how much space you're using so that you don't completely fill up your disk, it doesn't become a problem.
  • Sekhemty
    Sekhemty about 11 years
    I usually keep my /home as large as possible, to avoid filling it. My configuration uses only three partitions (well, I have others but they are used by dual-boot windows), which are a 20GB root, 1GB swap (and the system uses it very rarely) and all the rest rest is /home. I've never been in need of changing them.
  • Aaron Miller
    Aaron Miller about 11 years
    @warren Wait a minute, how does the JVM even have the ability to decide whether it's in core or in swap? Shouldn't that be up to the kernel? I mean, the whole thing's insane, but leaving that aside for a minute, how does it even work?
  • Sekhemty
    Sekhemty about 11 years
    Maybe it's a silly question, but I'm not so expert here, so pardon me: do you need 16+18GB to use Java?
  • David Yates
    David Yates about 11 years
    @AaronMiller - it's when it resizes from its Xmin towards its Xmax: as it needs to exapnd it RAM use, it writes itself out to swap and reads itself back into the new [contiguous] memory. So if you have 1GB swap, the JVM has an Xmin of 1.5GB and an Xmax of 4GB, it will eventually crash and become unresponsive.
  • David Yates
    David Yates about 11 years
    @Sekhemty - the max size of a 32bit JVM instance is 4GB (plus its overhead, of course). So, if you have multiple JVMs running (not uncommon if you use Eclipse, run Tomcat, etc), you can hang one or more of them without plenty of swap space. Trust me - after weeks going back and forth with different vendor senior engineering teams, it's the simplest solution :D
  • Aaron Miller
    Aaron Miller about 11 years
    @Sekhemty Services tend not to use /home; a lot of my experience has been administering web servers whose MySQL databases live in /var/lib/mysql and may grow very large without warning. Different situations, no doubt, but that's a lot of why I give the advice I do; making /home huge is one thing, trying in advance to predict the balance you'll need to strike between /home and /var is another.
  • monksy
    monksy about 11 years
    @AaronMiller I didn't think about the services filling var. However you might want to watch out for postgres, it puts the dbs in /var/lib unless you configure it differently
  • Sekhemty
    Sekhemty about 11 years
    @AaronMiller: my configuration is based on a single user laptop, I'm certain that servers have other needs.
  • Aaron Miller
    Aaron Miller about 11 years
    @Sekhemty True enough. But if you start using that single-user laptop for, say, web development, and don't think to configure MySQL not to put databases in /var/lib/mysql, and start building some database-intensive application that wants a lot of tablespace... Not saying you'd do this, only that it's still a potential concern, even for a single-user machine that isn't serving anything to the world at large.
  • pr.nizar
    pr.nizar about 10 years
    +1 for "the big pain in the neck"! One partition to rule them all.. The question should be why an "average" user would bother making many partitions?