Linode Forum Index Linode Forum
Linode Community Forums
 


Partitioning advice

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
waldo



Joined: 21 May 2009
Posts: 336

Posted: Mon Jun 01, 2009 12:08 pm    Post subject: 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.

Code:
/ = 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.
Back to top  
tofu



Joined: 01 Jul 2006
Posts: 50
Location: Ghent, Belgium

Posted: Mon Jun 01, 2009 12:14 pm    Post subject:  

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
Back to top  
Guspaz



Joined: 26 May 2009
Posts: 1145
Location: Montreal, QC

Posted: Mon Jun 01, 2009 4:02 pm    Post subject:  

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



Joined: 21 May 2009
Posts: 336

Posted: Mon Jun 01, 2009 4:09 pm    Post subject:  

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.
Back to top  
mwalling



Joined: 10 Dec 2007
Posts: 335

Posted: Mon Jun 01, 2009 4:13 pm    Post subject:  

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.
Back to top  
nfn



Joined: 21 Jan 2009
Posts: 103

Posted: Mon Jun 01, 2009 5:47 pm    Post subject:  

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.
Back to top  
arieonline



Joined: 18 May 2008
Posts: 17
Location: Indonesia - Bogor

Posted: Mon Jun 01, 2009 9:04 pm    Post subject:  

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
Back to top  
fukawi2



Joined: 02 Feb 2009
Posts: 64
Location: Melbourne, Australia

Posted: Tue Jun 02, 2009 1:13 am    Post subject:  

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.
Back to top  
Xan



Joined: 08 Feb 2004
Posts: 562
Location: Austin

Posted: Tue Jun 02, 2009 1:36 am    Post subject:  

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.
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 877
Location: Netherlands

Posted: Tue Jun 02, 2009 1:57 am    Post subject:  

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).
Back to top  
fukawi2



Joined: 02 Feb 2009
Posts: 64
Location: Melbourne, Australia

Posted: Tue Jun 02, 2009 3:03 am    Post subject:  

pclissold wrote: 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.
Back to top  
xado



Joined: 31 May 2009
Posts: 12

Posted: Tue Jun 02, 2009 9:23 am    Post subject:  

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 ?
Back to top  
nfn



Joined: 21 Jan 2009
Posts: 103

Posted: Tue Jun 02, 2009 10:35 am    Post subject:  

xado wrote: 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
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1