Slashdot Mirror


What Are Appropriate Sizes For Linux Partitions?

stuyman asks: "I'm amazed that I haven't been able to find a good source of information on this sort of subject, but it seems that all anyone ever says is that it needs to be determined based on "certain factors" on an individual basis. No one ever says how to evaluate those factors. I need to set up a whole bunch of new Linux servers. How big should the partitions be? Anyone have any formulas or ideas? I'm open to superstitions, too (heads, root is 300, tails it's 60). Some quick details about the setup: We've got a 20.5 gig HD and we want to have separate partitions for /, /var, /usr, /usr/local (maybe), /home, /opt, and /tmp, as well as a sufficient amount of swap. The servers will run RedHat 6.2 with Apache stronghold, and will also need X installed. We're currently leaning towards having huge /usr and /usr/local, with about 2 gigs for var. Also, how much /var would one suggest for a syslogd server that'd be serving logs for 50+ boxen? (running mostly RH or SunOS) Awaiting this thread eagerly..."

3 of 35 comments (clear)

  1. My scheme by ptomblin · · Score: 3

    It's not perfect, but it's mine:
    /dev/hda1 101075 83487 12369 87% /
    /dev/hda10 4408138 1827348 2352669 44% /backup_1
    /dev/hdc10 4423964 4023975 171049 96% /backup_2
    /dev/hda5 1981000 1255590 622998 67% /home
    /dev/hdc5 1981000 619979 1258610 33% /opt
    /dev/hdc9 99507 72393 21975 77% /root_shadow
    /dev/hda8 101075 2195 93661 2% /tmp
    /dev/hdc6 991000 767770 172026 82% /usr
    /dev/hda6 1981000 420730 1457858 22% /usr/home
    /dev/hda7 995115 98461 845248 10% /usr/local
    /dev/hdc1 1981000 206648 1671941 11% /var/spool
    /dev/hdc7 99507 306 94062 0% /var/tmp

    If I had to do it over again, I'd make / a bit bigger, and maybe make another partition for /var.

    My intent here was to have two 10G disks instead of one 20G disk, and partition them in a way so that if one disk failed, I could keep running essential stuff (like news, mail and the web server) on one until I could buy another. That's why each partition on /dev/hda has a corresponding partition of the same size on /dev/hdc. I have a nightly script that copies everything in / to /root_shadow (and yes, I tested that I can yank hda out of the system and boot from hdc). I also have the nightly script copy stuff into /backup_1 and /backup_2. (This is as well as backing up to tape - call me paranoid).

    --
    A "freaking free-loading Canadian" stealing jobs from good honest hard working Americans since 1997.

    --
    The next Cmdr Taco duplicate will be ready soon, but subscribers can beat the rush and see it early!
  2. What I do... by Wakko+Warner · · Score: 3
    / doesn't need to be big, if all you've got in it is /etc, /lib, /bin, and /sbin. Mine's about 90 megs or so.

    /usr, if you're gonna have a separate /usr/local (and you should have an /opt, by the way, for "payware"), should be a couple hundred megs.

    /usr/local should be a gig or two. Especially if you're using huge bloated apps like emacs or the Gimp, which can easily chew up 60 megs alone.

    /home -- make it as big as you can. I find I'm running out with 2 gigs.

    /var -- if you're hosting a huge amount of mail, make it large (a gig or so). If not, don't bother. Mine's about 400 megs, and I've got plenty of room.

    /tmp - I like to compile stuff in /tmp. Yes, I'm bad. A gig here for me.

    Now, you need space for "other crap": mp3s, temp space for other packages, download space. I use the "sandbox" scheme:

    /dev/sde1 8746648 7321200 981136 88% /sandbox3
    /dev/sdd1 4307423 3763192 321312 92% /sandbox2
    /dev/sdb4 1416229 1008444 334602 75% /sandbox1
    /dev/sdc1 4102112 3562837 327008 92% /sandbox0

    Which I stole from Northeastern's CS department scheme, just because it seemed cute. All the stuff I'm about to burn to CD, or have downloaded and want to fool around with, or that's a big lame work-in-progress that won't fit in /home goes somewhere in there.

    - A.P.

    --


    "One World, one Web, one Program" - Microsoft promotional ad

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
  3. /usr/local by eMBee · · Score: 3
    first, DO NOT combine /usr and /usr/local
    /usr/local is very dynamic, depending on what you put on there, while /usr is pretty static.

    how much you allocate for each partition mostly depends on how flexible you are and how long the system will run without adding diskspace.

    /: on my redhat 6.2 disk takes about 40MB, 6.1 takes 50, i don't know why there is that difference, it is likely that i installed less stuff on the 6.2 machine, my / have a size of 70MB.

    /usr: when i installed rh 6.1 i allocated 1GB for /usr, it eventually turned out that it was not enough, as i wanted a fairly complete desktop install. for your servers this will be a lot less, as you don't need all the games and stuff.
    i'd suggest you make a test install of what you want to have on your system, see how much /usr needs, add 50% to have room to grow, and use that.

    /home and /usr/local: these two are really individual, there is no way to generalize on those, some people do not need anything in /usr/local because they hardly compile and install their own software, others do a lot more, same for /home, it is really not to say...
    i often found out that no matter what i chose, one partition ended up to small.
    one way to combat that was to make sure both partitions have a different size (like 5GB and 8GB) that way, if you find that one partition was to small, and the other to large, you can exchange them, or move the larger partition to a new disk, and move the smaller to the larger one.
    if you want real flexibility, combine them:
    nowadays i have a large partition in /local and link /usr/local -> /local as well as /home -> /local/home
    that way, it doesn't matter...

    /opt: do you really need it? are you sure? well then same considerations as for /usr/local and /home, and if you want flexibility, again, combine (/opt -> /local/opt)

    /var: this depends on how much data you want to keep, don't like log rotation? better make it very large, otherwise a few 100 MB should do.
    but, consider mail, have lots of users? you'll need lot's of space in /var/mail
    on one system (debian) we had to go as far as putting /var/mail on a seperate partition and use user quotas on it too, to make sure everybody could get their mail...
    but we also had to split up the rest of /var. to make sure that in case of a full disk only a few systems are impacted, we now have a seperate /var/log (1GB) (which is only 4% full) /var/spool(1.5GB, 29%full) and the rest of /var(1GB,26% full), this is for a smaller server with about 150 users, which also just received a renewal, so the sizes are desigend for growth (the previous system had a lot less space)
    the isp i work for, unfortunately opted for the "don't partition at all" approach, so i can't say anything about that (we have load balanced machines and the data is kept on raid, so the situation is different)
    to make further growth easy, we have several partitions that we keep empty and hide away from the users so we can add them to the system as needed while keeping the users disciplined because they don't know about that...

    /tmp: another very variable thing, your diskspace is limited, but users may temporarily need lots of it for compiles? make it large!
    there is plenty of rome in /home? you don't need to worry so much about /tmp then.
    want to make the best of your recources? consider combining /tmp with /var, that's what i do (/tmp -> /var/tmp), works fine.

    greetings, eMBee.
    --

    --
    Gnu is Not Unix / Linux Is Not UniX