LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Software RAID 5 - 3 SATA DISKS on CentOS 5.x (http://www.linuxquestions.org/questions/linux-server-73/software-raid-5-3-sata-disks-on-centos-5-x-850427/)

bskrakes 12-15-2010 12:33 PM

Software RAID 5 - 3 SATA DISKS on CentOS 5.x
 
Hi there,

So the other day someone accidentally unplugged a PC which was running our subversion server. This server is running the latest version of CentOS x64, has 3 hard drives configured in software RAID 5. Due to the power going down while the machine was running on reboot the kernel warned of degraded raid array... blah blah blah - nothing good.

So here is some info:

Quote:

cat /etc/mdadm.conf
files does not exist
Quote:

cat /proc/partitions
major minor #blocks name
7 0 110572 loop0
8 0 244198584 sda
8 1 257008 sda1
8 2 243938992 sda2
8 16 244198584 sdb
8 17 244196001 sdb1
8 32 244198584 sdc
8 33 244196001 sdc1
Quote:

cat /proc/mdstat
Personalities: [raid0] [raid1] [raid10] [raid5] [raid6] [raid4]
unused devices: <none>
Quote:

mdadm --examine --scan /dev/sda2
ARRAY /dev/md0 level=raid5 num-devices=3 UUID=(a bunch of stuff here for UUID)
Quote:

mdadm --examine --scan /dev/sdb1
ARRAY /dev/md0 level=raid5 num-devices=3 UUID=(a bunch of stuff here for UUID)
Quote:

mdadm --examine --scan /dev/sdc1
ARRAY /dev/md0 level=raid5 num-devices=3 UUID=(a bunch of stuff here for UUID)
Because there is no mdadm.conf file I cannot start the raid array:

Quote:

mdadm -A -s
mdadm: /dev/md0 assembled from 2 drives - not enough to start the array while not clean - consider force
Quote:

mdadm --assemble --force /dev/sda2 /dev/sdb1 /dev/sdc1
mdadm: no devices found for /dev/sda2
Quote:

mdadm -E /dev/sda2
mdadm: No md superblock detected on /dev/sda2
At this point I am confused... looking for anyone who can help, please and thanks!

bskrakes 12-15-2010 12:40 PM

Sorry the thread title should be "HOW DO I REBUILD Software RAID 5 - 3 SATA DISKS on CentOS 5.x"

ComputerErik 12-15-2010 09:15 PM

I hope you have backups, because if this were me I would be looking to do a restore and get things up and running ASAP. Trying to figure this out as an academic exercise might be interesting (and hopefully is possible) but in a production environment for a source control server I wouldn't want to kill the time trying things which might only make it worse.

My first advice would be to do a backup of everything as is now before playing around and possibly making the situation worse.

chickenjoy 12-15-2010 11:08 PM

have you tried this:
Code:

# > /etc/mdadm/mdadm.conf
# echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
# mdadm --detail --scan >> mdadm.conf

then reboot and the raid setup should be back. make sure to backup your mdadm.conf if there is already one existing.

bskrakes 12-20-2010 11:20 PM

@ComputerErik - I couldn't agree more. I tested our backup and all it well. I also had a second machine up and running. After a couple of days I finally decided just to restore the original server and get SVN re-setup.

@chickenjoy - I did try that, there are several good guides out there but it seems like anything and everything I did would results in an array that didn't want to start. Basically I chased my problem around in circles. So I had no choice but to get the server back up and running. I plan on setting up a virtual machine and breaking it, when I have some down time to do more testing.

GLAD I HAD A GOOD BACKUP PLAN :)

Thank you for the replies!!! Happy Holidays and best wishes!

chickenjoy 12-22-2010 12:28 AM

@bskrakes
thats great. Nothing beats a recent backup.


All times are GMT -5. The time now is 12:48 AM.