LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   mdadm raid 5 recovery / reassemble (http://www.linuxquestions.org/questions/linux-server-73/mdadm-raid-5-recovery-reassemble-783687/)

Ciesko 01-21-2010 03:03 AM

mdadm raid 5 recovery / reassemble
 
Hi there,
so that's my first post, quite hard to solve I think.

Here's the situation:
- NAS with a Linux embedded OS installed
- 4 500Gb hard drives that's supposed to be in raid 5 managed by mdadm.

What's happened:
I was moving all the docs from the NAS to another HDD via SMB and suddenly it stuck! After that I powered off the NAS, from that moment It seems that mdadm it's not able to find the arrays and mount them..

What I tried:

1. I know for sure that there was 2 arrays one md0 and one md1. If i try

Code:

mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
the result is

Code:

mdadm: no recogniseable superblock
mdadm: /dev/sda1 has no superblock - assembly aborted

2. I looked into my mdadm.conf in the /etc dir and it's just

Code:

DEVICE /dev/hd*[0-9] /dev/sd*[0-9]
3. I tried to mdadm --assemble --scan but since I do not know how to fix the mdadm.conf the error is

Code:

mdadm: No arrays found in config file
4. All the hard disks are showed:

Code:

HYDRA-LAN> fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/sda1              1          22      176714+  fd  Linux raid autodetect
/dev/sda2              23      60785  488078797+  fd  Linux raid autodetect
/dev/sda3          60786      60801      128520  82  Linux swap

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/sdb1              1          22      176714+  fd  Linux raid autodetect
/dev/sdb2              23      60785  488078797+  fd  Linux raid autodetect
/dev/sdb3          60786      60801      128520  82  Linux swap

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/sdc1              1          22      176714+  fd  Linux raid autodetect
/dev/sdc2              23      60785  488078797+  fd  Linux raid autodetect
/dev/sdc3          60786      60801      128520  82  Linux swap

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/sdd1              1          22      176714+  fd  Linux raid autodetect
/dev/sdd2              23      60785  488078797+  fd  Linux raid autodetect
/dev/sdd3          60786      60801      128520  82  Linux swap

So the main question is: am I able to reasseble this raid? And if not Am I able at least to mount the single partitions and recover my data?

Thanks a lot

Update

What if I edit my mdadm.conf with

Code:

DEVICE  /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
ARRAY /dev/md0 level=raid5 num-devices=4

DEVICE  /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
ARRAY /dev/md1 level=raid5 num-devices=4


pasha_suse 04-15-2010 12:53 PM

Hey... I am not an expert so be very cautious with what you do on a raid 5 setup as you might lose your data. To reassemble those arrays you will need a little more information for instance what your /proc/mdstat looks like (cat /proc/mdstat) then I would also run the following command:

mdadm --examine /dev/sda1 (every partition with linux raid type) see which partitions belong to which raid array, what slot they belong it etc, maybe that will give you more information on how it has to be reassembled.

Hope that helps.


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