?
Solved

Setup a RAID on CentOS 5 without losing data?

Posted on 2010-09-21
6
Medium Priority
?
729 Views
Last Modified: 2013-11-08
Hi Guys,

I have a question about Software RAID on CentOS 5. About a year ago I've setup a CentOS 5 Server and installed a Web hosting control panel DirectAdmin. During my CentOS install I really thought that I’ve already setup the software RAID function but it was my first time doing it and I sort of misread a part of the instruction. I don't have a hardware RAID controller at this moment but I can implement it if it is a better solution.

The server has 4 500 GB Hard Drives and I would like to have a mirror RAID over all of them.

Is there a way to do this without loosing all the current data on the server (databases, files, emails ,...)?
Would a hardware RAID controller be easier to achieve this?

I'm looking for a solution with minimum server down time and to be as easy as possible.

I've attached the image of the current file system (i think one Hard Drive is still unallocated). I've followed the suggested /tmp /var /usr /home /boot setup that is described in the DirectAdmin support, but I’ve obviously messed up with the raid as it became a partition.

This is the current partitioning of the system
Thank you for all your help.
 
0
Comment
Question by:xNejX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 79

Expert Comment

by:arnold
ID: 33725573
Software raid you seem to have one /dev/md0.

Software raid has to be setup in two parts.
you first have to create a partition of about 100MB which will be the /boot

A hardware raid is better. note some SATA/ATA type of built-in type raids are referred to as fakeraid since they rely on the system's CPU for processing.

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-raid-config.html
0
 

Author Comment

by:xNejX
ID: 33726380
If I do this will I loose all the files on it? How can I ensure a proper and complete backup of the system?
0
 
LVL 79

Expert Comment

by:arnold
ID: 33726703
Yes if you will do this you would lose files.

One option if you have space left, is to create a raid group on the free space of each drive
i.e. and then LVM?mount the item over /mnt
then you go into /boot and run find . | cpio -pdvmu /mnt
What this will do is will allow you to use grub to now point to the new location for the /boot.
And then you would repeat the same thing for each group to transition.

You would essentially have to copy using CPIO a partition at a time and then alter the fstab to mount the new one instead of the old one.
i.e. instead of /dev/sda1 /boot
you will have
/dev/mapper/VolGroup01-LogVol00 /boot
instead of
/dev/mapper/VolGroup00-LogVol00 /
/dev/mapper/VolGroup01-LogVol01 /

But this process requires that you have enough space to go through this process.  The same exists for the SWAP.

At this point you have 900GB for /home

If you can trim/resize it down to 150GB it would leave you enough manuvering room to create the various raids while freeing up the used space.

Note make sure that you can boot the system with the RAID groups as the mounted partition before deleting the old partitions to free up space.

http://www.linuxquestions.org/questions/linux-newbie-8/setting-up-software-raid-1-after-install-296557/

0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 19

Expert Comment

by:jools
ID: 33732598
this is just offered as a suggestion, arnold's suggestion is equally valid.

> I don't have a hardware RAID controller at this moment but I can implement it if it is a better solution.
Some would say so, however, software RAID is easy to manage and good enough for most server uses but I guess it depends on what you are using the server for. With heavy I/O it may suffer.

If it were me (and I've just reorganised my server) I'd organise some maintenance down time and do a full backup to another hard disk then reinstall from scratch, I found (at least im my case) it was easier to start from the install and restore than to move chunks of data about ad-hoc.

You would need to create two raid arrays, md0 at about 200MB using two partitioned disks and then you could create another raid 1 array using the remaining space, if you wanted the flexibility of using lvm then create a raid 1 using the other disks and then create an lvm vg on the raid array.

Example layout used on one of the systems I use is attached, I only have 2 x 500GB disks but you should see what it's doing.

raidinfo.txt
0
 
LVL 19

Accepted Solution

by:
jools earned 2000 total points
ID: 33732776
Sorry, forgot to include the disk partitioning as an example...
diskpart.txt
0
 

Author Closing Comment

by:xNejX
ID: 33760893
Thank you for your advice.
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question