LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-17-2005, 11:09 PM   #1
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Rep: Reputation: 0
ideal partition setup for server


I'm installing Fedora Core 3 on a machine with 512ram and 160gb harddrive. I intend this machine to be a web server (possibly many large sites using java and databases), email server (for each domian name where a website is hosted), it's own dns, and a data store to back up my personal files and media. I also plan on using it some as a desktop computer with KDE, I may even do some development on it. But I expect the server load to increase, and my personal use of it to decrease in time. I plan to store my backup data on two 120gb mirrored drives , so I am leaving them out of my partition scheme. I was going to be setting up the linux software RAID for these, anyone use this and have good or bad experiences? Should be LMV or ect3?
My primary question is how best to partition this. Based on some reading, this is the scheme that I am thinking about, but I'd love to hear comments and suggestions. I plan to install pretty much everything.

/boot 128mb
/swap 512mb
/var 1,024mb
/tmp 1,024mb
/ 1,024mb
/usr 20,480mb
/home the rest (about 128,670mb)


Does order matter? Should I leave some unallocated? Should they all be ect3? Do I make boot the primary? Do these partitions and sizes look good?
Thanks for taking the time to read this, any help is appreciated.
 
Old 01-18-2005, 12:09 AM   #2
hmc
LQ Newbie
 
Registered: Aug 2004
Location: Denmark
Distribution: Centos, Fedora
Posts: 23

Rep: Reputation: 15
High availablility configuration for a web server using RAID 1

Hi,

You mention that you have a 160 GB and 2 x 120 GB disks. You also say that you intend for this to be a Web serber/DNS and for it to also provide you with data store (/home) and desktop environment.

Okay, so first you need an external backup system! Think about this and work out how you will do it.

