LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Broken mdadm RAID0 array, but data is there, only can't mount it. (https://www.linuxquestions.org/questions/linux-software-2/broken-mdadm-raid0-array-but-data-is-there-only-cant-mount-it-4175495551/)

trancephorm 02-19-2014 04:24 PM

Broken mdadm RAID0 array, but data is there, only can't mount it.
 
TL;DR; complete RAID0 array data on both disks is most probably still there, it's only that something little is broken with /dev/sda member so I can't mount raid array anymore, /dev/sdb should be intact, but read on... pls... :)

I messed up...:( Plugged in new USB external disk and did not pay good attention which drive I'm formatting. Size of the drive I wanted to format is the same as size of /dev/sda disk that is member of /dev/md0 raid0 mdadm array...

So I tried to format /dev/sda instead of /dev/sde and some kind of error showed up, the moment I saw it I realised what I did, and I was thinking then ok, I can say goodbye to data because I formatted the member of raid0 array, but it's not how it turned out to be: seems like gparted didn't touch the data, but just the partition table. All in all - I was still able to access the data, so I was thinking ok, everything is alright, gparted throwed an error - actually did not do any damage.

Even if I was able to access data, after a reboot, md0 raid partition couldn't be mounted, so I can't access data anymore... can't mount raid array.

I feel this can be solved with just few lines... Any data and logs you may need, please ask, will provide it gladly.

Thanks!

trancephorm 02-19-2014 04:59 PM

cat /etc/mdadm/mdadm.conf gives:
ARRAY /dev/md0 metadata=1.2 name=mm:0 UUID=35cf5ffd:b1f550da:189c2d40:7138e5f9
MAILADDR root

-------------------------------------------------------
mdadma --examine --scan gives:
ARRAY /dev/md/0 metadata=1.2 UUID=35cf5ffd:b1f550da:189c2d40:7138e5f9 name=mm:0

-------------------------------------------------------
cat /proc/mdstat gives:
Personalities : [raid0] [linear] [multipath] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid0 sdb1[1] sda1[0]
3907025984 blocks super 1.2 64k chunks
unused devices: <none>

-------------------------------------------------------
Excerpt from dmesg:
[ 3.555436] udevd[138]: starting version 175
[ 3.687737] md: bind<sda1>
[ 3.736762] md: bind<sdb1>
[ 3.738136] Disabling lock debugging due to kernel taint
[ 3.738258] md: raid0 personality registered for level 0
[ 3.738452] md/raid0:md0: md_size is 7814051968 sectors.
[ 3.738460] md: RAID0 configuration for md0 - 2 zones
[ 3.738461] md: zone0=[sda1/sdb1]
[ 3.738465] zone-offset= 0KB, device-offset= 0KB, size=3907024896KB
[ 3.738466] md: zone1=[sda1]
[ 3.738468] zone-offset=3907024896KB, device-offset=1953512448KB, size= 1088KB
[ 3.738469]
[ 3.738476] md0: detected capacity change from 0 to 4000794607616
[ 3.742087] md0: unknown partition table

-------------------------------------------------------
mdadm --examine /dev/sda gives:
/dev/sda:
MBR Magic : aa55
Partition[0] : 3907027120 sectors at 2048 (type fd)

mdadm --examine /dev/sdb gives this:
/dev/sdb:
MBR Magic : aa55
Partition[0] : 3907025007 sectors at 2048 (type fd)

-------------------------------------------------------
testdisk utility says there are hidden sectors on /dev/sdb, which I think is normal, but it's not the same with sda (which was messed up)

-------------------------------------------------------
mdadm --assemble --scan -v gives:
mdadm: looking for devices for /dev/md0
mdadm: no RAID superblock on /dev/md0
mdadm: no RAID superblock on /dev/sdd2
mdadm: no RAID superblock on /dev/sdd1
mdadm: no RAID superblock on /dev/sdd
mdadm: cannot open device /dev/sr0: No medium found
mdadm: no RAID superblock on /dev/sdc1
mdadm: no RAID superblock on /dev/sdc
mdadm: /dev/sdb1 is busy - skipping
mdadm: no RAID superblock on /dev/sdb
mdadm: /dev/sda1 is busy - skipping
mdadm: no RAID superblock on /dev/sda

-------------------------------------------------------
fdisk -l gives this:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6dcc917b

Device Boot Start End Blocks Id System
/dev/sda1 2048 3907029167 1953513560 fd Linux raid autodetect

Disk /dev/sdb: 2000.4 GB, 2000397852160 bytes
48 heads, 29 sectors/track, 2806772 cylinders, total 3907027055 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6dcc917d

Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907027054 1953512503+ fd Linux raid autodetect


All times are GMT -5. The time now is 08:41 AM.