[Cialug] Partitioning schemes

kristau kristau at gmail.com
Sat Dec 23 00:30:04 CST 2006


On 12/22/06, Marc Read <marcread at gmail.com> wrote:
> Hi, I'm new to the site and looking forward to the meeting in January,

Welcome!

Partitioning schemes are a bit of a black art.  In general, you
usually want separate partitions for each of the following file
systems:

  /var
  /tmp
  /usr
  /home
  /boot
  /

>From that basic scheme, you can further subdivide file systems such
such as /var into /var/log /var/www and so forth, depending on the
server's primary functions.  A mail server, for instance, will
probably need a large partition under /var/spool to handle mail, and a
separate /var/log partition for logging.  A Web server, however, need
not have a separate /var/spool, but will probably need a separate
/var/www and database data file system (varies by database).

LVM, or logical volumes can come in very handy here.  LVM allows you
to expand partitions later.  This comes in handy for partitions such
as /home and /var/www or your database data, as you can expand them as
needed.  I usually prefer to allocate non-LVM partitions for /boot and
/ (can make recovery and maintenance a bit easier), then make the rest
of the drive one large LVM partition.  Divvy up the LVM into small
partitions that are slightly larger than what you need and leave a
bunch of unallocated space.  Then you can expand any one of the
partitions into the available unallocated space when they start to
outgrow their bounds.

> I'm setting up a little "test" server at my house with a old 1ghz machine
> and wanted it to be semi-professonlay set up (unlike the lazy 2 partion
> deskop setup).  this box would provide FTP, web, and mysql services.
>
> Here are my thoughts
>
> / - 1gig
> /var/log - 1gig
> /var/www - 5gig (but not real sure)
> /var/ftp - 5gig
> /usr/home - 10 gig (not sure if this should be /home)

This looks OK to me for what you are doing, but I will inject a
caution about running ftp.  Don't do it unless it is local only.  Even
then, there are better alternatives such as rsync or scp.  ftp is one
of the most exploited protocols and it is not secure -- especially if
you are requiring authentication to the ftp server.

> I have also heard some talk about using /srv as the http, and ftp directorys

That depends on the distro.  Most follow the Linux File System
Standard (good article at: http://www.linuxjournal.com/article/1104),
but some stick to older conventions or strike off on their own.

> I wanted to get some other peoples thoughts and advise on what has worked in
> the past and any problems they have run into.  This would be running CentOS
> 4.3

CentOS is pretty standard, as it is based off of RedHat.  If you stick
to the Linux File System Standard, you should be OK.  I believe CentOS
has pretty good LVM support, too.  Just be sure to disable the SELinux
stuff (SE == Security Enhanced) until you are ready to dig in to
system security and hardening.  It can introduce issues that you won't
want to deal with until you've cut your teeth on a few "standard"
systems.

Maybe we can have a partitioning round-table at the next meeting to
discuss various partitioning strategies?

-- 
Tired programmer
Coding late into the night
The core dump follows

My GNUPG public key is available at http://www.kristau.net/public_key.asc


More information about the Cialug mailing list