As for the system, I would use RAID 1 mirrors for /boot, /, /var and swap across the two 120 GB disks. Each disk on a separate IDE loop (I'm assuming that you are using IDE). So, you have /dev/hda and /dev/hdc. As for sizes, /boot and swap 0.5 GB, / 16 GB or more, and /var lots of space as that is where your web sites will be (/var/www), and your databases (/var/lib/[mysql|postgres]).

I recommend having /home on the / partition (i.e not a partition of its own) for the local users, and to have your own 'home' and data space on the 160 GB disk (not in RAID) of whatever size you desire. (You can do this later by mounting the 160 GB disk somewhere and setting you user's home directory to be under that mount point).

The motivation is that if you loose /dev/hda or hdc the system will continue to run. Everything that is critical is on a RAID 1 partition (/, /var and swap).

When setting up the RAID. Choose manual disk partitioning and make each 'linux software RAID' partition. Bind them together to make the RAID 1. Fedora will want /boot as the first file system, and / as the second, it will then make /var the third and swap the fifth (the extended partition will be automatically created as the forth to hold the fifth).

I like to have /dev/md1 composed of /dev/hda1 and /dev/hdc1, same with md2 = /dev/hd[ac]2, ...
But, the installer will move stuff around underneath you so you have to be watchful! It can be a bit frustrating, so I advise to do it a few times with just the 'minimal packages' install until you are happy with the way the disk system is created. (Add the 160 GB disk later, just get the hang of the mirroring first).

Regards,

Hugo
 
Old 01-18-2005, 09:59 AM   #3
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Original Poster
Rep: Reputation: 0
This is a completely different setup than what I had described. And that is cool, I just don't understand some of the reasoning behind it. As for the data that I want to backup, I was planning on having it as the only thing on the 2x120gb mirrored raid array. That kind of took it out of the picture. There is no real external backup planned, since this is the external backup. I will make use of Subversion to keep a copy of everything that is important on these mirrored drives, and then preiodically I can back that up to a cd or dvd. I am way more worried about this data than things like the operating system that can be reinstalled, that is why it seems like the obvious choice to mirror. then I was going to use the whole 160gb just for the operating system and programs and such. This made sense to me anyway. But I am not sure what the mount point should be for the data. I hadn't really thought of it being my /home, that is more for personal stuff related to that computer. I was just thinking of havign it mounted as /data or something, the data contained on it won't actually be used directly, an instance of it will be accessed by Subversion. Also, the 160 gb drive is ide, but the two 120gb drive are SATA. They are on a Promise FastTrak S150 TX2plus card. I can't make the driver for the card work in linux so I was just going to use the linux software raid on it.
Most have said that they only need 1gb of /var, how much do you suggest. I've read that it is just for logging, and you should separate it on a server to avoid some dos attacks. But according to you it is more important, and needs more space. I don't know how to estimate somethign like this.
Thanks for the comments.
 
Old 01-18-2005, 11:33 AM   #4
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
When you plan your backup strategy, have a look at the possible reasons for damage, eg hacking, hardware etc, and then decide which files to replace with new ones, and which ones to just transfer. Keep very fresh copies of the last ones, and several historical copies to avoid only having a copy of a damaged set..
The usual files to replace are the operating system, and the most valuable are the ones you have to create yourself, configs, scripts, data etc.

This may direct you to keep scripts & config in /etc
and a kernel with modules in /lib (if it's a custom patched job with iptables etc)
Everyones data, homes & logfiles can live in /var

So this way, /var would be quite large.

You would need space to keep a history of backups in order to compare files, data etc with known good ones. Keep a script running to compare files that shouldn't change, and if everything's ok, they can be deleted from the history.

I would take hmc's suggestion and have 2 disks in RAID1 as mirrors and the third as the history..
I would however only mirror the data, scripts, kernel partitions etc rather than the whole system.
Have a bootable system on the third disk and only mount the data partition for backups.
This will give you a clean system to boot with while you check the history for corruption.
 
Old 01-19-2005, 02:06 AM   #5
hmc
LQ Newbie
 
Registered: Aug 2004
Location: Denmark
Distribution: Centos, Fedora
Posts: 23

Rep: Reputation: 15
Disk system layouts

Hi,

Nice to see some lively discussion. I have a few comments to add.

The primary motivation behind my suggestion is to allow the sytem to continue to operate should one of the SATA drives, or the IDE drive fail. Thus if you put the essential things on mirrors across the SATA disks you will have this protection. This is the 'high availability' aspect.

Using the IDE drive to backup the mirror is a good plan. Note that mirroring does NOT protect against file deletion, only disk failure.

The reason that I suggest allocating much space under /var is that on FC3 your web sites will live under /var/www, and your database(s) under /var/lib (by default). This can be changed, of course, but these are the defaults.

One has absolute flexibility about where one decides to put homes and data, and one can mount partitions anywhere.

A last note. The simplest possible configuration using a RAID 1 mirror on the SATAs and the IDE as a separate (not mirrored system) would be:

/boot (512 MB), swap (512 MG), / (the rest) on the SATA drives, and
the whole of the IDE as another rather large single partition.

The concept of 'best' is a little hard to define here. It is not always easy to merge simplicity, flexibility, efficiency and availability.

Regards,

Hugo
 
Old 01-19-2005, 05:43 PM   #6
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Original Poster
Rep: Reputation: 0
So how big should I make /var. Or should I just put the web and db stuff somewhere else, and if so where. Should /home be my biggest partition. I was really hoping for more information about what partitions to use, and how big they should be. I keep hearing to back up stuff other than my data on the mirrors which just seems strange to me.
Thanks
 
Old 01-20-2005, 03:09 AM   #7
hmc
LQ Newbie
 
Registered: Aug 2004
Location: Denmark
Distribution: Centos, Fedora
Posts: 23

Rep: Reputation: 15
Some more specific suggestions

Hi,

You mention web serving, mail, dns and a data store for your personal files.
Additionally, you may use it as a desktop environment while the load is light, and that you may do some development work on the system (I presume that source files stored via cvs will the data volume for this).

Of the above, web, mail and dns will all (by default) have their data storage under /var (on FC3). Also, the user home area will be under /home. You can put the cvs repository wherever it suits you.

You have the two 120 GB SATA drives for mirroring and the 160 GB drive to use for backup and to extend the mounted file systems if required.

The following paritions should be made on both drives and mirrored (RAID1):

swap 512 MB
/boot 512 MB

Then you have some choices. The simplest solution is to make on single mirror for / which uses the rest of the SATA disks. This is not such a bad suggestion. Many would suggest to separate / and /var, and possibly / and /home, but there is not much advantage in this. By using just one parition you provide the maximum available space to be used by /, /var and /home as it is required. If space is running out you could transfer the least important area to a resrved spare area on the 160 GB disk (of course, when you do this lose the mirroring support).

As for the 160 GB disk, I would make a 120 GB partition to serve as the backup location for the / mirror on the SATA drives. This leaves you with 40 GB to deploy as required. Ensure that you do *NOT* make a single partition from the 160 GB disk or you will leave yourself with no flexibility at all!!!

Next, what would I back up? Everything. The most important for backup are: /etc, /var, /home, but I would also backup /usr and /lib as they will only add a few GB to the total, and by doing so you can restore the entire system if needed. Alternatively, you can make the backup system write the files directly, in which case no restoration is required and you can boot the system directly off the 160 GB disk. Personally, I would not do this. You already have a mirror and this should be protecting you. The backup system is just to protect yourself from user error.

Hope all this rambling is of some assistance.

Regards,

Hugo
 
Old 01-21-2005, 09:32 PM   #8
crowmobe
LQ Newbie
 
Registered: Nov 2004
Location: Huntsville, AL
Distribution: Fedora Core 3
Posts: 13

Original Poster
Rep: Reputation: 0
I'm not sure why I would separate / and /home. Mainly because I see it done that way a lot. I did read that you should separate /var because it is easy for someone to launch an attack and fill up your logs, and this keeps that from happening. Was this misinformation.
I'm not really interested in backing up anything except for the configuration files that I have to make. Other than those, I can just do a reinstall if I need to.
I plan to have several repositories using subversion. It is a replacement for cvs. I plan to back up my configuration files with this as well as code, music... One of the big advatanges to subversion is how it can save incremental changes to binary files just like text files.
 
Old 01-23-2005, 03:07 AM   #9
hmc
LQ Newbie
 
Registered: Aug 2004
Location: Denmark
Distribution: Centos, Fedora
Posts: 23

Rep: Reputation: 15
In my suggestion above I am suggesting that you use only one main partiion (/boot, swap and /). No separation of /, /home and /var. But that is just the simplest solution.

You back up what you want to! :-)

I'd notived your comment of subversion and came across some mention of it on my web travels. I must look into it. I'm an old RCS/CVS user, and it would be nice to have a version control system that can handle binaries.

Finally, I do recommend doing a few practice installs of 'Minimal', just to get used to the way the FC3 installer does the file system/RAID setup. It moves things around underneath you, which is a little annoying. I like to keep the partition numbers and md device numbers in order, like /dev/md<N> = /dev/hda<N> and /dev/hdb<N> to simplify maintenance of the RAID system. The installer will move the partitions around and you may have to shuffle the md device numbers to keep it all in order (if you care! ;-).

Have fun,

Hugo
 
  


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
Ideal postfix setup for 800 users vlad-the-emailer Linux - Software 0 11-06-2005 07:43 AM
Ideal Partition Setup Question AxXium Linux From Scratch 7 06-17-2005 03:15 PM
what's the most ideal FTP server for.....? servnov Linux - General 8 11-21-2004 01:31 PM
Setup a linux server, DNS, WEB, FTP, and Mail Server Help watermelon_lee Linux - Networking 1 08-26-2003 03:09 AM
Ideal Linux Server Config, suggestions ? EmbeddedWannabe Linux - General 1 03-16-2003 12:19 AM


All times are GMT -5. The time now is 02:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration