LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2011, 10:48 AM   #1
james_b
LQ Newbie
 
Registered: Nov 2011
Posts: 8

Rep: Reputation: Disabled
Disk partioning for a specific set up


Hiya,

I'm fairly new to Linux. Could anyone share their experience and help me determine a good disk partioning layout?

The machine is a server which will need to run our application software and Solaris Studio, both installed in /opt, and a MySQL server. It will also need X windows available.

I've read some posts, and this is what I've come up with:

swap (8Gb)
i.e. Half the amount of RAM in the machine?

/boot (500Mb)
Seems to be required by the OS.

/

I'm not sure how much space to dedicate to the / partition?

/home

I'm not sure if I need /home on a seperate partition, as it's not really a multi-user system. It just needs a couple of non-root admin accounts and the mysql account.

/opt (10Gb) To store Solaris Studio and our server application (and it's data). Should this be given it's own partition?

/var or /var/lib

I think this should be given the rest of the disk space, or at least 200Gb - to hold the MySQL tables and logs. Does it make a difference whether it's mounted as /var or /var/lib?

/usr

Should this be a seperate partition?

Any suggestions are welcome!

Cheers.

[Edit] The distribution is Oracle Linux 6.1.

Last edited by james_b; 11-17-2011 at 12:02 PM.
 
Old 11-17-2011, 11:56 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,517

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
Well, I can tell you how I do it (and have done it on Solaris SPARC boxes -- older SPARC boxes). All this is based upon gray hairs, so take it for what it's worth.

Swap space: the old-time rule-of-thumb is 2x RAM. Lots of folks will say that's overkill, others (like, for instance, me) will say it's about right. Much of the choice depends upon how much RAM you've got in the box and what you're doing -- looks like you've got 16G? so 8G ought to be all right but keep an eye on swap usage and be prepared to change it if needed. A good monitoring tool is the GKrellM utility that puts a display on your screen showing what's going on; see http://members.dslextreme.com/users/...m/gkrellm.html for particulars (your distribution may already include this utility).

I've never run a separate boot partition, can't really see why to do so. A /boot is required, certainly, but it's just a part of the root file system and I've traditionally left it that way. Works fine for me.

Root. I have my root partition at 15G. /boot and /usr are part of root and I've got 6.3G available. Some additional packages are installed in /usr although I prefer to install anything I add in /usr/local.

/home is a 19G partition for user directories (there are three-to-four). Experience has taught me that users will expand to the available space, kind of like gas in an elevator and it's best to give 'em more than you think they'll need to use; pack-rat users are a pain where you sit down.

/usr/local. I try to install add-on software in /usr/local, a 19G partition that is roughly using about 4G at the moment.

/opt is a 19G partition where all "optional application" packages are kept; i.e., FreeCAD, GMT, GanttProject, Moneydance, Nevitium, VirtualBox, LibreOffice and NetCDF -- GMT and NetCDF are mapping software (as in maps of the earth). Everything else is what I consider system-wide applications available to all users. It's a 19G partition.

/var/lib/mysql is where my MySQL data bases live, also a 20G partition.

/var/lib/virtual is where my virtual machines live, a 92G partition.

/var/lib/psql is where my PostgreSQL data bases live, a 173G partition (yeah, some BIG data bases in there).

/spares is where my geographic data files live (huge), a 92G partition.

Now the reason I do the above is so that I do not loose things when I upgrade the operating system -- during installation of a new release (I do a clean install rather than a package upgrade) I simply tell installation scripts the partition name of the partition (so it will be entered in /etc/fstab) and to not format the partition (this is really, really simple to do with Slackware). That way I don't have to back 100s of gigabytes off somewhere the put it back on (ugh!). If you do use virtual machines and have, say Win7 as a virtual guest, it's going to be at least 20G and more likely 30G -- think about backing that off someplace and you get the idea.

Things like MySQL, PostgreSQL, X and other things are installed in your /usr tree but the data bases go somewhere else (and the somewhere else may need to be pretty big depending on what you're doing). Similarly, LibreOffice is in /opt but the documents are in user /home directories.

Anyway, this works for me.

Hope this helps some.

Last edited by tronayne; 11-17-2011 at 11:58 AM.
 
Old 11-17-2011, 12:11 PM   #3
james_b
LQ Newbie
 
Registered: Nov 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
Interesting, thanks very much.

I'll start with what you suggest, minus the virtual machines and mapping data that aren't needed. Extra space can go into the /var/lib/mysql partition, which is expected to become fairly large.

I appreciate there must be different opinions on this - thanks again!
 
Old 11-17-2011, 02:36 PM   #4
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
troynane may have more grey hairs than me but I have some

For swap: it must be equal to (or some say slightly larger than, but no one can say how much) your RAM if you ever want to hibernate. Unlikely for a server perhaps. For regular swap usage, I don't agree with that 2xRAM rule, or any multiplier of RAM. If you ever get into serious paging your performance will suffer, so ideally you have sized your 16GB such that swap is never required in normal operation. Then you allocate enough such that whatever peak memory requirement you have over a year is met. All of which is saying "it depends".

I can't think of a good reason to have separate partitions for /opt or /var (except as below) or /usr.

One good reason for a partition is to prevent a sudden growth in one branch of the filesystem from killing the whole system. So you might consider separate allocations for /tmp and /var/log. Whether you should do that, and whether any other areas are at risk, depends on your application's characteristics!
 
Old 11-17-2011, 05:51 PM   #5
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by SecretCode View Post
troynane may have more grey hairs than me but I have some
so do I, as I recently discovered.

Quote:
Originally Posted by SecretCode View Post
For swap: it must be equal to (or some say slightly larger than, but no one can say how much) your RAM if you ever want to hibernate.
Why should one want to do that? If I want to shut down my computer, I do exactly that. If not, I turn off the monitor and leave the PC on.
Well, personally I'd sometimes like to hibernate. Go to sleep in late November, and wake up in mid-March or early April. That would be great. But unfortunately, homo sapiens isn't made for that, so we have to endure the ugly, cold season.

Quote:
Originally Posted by SecretCode View Post
For regular swap usage, I don't agree with that 2xRAM rule, or any multiplier of RAM. If you ever get into serious paging your performance will suffer, so ideally you have sized your 16GB such that swap is never required in normal operation.
I don't know what it looks like for a server under heavy load. But my desktop PC with 2GB RAM never even starts to use swap space, which is another 2GB.

Quote:
Originally Posted by SecretCode View Post
I can't think of a good reason to have separate partitions for /opt or /var (except as below) or /usr.
Neither can I. Maybe for /home, depending on how many users you have, and whether they are "real" users. And of course, I'd reserve a separate small partition for /boot.

[X] Doc CPU
 
Old 11-17-2011, 06:15 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Hibernate is really for laptops and you would indeed need at least swap=RAM plus a bit.
For real server of course, you won't be using hibernate anyway...

Swap size really depends on whether you expect to run your system so heavily that RAM will be insufficient AND/OR if you'd like some warning when it runs out of RAM (eg unexpectedly!), rather than the OOM-killer kicking in straight away...

Disk is very cheap compared to RAM these days, I'd prob go with swap=RAM on server.
Here's a good quote/recommendation from RH
Quote:
Considering that

1. At installation time when configuring the swap space there is no easy way to predetermine the memory a workload will require, and
2. The more RAM a system has the less swap space it typically needs, a better swap space requirements rule for Red Hat Enterprise Linux 5 is:

Systems with 4 GB of ram or less require a minimum of 2 GB of swap space

Systems with 4 GB to 16 GB of ram require a minimum of 4 GB of swap space

Systems with 16 GB to 64 GB of ram require a minimum of 8 GB of swap space

Systems with 64 GB to 256 GB of ram require a minimum of 16 GB of swap space
Rule 1 is really the key here. Start with one of the recommended sizes, but be prepared to change that with experience eg reserve some space for a 2nd swap partition or just oversize it anyway. As I said, disk space is cheap.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
partioning of hard disk JUbuntu Linux - Newbie 1 03-27-2008 04:42 PM
Fedora 6 disk partioning layout smackies Linux - Distributions 1 05-24-2007 07:44 AM
Partioning external Hark Disk Panagiotis_IOA Linux - Hardware 2 05-19-2006 03:57 PM
how would choice of hard disk partioning affect performance of Mandriva minsky Linux - Newbie 2 04-07-2006 01:02 AM
Disk partioning - web server jpr9898 Linux - Newbie 2 03-06-2004 04:20 AM


All times are GMT -5. The time now is 09:39 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration