RAID ISSUE: Hard Drive Failure

Hi Guyz,

I have 2 hard drive when I install my FreePBX which is running in Asterisk 11.8.0… RAID works fine, but after a couple of months one of my HDD fails or had become defective. So I install another hard drive to replace the old and defective one. Now I power up my FreePBX once again but when I look into the web console under
Admin\System Admin\Storage

See image below - there is no more sdb and md2 is not showing a green color indicator also…

I also run following command

Now my question is…

  1. How to properly replace a defective hdd in freepbx server with RAID?
    just incase the other hard drive of mine will fail?

  2. What Shall I do next to sync both hard drive?


if sdb >= sda then you can

sfdisk -d /dev/sda|sfdisk /dev/sdb
mdadm /dev/md0 -a /dev/sdb1
mdadm /dev/md1 -a /dev/sdb2
mdadm /dev/md2 -a /dev/sdb3
watch cat /proc/mdstat

(control-c when it’s done)

update-grub /dev/sdb to allow the new drive to boot when sda dies.

Sir Dicko

I am new to FreePBX…and I dont know where to go first or where I will run the command.
Could you help me how to do it step by step?
Both of my hard drive are 1TB each and the first boot is the SATA1 where the freepbx is installed
and my SATA2 is my new hdd.

Thanks a lot

From bash, the screen shot you posted shows you where at it, so the step by step instructions are

Step 1, run the commands I gave you.

oops . . . grub-install /dev/sdb

Here is a step by step guide to rebuild the raid with a new drive.

Sir Dicko… I have followed your instruction please see images below… All I can see right now in my freepbx storage are all sda and i am using 2 TB of Hard Drive. What could be wrong in the command?

your disk was already partitioned with swap at sdb2, to fix

swapoff -a
mdadm /dev/md1 -f /dev/sdb2
mdadm /dev/md1 -r /dev/sdb2

and try over.