LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 11-11-2006, 12:52 PM   #1
mattma
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
Raid 5 XFS FC2 recover disk failure


Hi,

I have a Raid 5 xfs setup with 2 disk gone bad at the same time. I can assemble the array successfully,

mdadm -Afv /dev/md0 -f /dev/hd[ab]1

but I get xfs IO read errors rather quickly when I start to go into the mounted array.

running xfs_repair on the xfs raid array proved unsuccessful because xfs_repair aborts upon an io error.

xfs_repair -v /dev/md0

So installed a blank hard drive and made a disk image with dd

dd bs=256b conv=noerror if=/dev/hdb1 of=/dev/hdd1

(the original array was composed of /dev/hd[abc]1. /dev/hdd1 is the new blank disk

dd encountered 1 read error but completed successfully (or so it seems). However, for some reason, dd doesn't copy the superblock info.

After the dd, I run

mdadm -Av /dev/md0 /dev/hd[ad]1

which gets a no raid superblock found message.

So then I built the array with one of the bad disks

mdadm -Afv /dev/md0 -f /dev/hd[ab]1

and then hot added the new dd'd disk

mdadm -a /dev/md0 /dev/hdd1

This marked /dev/hdd1 as a spare but the info can't be rebuilt because hdb1 will throw up an io error and the raid array will mark hdb1 as faulty rather quickly.

What I need is to get /dev/hdd1 be an *exact* image of /dev/hdb1 then theoretically, I can assemble the array with hda1 and hdd1 and then run xfs_repair on the array and hopefully recover most of the data.

So how can I modify the superblock into manually to make mdadm think the /dev/hdd1 is a disk in the array?

Am I going down the right path or is there another method I should be trying?

I read somewhere that someone used strace to digure out the location of the superblock and used the "skip" parameter on dd to get the superblock into on the new disk.

www dot nabble dot com (slash) Re:-need-help-with-raid6-recovery-p1754352.html

(i apologize for the links - this forum isn't letting me post links yet)

Even though I'm a fairly proficient java developer, I'm hoping I don't have to resort to writing java to rebuild the info like this guy did!

www dot freesoftwaremagazine dot com (slash) articles/recovery_raid?page=0%2C1

Any advice would be gratefully received at this point! Thank you in advance.

-Matthew
 
Old 11-11-2006, 06:12 PM   #2
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Using IDE hard drives in RAID-5 is tricky. First, each IDE hard drive in the RAID array have to be on its own channel or else two drives will seem to crash instead of one. It is likely there is no way to get back your RAID-5 array when two drives fail. Data is lost forever unless you have backups or do not mind spending near $1000 to have a data service fix it for you. Second, built-in cache have to be disabled, so data is not lost when rebooting or powering down. Third, you need to specify hot-spares just in case the drives fail during operation.

I have not used xfs_repair in a long time (2 years). I suggest xfs_repair -n to find out the best way to fix the drives before doing any real fixing. Probably you need to zero the log. I have used xfs_repair with 100% success.

Your dd command will not do a near sector by sector copy. Hard drives are 512 bytes per block, so use bs=512. Also inlcude sync to make sure it reads and writes it correctly as it sees it. The hard drive that you are writing the image to have to be the same model and brand.
 
  


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
Recover files from XFS partition Christof999 Linux - Software 5 07-23-2006 11:47 AM
RAID-5 with multiple disk failure, need help gregerbergman Linux - Hardware 1 03-07-2005 01:25 PM
Hardware raid 5 disk failure notification. rajeshkahara Linux - Hardware 2 02-12-2005 10:21 AM
Boot problem w/FC2 - DISK BOOT FAILURE maugou Fedora 2 06-30-2004 06:37 PM
Software Raid Setup Ok - Reboot fails on disk failure test ikke Linux - General 2 05-11-2003 06:42 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration