Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

is it possible to restore a raid 5 array, previously created using mdadm, after an accidental "--create" command instead of "--assemble" (the goal was to move the array after a system format)

configuration: raid 5 array using 3 hard drives, each with one linux-raid-autodetect partition, array created with mdadm on suse linux enterprise server 10.

share|improve this question
    
As Bart said, just restore from backup. The one you took before playing with HDs, RAID Arrays, and reinstalling the system. –  Chris S Oct 15 '10 at 14:14
    
how exactly can i restore from backup? the hard disk where the previous system was installed is fried beyond repair.. what and how do u mean restore from backup? –  3a2roub Oct 15 '10 at 14:40

2 Answers 2

To my knowledge, without playing with low level disk editing tools to read the drive, the time spent trying to recover it may be better spent or more effectively used restoring from a backup.

You could try running testdisk from a recovery CD/bootable CD, but no single disk will have all the data, so I don't know how it'll handle the information. I suppose you could try just restoring old partition information if it sees it, but there's no guarantee that it won't further screw up the data if it's still there.

Best answer: recover from backup.

share|improve this answer
    
thanks for the advice, sadly there is no backup which is why im trying gparted or any way to restore it. –  3a2roub Oct 15 '10 at 14:26
    
Don't know about gparted, but testdisk might find something. –  Bart Silverstrim Oct 15 '10 at 15:24

If you create RAID with the same configuration, it should work:

(root)# mdadm --create --verbose /dev/md0 --level=5  --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1

(root)# mkdir /raid

(root)# mount /dev/md0 /raid/

(root)# cp /vmlinuz /raid/

(root)# md5sum /raid/vmlinuz 
a36c45658d6bc5371ac432bd0af92a0e  /raid/vmlinuz

(root)# mdadm -S /dev/md0 
mdadm: stopped /dev/md0

(root)# mdadm --zero-superblock /dev/sdb1 
(root)# mdadm --zero-superblock /dev/sdc1 
(root)# mdadm --zero-superblock /dev/sdd1

(root)# mdadm --create --verbose /dev/md1 --level=5  --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1

(root)# mount /dev/md1 /raid/

(root)# md5sum /raid/vmlinuz 
a36c45658d6bc5371ac432bd0af92a0e  /raid/vmlinuz

otherwise, show "mdadm --create" command

share|improve this answer
    
yes, thats how i created it. only when i mount it mount /dev/md0 /mnt it says: you need to specify the filesystem type. i didnt perform mkfs.ext3 or formatted after creating it because i dont want to lose data. now what? –  3a2roub Oct 15 '10 at 14:22
    
try # dumpe2fs /dev/md0... maybe you used LVM? try: lvm vgscan –  bindbn Oct 15 '10 at 14:38
    
dumpe2fs returned bad magic number.. im trying re-creating the array after zero-superblocking the partitions. –  3a2roub Oct 15 '10 at 15:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.