Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recovering data from busted RAID1 [Solved]
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
gr0x0rd
Guru
Guru


Joined: 12 Aug 2006
Posts: 301

PostPosted: Fri May 30, 2014 2:38 pm    Post subject: Recovering data from busted RAID1 [Solved] Reply with quote

Long story short, a brief power outage / surge my UPS couldn't handle did something very odd to my system: after a few minutes, I was no longer able to run any privileged commands. I was able to get by for a week or so by opening a root terminal after booting, and tried doing a world update- it had been years since I'd done this (system was brilliantly stable) and compiling a new kernel, but started to run into some issues as root as well. Even as root, I could no longer issue certain commands, including reboot/shutdown. Finally, after hard booting, my system would hang while initializing networking. It was time to rebuild.

My data was in a RAID1: no problems there. I disconnected one of the drives and got to work on the other: zero'd the superblock, and followed the new version of the Gentoo Handbook to put together a new system with ext4, grub2, and other fancy things that weren't defaults the last time I build a Gentoo system. Before long I had a working Gentoo system again, hooray! Next step: mount my busted RAID1 and recover my data.

After connecting the other drive and booting the system, here's the situation:
Code:
# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] [raid0] [raid10] [linear] [multipath]
md125 : inactive sdb3[0](S)
      233315840 blocks
       
md126 : inactive sdb2[0](S)
      1048512 blocks
       
md127 : inactive sdb1[0](S)
      65472 blocks
       
unused devices: <none>
OK. So, let's start things up.
Code:
 # mdadm --assemble --scan
mdadm: No arrays found in config file or automatically
The linux RAID wiki suggested using the force switch:
Code:
# mdadm --assemble --force /dev/md125
mdadm: /dev/md125 not identified in config file.
Grrr. Some googling showed a few other options, such as mounting as a loop device. When I created this array it was using the 0.9 metadata, since the old versions of grub couldn't read 1.1 metadata and later. This meant no offset, or so I understood it.
Code:
losetup --find --show --read-only /dev/sdb3
/dev/loop0
Code:
# fsck.ext3 -n -v /dev/loop0
e2fsck 1.42.7 (21-Jan-2013)
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/loop0: clean, 643254/14589952 files, 26333650/58328960 blocks
So far so good...
Code:
mount -o ro /dev/loop0 /data
mount: unknown filesystem type 'linux_raid_member'
Argh. This looks like the same result I'd get if trying to mount /dev/sdb3 directly.

Any suggestions as to how I might bring my array back up so I can get at my data?

Thanks for the advice as always.
_________________
~g
emerge -FML...


Last edited by gr0x0rd on Fri May 30, 2014 3:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
gr0x0rd
Guru
Guru


Joined: 12 Aug 2006
Posts: 301

PostPosted: Fri May 30, 2014 3:01 pm    Post subject: Reply with quote

Nm, I figured it out. I had to stop the arrays
Code:
mdadm --stop /dev/md12{5|6|7}
Then reassemble via
Code:
mdadm -A /dev/md0 /dev/sdb3 --run
After that, I was able to mount read-only to my /data folder
Code:
mount -o ro /dev/md0 /data
.

Cheers...
_________________
~g
emerge -FML...
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