Thursday, September 22, 2011

Kicking off with a server rebuild

So I thought I'd kick this off with a server rebuild I'm doing. Have and old webserver that was setup back in 2002-2003 and has been running solid for years. Ran CentOS 4 on it. Problem was, it had minimal disk space in it to begin with (was just put together out of spare parts). As time went on, hard disks got added and new mount points and move data and eventually we ended up with a lot of stuff spread out over a lot of disks in a somewhat random format because not much thought was put into it. So time to rebuild and I figured I'd move to Ubuntu server (I'm not really partial to one version of Linux or another; I move between them pretty easily so it doesn't bother me what its running).  So Ubuntu 11 server here we come.

First was to copy all of the important data off. Obviously backup /var, /etc/, and /home. dumped all of that to a hard drive internally and then pulled it. Stuck it in a USB enclosure and fired it up on a desktop to verify that everything was there. Ok so we're good to go now.

Next was to map out what I wanted as far as drives and add software raid this time around. So I grabbed my box of hard drives and set to work mapping out what it would look like and ended up with this. I have 4 IDE channels in this computer (2 onboard, 2 PCI).

  • sda
    • /boot  (yes I'm old fashioned and still give boot it's own partition tucked away on a separate drive)
    • swap
    • extra space (this can be used to make a quick partition that can be mounted to copy some stuff over to that's not part of the system)
  • md0 
    • 80GB / partition
    • raid10 array of 4x40GB disks
    • each disk is on a different IDE channel
  • md1
    • 80GB /var partition
    • raid1 array of 2 80GB disks
    • each disk is on a different IDE channel
  • sr0
    • cdrw/dvd on one of the IDE channels 
    • after install this may get swapped out for a spare 80GB that could be added to md1 as a hot spare
So after taking some time to map out what I wanted, I'm ready to go. I'd always recommend mapping out before you start. If you want to do raid 1, 5, or 10, make sure you put them on different channels/controllers if possible. It'll help prevent one channel from bogging down while writing. If you have a spare box of hard drives lying around (like I do) you can grab them all out, write their sizes down on small pieces of paper and then on a bigger sheet draw out a map of your setup. Then you can move the small pieces of paper around on your "map" until you get the setup you like. This visualization exercise can help if you have a hard time doing it in your head. Here's my "map"

                    Onboard                                                    PCI
        Primary               Secondary                    Primary            Secondary
Master    Slave         Master       Slave       Master    Slave     Master   Slave

A few questions may arise from why I did what I did with my set. Let me state a few things:
  1. This is only a production system for me personally. I'm not dealing with multiple users. 
  2. /var is more important to me than /home.  this is because no other users are using this server so nothing is really getting stored in /home other than a few tarballs of programs that I may download to install. So this is why it gets its own 80GB setup.
  3. raid10?  cause I have 4x40GB lying around and I figure that making / on that will insure that the system as a whole can come up.
  4. Why no LVM?  that's a whole additional layer of complexity to build LVM on raid. it requires detailed planning and lots of hard drives. Also, I don't for my need foresee needing to add more space  and if I do, I'll need a bigger power supply and a sata card as there are no channels left on the IDEs.
Next time, we'll look at getting her up and running.

No comments:

Post a Comment