Partitioning advice

I realize that this is a pretty open ended question and everyone has their opinion and every situation is different depending on what you want to do with the server. I've read every post on Linode's forums about partitioning I can find taking in everyone's opinion and advice. This is what I'm thinking for a partitioning scheme. I'm looking for advice, comments, criticism, etc

Intended use of the server: web using Lighttpd (host 4 or 5 sites), database MySQL (for the 4 or 5 sites), PHP, shell account (for me)

I don't intend on hosting sites for other people, though that could happen so I am trying to set things up to make that easier to do without making a lot of changes in the future.

/ = 1 GB

/home = 2 GB (for just keeping junk and personal stuff on, probably will make this smaller in the future as my ~ on my shared host only has 31MB of stuff in it)

/var = 5 GB (contains logs, cache, www)

/usr = 2 GB

/tmp = 256 MB

EDIT (forgot /swap):
/swap = 256 MB

Should I split /var into other partitions, /var/www, /var/log, etc or just wait and see how things actually go on my server and sites?

Is /tmp too small in your experience or opinion?

What about /usr? It's my understanding that's where programs typically get installed on Linux.

I'm mostly looking to separate any "dynamic" data from / to keep / from filling up. Though I could just go with one big 8GB or 9GB partition and run a cron job to run a script to check disk usage and notify my if free space falls below a specified amount.

12 Replies

This is what I have now:

/ (ext3) 1024 MB Image Options

/swap (swap) 256 MB Image Options

/var/log/ (ext3) 1536 MB Image Options

/var/lib/mysql/ (ext3) 2048 MB Image Options

/webroot/ (ext3) 10240 MB Image Options

/var/mail/ (ext3) 1280 MB Image Options

I put it all in /. I don't see any real reason/advantage to partitioning unless you're booting multiple distros.

If your disk fills up from log files, what have you, your operating system won't like that very much, Linux or Windows. On Windows machines I always put data (and most programs) on a separate drive. Makes backing up the data easier or taking it to another system or well any number of reasons including keeping the OS separate from the data.

I've been doing this for many years and from everything I've read it's best practice to do the same on Linux or so it seems.

I have /home on a separate partition so I don't have to enable quota across all of /… Plus it just gives me a warm and fuzzy feeling.

Hi,

I have a / and a /home.

At /home I have everything (wwwroot, mysql, localbackups).

Whenever I need to upgrade distro, I just create a new linode with everything I need, move the image to my original linode, create a new profile and boot.

I don't like upgrading distros.

my configuration

/ => 2 GB

/swap/ => 1GB

/home/ => 10GB -> www,mysql,log,backup

when i want to change my distro, i just change / partition with other distro, and do a little configure again

Use LVM so you can dynamically resize things as you go and react to what your server actually needs, instead of trying to guess, usually inaccurately.

You don't really need LVM if you're using Linode to manage your disks and filesystems. That's LVM on the backend. May as well just use Linode's resize feature rather than have the overhead of two layers of LVM.

I have been using LVM and reiserfs on a Linode for three or four years, precisely so that I can resize partitions on the fly. The performance penalty has not been so great as to cause a problem (or even be noticable, really).

@pclissold:

I have been using LVM and reiserfs on a Linode for three or four years, precisely so that I can resize partitions on the fly. The performance penalty has not been so great as to cause a problem (or even be noticable, really).
+1

That and I prefer other file systems which the Linode disk manager can't resize.

Interesting thread.

I am a beginner, for now everything is under /

I like the idea of separating /home from the rest. Some of you here say they keep everything under /home (wwwroot, mysql, localbackups). In the case of mysql, does it mean the mysqld program is under /home or is it only the mysql data ? In fact, programs that would reside in /home may need to access shared libs located in /usr. I guess it might have libraries conflict when mouting /home with a totally different system partition. Unless you build all your programs statically ?

@xado:

Interesting thread.

I am a beginner, for now everything is under /

I like the idea of separating /home from the rest. Some of you here say they keep everything under /home (wwwroot, mysql, localbackups). In the case of mysql, does it mean the mysqld program is under /home or is it only the mysql data ? In fact, programs that would reside in /home may need to access shared libs located in /usr. I guess it might have libraries conflict when mouting /home with a totally different system partition. Unless you build all your programs statically ?

Hi,

There is no problem doing this. I'm using the default mysql-server package from repository without changes.

You just need to create a new disk image, mount /home, create a new directory "/home/mysql", chown to mysql and copy everything from you old datadir.

Then set datadir = /home/mysql in my.cnf

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct