LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-01-2010, 03:26 PM   #1
bbking
Member
 
Registered: Oct 2004
Distribution: SuSE 9.0 & SuSE 10.0
Posts: 40

Rep: Reputation: 15
Unhappy mdadm troubles


Hey there,

I have some issues going on with my raid system. When I set up Ubuntu 10.10 I had only one hdd around so I installed my system with the idea that I will add the 2nd hdd for raid1 later on.
Last weekend I wanted to add the hdd, but discovered, that ubuntu created a raid0 array.

So I went on and tried different things: removing the 1st hdd from the raid0 array, create a raid1 with two disks, and so on...
I finally could syncronize both disks but after a reboot the raid0 array appeared again with only one disk. Now I know, I should have written the mdadm.conf and fstab files...

My last tries resulted in a missing superblock. Here is the story:
Code:
    mdadm -S /dev/md0
    mdadm --zero-superblock --force /dev/sda1
    mdadm --zero-superblock --force /dev/sdb1
    sfdisk /dev/sda
    sfdisk /dev/sdb

Code:
root@sysresccd /root % sfdisk /dev/sda
Quote:
Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 120851- 120852- 970737664 83 Linux
/dev/sda2 120851+ 121601- 750- 6022145 5 Extended
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 120851+ 121601- 750- 6022144 82 Linux swap / Solaris
Code:
root@sysresccd /root % sfdisk /dev/sdb
Quote:
Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sdb1 * 0+ 120851- 120852- 970737664 83 Linux
/dev/sdb2 120851+ 121601- 750- 6022145 5 Extended
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
/dev/sdb5 120851+ 121601- 750- 6022144 82 Linux swap / Solaris

Code:
    mdadm --create /dev/md0 --level=1 --raid-devices2 /dev/sda1 /dev/sdb1
Quote:
mdadm: /dev/sda1 appears to contain an ext2fs file system
size=970737600K mtime=Mon Nov 29 02:06:03 2010
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: /dev/sdb1 appears to contain an ext2fs file system
size=970737600K mtime=Mon Nov 29 01:33:13 2010
Continue creating array?

Code:
    y
Quote:
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

Code:
    root@sysresccd /root % mdadm -D /dev/md0
Quote:
/dev/md0:
Update Time : Mon Nov 29 22:15:37 2010
State : clean, resyncing
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Rebuild Status : 0% complete

Name : sysresccd:0 (local to host sysresccd)
UUID : 52ff37b3:0ae4fa37:7864ad4d:38baebd5
Events : 0

Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
Code:
 root@sysresccd /root % mount /dev/md0 /mnt/backup
Quote:
mount: /dev/md0: can't read superblock
Code:
root@sysresccd /root % xfs_repair -n /dev/md0
Quote:
Phase 1 - find and verify superblock...
bad primary superblock - bad magic number !!!

attempting to find secondary superblock...
.................................................................................................... ....
..................................................Sorry, could not find valid secondary superblock
Exiting now.
Code:
    root@sysresccd /root % xfs_db /dev/md0
Quote:
xfs_db: /dev/md0 is not a valid XFS filesystem (unexpected SB magic number 0x00810000)
Code:
 root@sysresccd /root % xfs_db /dev/sda1
Quote:
xfs_db: /dev/sda1 is not a valid XFS filesystem (unexpected SB magic number 0x00000000)
Code:
root@sysresccd /root % xfs_db /dev/sdb1

Quote:
xfs_db: /dev/sdb1 is not a valid XFS filesystem (unexpected SB magic number 0x00000000)

Is there a chance to restore at least one of the disks? Or shall I go straight forward to ddrescue / dd_rescue + dd_rhelp and see what I can get back?

Thanks a lot in advance...!
 
Old 12-05-2010, 04:13 AM   #2
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Hi,

is there any reason why your partitions are type "83 Linux" and not type "FD Linux auto raid"?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 04:42 PM
unable to load MDADM module BUT mdadm works?!?!?! alirezan1 Linux - Software 2 09-08-2008 07:58 PM
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 11:47 AM
troubles with SATA, troubles with NVIDIA aevangelica Linux - Hardware 6 10-17-2005 02:39 AM
do you know mdadm? Coldburn Linux - Newbie 1 08-31-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration