LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-04-2006, 01:37 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
LAMP Server?


I have a small 1U server (Dell PE850) ready to be a L.A.M.P. server (Linux / Apache / MySQL / PhP).

The drive is a 80GB drive & I am not sure what is a safe partitioning size for each mount point. Can someone please help me and tell me if you were building a non critical LAMP server and had only 80GB's of disk space to work with, how would you partition this disk? I have never dealt with SQL so I don't know what directories are crucial for size and what a safe buffer is.

Can anyone just throw some ideas at me? This box will not have more than 3 users so I don't think the home directories will need to be massive unless SQL or PhP need their own /home directories.
 
Old 10-04-2006, 04:44 PM   #2
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
What distro are you using?

I would waste 1-2 Gb on swap, 10 Gb on /home, 20 Gb on /srv, 10 Gb for your MySQL root directory, and the rest on /

But I'm also insane...

That being said, I've never found a serious issue with SuSE's default partitioning for "Server" setup for a LAMP (+ more) server with few users.
 
Old 10-04-2006, 04:49 PM   #3
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
OK, here's a rough guess (based on actual use on my system):
  • 3-5 G for /
  • 3-5 G for /home
  • 3-5 G for /usr
  • 3-5 G for /usr/local
  • 3-5 G for /opt
  • 3-5 G for /var
  • 3-5 G for /var/lib/mysql
There are five data bases in /var/lib/mysql -- one, containing world geographic information is about 100 M, Bugzilla with thousands of bug entries is about 100 M, too. The others are trivial at 10 M - 50 M each.

80 G is a lot of gig -- make each of the above 5 G and you've managed to use 35 G; if you know that your MySQL data base will be much larger than 100 M, double /var/lib/mysql to 10 G and be comfortable.

Most of the above actual use is 2.5 G or so, /usr is just under 3 G; 5 G each will cover all the bases and leave you a couple of spare partitions for "hot" back up and the like.

Oops, forgot swap -- make that 2x your RAM and you'll be safe.

Last edited by tronayne; 10-04-2006 at 04:51 PM.
 
Old 10-04-2006, 05:08 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by tronayne
OK, here's a rough guess (based on actual use on my system):
  • 3-5 G for /
  • 3-5 G for /home
  • 3-5 G for /usr
  • 3-5 G for /usr/local
  • 3-5 G for /opt
  • 3-5 G for /var
  • 3-5 G for /var/lib/mysql
There are five data bases in /var/lib/mysql -- one, containing world geographic information is about 100 M, Bugzilla with thousands of bug entries is about 100 M, too. The others are trivial at 10 M - 50 M each.

80 G is a lot of gig -- make each of the above 5 G and you've managed to use 35 G; if you know that your MySQL data base will be much larger than 100 M, double /var/lib/mysql to 10 G and be comfortable.

Most of the above actual use is 2.5 G or so, /usr is just under 3 G; 5 G each will cover all the bases and leave you a couple of spare partitions for "hot" back up and the like.

Oops, forgot swap -- make that 2x your RAM and you'll be safe.
Do I need a /tmp directory? You listed /var/lib/mysql but I don't understand, do I make a seperate partion for each 3 /var - lib - sql? How do I make that in the moun tpoint section of partitioning?
 
Old 10-04-2006, 05:52 PM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Quote:
Originally Posted by Carlwill
Do I need a /tmp directory? You listed /var/lib/mysql but I don't understand, do I make a seperate partion for each 3 /var - lib - sql? How do I make that in the moun tpoint section of partitioning?
At some point before or during installation of your distribution, you should be asked or required to set up disk partitioning (size, file system type), possibly with a GUI, possibly manually (with cfdisk or fdisk). Using these tools, you define the number and size of the disk partitions. Once installation begins; i.e., when you're actually installing the distribution software, you should be shown the partitions and asked where you would like each mounted -- the installation process will, most likely, recognize your swap partition (you don't mount that), then ask you in order for each of your partitions (most likely, root [/] will be the first one you're asked about).

Say the installation asks about /dev/sda2 (if it's a SATA drive) or /dev/hd2 (if it's an IDE) and wants you what you want to mount that partition as. You'd enter, say, /usr. Then you'd be asked about the next one and you'd enter /usr/local. The next one might be /opt, Next /var, next /var/lib/mysql and so on.

You're creating logical spaces on your disk drive that will be formatted and have a given file system built on them and then mounted as a specific directory (mounted means as a subdirectory or file tree off the root directory). Give your distribution documentation a read about this.

The /tmp directory doesn't really need to be separate from the root partition (especially in a system as you've described -- remember that the root directory is mounted on a partition as / and all other partitions are mounted to that, thus /usr, /usr/local, /home and so on.

The reason for /var/lib/mysql is that it separates your data base from the /var tree and, if your data base starts growing toward the size of the partition you've defined for /var/lib/mysql, you can either copy the data base to a large spare partition or install a second drive and mount either to /var/lib/mysql.
 
Old 10-05-2006, 01:05 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
You're talking about non-critical. In that case I would keep it simple.
Code:
swap
/
/home
The golden rule for 'swap' is 1.5 .. 2x the size of your memory. However there is no need to have more than 1 GB swap space (some even say 512MB).

'/' will contain nearly everything (os/apss). Most stuff in there is static, but logs will grow. I run a slackware 10.1 LAMP server with X installed as well as the leightweight window managers; no KDE or GNOME). It takes less than 2 GB. Allow some space for updates and additional software.
Further you need space for logs and other stuff that resides in '/var'. I would settle for 10 GB.

The rest will be used for '/home'. This will be used for user home directories and I would create a mysql subdirectory in there as well where the database(s) will reside.

The advantage of a simple scheme is that you don't waste space. The more partitions, the bigger the chance that somewhere along the line a partition might need more space that is not available while other partitions have plenty space left.

You obviously can finetune this. Most logs are in '/var'. In above scheme '/var' is part of '/'. That is the first thing that I would create a seperate partition for when I'm finetuning.
The suggested 3-5 GB should be sufficient. This will be at the cost of '/' in the above schema.

The next 'improvement' will be to create a separate '/mysql' partition; the required space will be at the cost of the '/home' partition. The sizes now start depending on how the server is used. If it's more dedicated to database, you should allocate a lot of space for the database. If it's a server for webhosting, you probably want a lot of space for users.

Last edited by Wim Sturkenboom; 10-05-2006 at 01:10 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Ubuntu LAMP Server for local web server sewmyheadon Linux - Newbie 5 02-11-2007 03:06 PM
LAMP server setup Wim Sturkenboom Linux - General 3 04-20-2006 02:36 PM
LAMP server problems dcdbutler Slackware 2 02-20-2006 04:12 PM
New LAMP Server dragondefj Linux - General 5 01-31-2006 02:38 AM
Lamp Server kwickcut Mandriva 1 11-25-2005 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration