LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Rebuilding Mirror for Software Raid 0 on CentOS box? (https://www.linuxquestions.org/questions/linux-software-2/rebuilding-mirror-for-software-raid-0-on-centos-box-4175425588/)

tgaler1 09-04-2012 09:22 AM

Rebuilding Mirror for Software Raid 0 on CentOS box?
 
Linux newbie here. Software Raid 0 Centos 5.4 box. One of the 4 drives on the box had faults, so it needed to be swapped out. I need to use mdadm to rebuild the new disk but i'm not sure exactly how to alter the steps i've seen in a few tutorials to exactly mimic my environment. The tutorial below gives some insight, but it's moreso on how to build the array initially vs rebuild an array once a drive has been swapped.

http://blog.bloke.com/2010/03/create...nd-line-mdadm/

Any help/tips on how to add the new drive into the array?

On boot, the server will get to the point during boot where it "Checking Filesystems" and then it will fail with:

"/dev/md2 clean
/dev/md3 the superblock could not be read or does not describe a correct ext2 filesystem
an error occurred during the file system check. Dropping you to a shell; the system will reboot when you leave the shell
Give root password for maintenance"


cat /proc/mdstat gives the following output:

md0: active raid1 sda1[0]
104320 blocks [2/1] [U_]

md1: active raid1 sda2[0]
8385856 blocks [2/1] [U_]

md3: inactive sda5[0] sdd2[3] sdc2[2]
282113400 blocks

md2: active raid10 sdd1[3] sdc1[2] sda3[0]
67103232 blocks 256k chunks 2 near-copies [4/3] [U_UU]

unused devices: none

Thanks for any assistance on how to proceed.

chrism01 09-06-2012 07:25 PM

Are you REALLY sure you want RAID0 on md3? That stripes all the data across all the partitions with no parity or redundancy ie if one partition breaks, you lose the lot and have to go to a backup to recover.

Basically as described in that link you have to

1. fdisk sda, sdd, sdc and create the partitions (ie the sizes) and set the type to 'fd'
2. run 'partprobe' to force the kernel to accept them without a reboot, or reboot if it won't.
Try
Code:

cat /proc/partitions to check
3. create the raid
Code:

mdadm -C /dev/md3 --level=raid0 --raid-devices=3 /dev/sda5 /dev/sdd2 /dev/sdc2
The rest as per the first code box on that page (adjust disk names/mounts etc).
The first code box is the short version; the rest is a more detailed step by step version.


All times are GMT -5. The time now is 05:08 PM.