Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to restore superblock for raid?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
richis
n00b
n00b


Joined: 10 Feb 2004
Posts: 20

PostPosted: Tue Aug 08, 2006 2:07 pm    Post subject: how to restore superblock for raid? Reply with quote

Hi,

I have messed up with my software raid. After trying to fix some problems I entered such commands:
mdadm --zero-superblock /dev/hdc1
mdadm --zero-superblock /dev/hdb1

Is there any way to restore superblocks? (badly need data from raid)

before problem I used raid-tools and here is config:
/etc/raidtab
Code:

raiddev /dev/md0
        raid-level      0
        nr-raid-disks   2
        chunk-size      256
        persistent-superblock 1
        device          /dev/hdb1
        raid-disk       0
        device          /dev/hdc1
        raid-disk       1



btw the problem I tried to fix was after mounting md0 I can only read data but cant write (df show 0 bytes free)

thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54817
Location: 56N 3W

PostPosted: Tue Aug 08, 2006 2:31 pm    Post subject: Reply with quote

richis.

A persistant superblock is not required to read the raid.
Since you used raidtools, sitch with it, don't mix and match.

Does
Code:
raidstart /dev/md0
work to get your raid up?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
richis
n00b
n00b


Joined: 10 Feb 2004
Posts: 20

PostPosted: Tue Aug 08, 2006 4:24 pm    Post subject: Reply with quote

raidstart /dev/md0
/dev/md0: Invalid argument

here is log from dmesg:
Code:

Aug  8 22:24:58 stone md: invalid raid superblock magic on hdb1
Aug  8 22:24:58 stone md: hdb1 has invalid sb, not importing!
Aug  8 22:24:58 stone md: autostart failed!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54817
Location: 56N 3W

PostPosted: Tue Aug 08, 2006 4:39 pm    Post subject: Reply with quote

richis,

Edit your raidtab, change persistent-superblock 1 to persistent-superblock 0 and try again.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
richis
n00b
n00b


Joined: 10 Feb 2004
Posts: 20

PostPosted: Tue Aug 08, 2006 4:50 pm    Post subject: Reply with quote

already did, still the same
Back to top
View user's profile Send private message
BlinkEye
Veteran
Veteran


Joined: 21 Oct 2003
Posts: 1046
Location: Gentoo Forums

PostPosted: Fri Aug 11, 2006 12:12 am    Post subject: Reply with quote

does
Code:
ls -l /dev/md*

list some raid devices?

if not, recreate them with
Code:
cd /dev && MAKEDEV md

and try again.
_________________
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Back to top
View user's profile Send private message
richis
n00b
n00b


Joined: 10 Feb 2004
Posts: 20

PostPosted: Sun Aug 13, 2006 8:32 am    Post subject: Reply with quote

/dev/md0 is still there =)

I think I have done some bigger mistake. In smoe forums I found that I have to recreate partition table on disks.
And I have done fdisk on both disks (removed partitions and created them).

Is this end of my data on disk? =(
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54817
Location: 56N 3W

PostPosted: Sun Aug 13, 2006 8:50 am    Post subject: Reply with quote

richis,

Provided you only changed the partition table for primary partitions, you can change it as much as you like, as long as you put it back the way it was, you data is still there.

Its more complex with the extended and logical partitions, since every time they are created or destroyed, one sector is written to the disk.
Overwriting what is there, with the same partition information is harmless. Changes will begin to destroy your data.

Get testdisk and scan for partitions - you may be lucky.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
richis
n00b
n00b


Joined: 10 Feb 2004
Posts: 20

PostPosted: Sun Aug 13, 2006 5:23 pm    Post subject: Reply with quote

thanks for tool name, but still problem with testdisk.

here is report. Any other way to recover this "big" partition?

Code:

TestDisk 5.9-WIP, Data Recovery Utility, August 2005
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hdb - CHS 238216 16 63 - 117246 MB

Check the harddisk size: HD jumpers settings, BIOS detection, OS limitation...
The following partition can't be recovered. The harddisk seems too small!
     Partition               Start        End    Size in sectors
D Linux                    0   1  1 397002   3 34  400178176
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54817
Location: 56N 3W

PostPosted: Sun Aug 13, 2006 5:32 pm    Post subject: Reply with quote

richis,

If the disk was given over to a single primary partition, using all the space, simply recreate it with fdisk and everything comes back. Even if it wasn't, you can always get the first primary partition back that way, which looks good for /dev/hdc1 etc.

If you do that and there were further partitions, make sure any mounts you attempt are read only.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum