Partitioning advice
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
/ (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'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 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.
/ => 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
@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.
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