Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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.
High availablility configuration for a web server using RAID 1
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).
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.
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.
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.
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.
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.
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.
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! ;-).