Sat 31 Dec 2005
How to restore reiserfs partition from crashed disk
Posted by Anton Titov under Server administration , LinuxFew days ago, a server of mine had all of it’s 4 disk crashed. The problem was that one of the disks was overheating and that seemed to help other harddrives to crash (don’t buy Maxtor).
So, if you have a case like mine - some partitions with reiserfs on hard drive with bad blocks this guide may help you.
Firts try to mount you partition and copy as mouch data as you can. But the chances are, that if you are searching the net for a solution that you cannot mount your partiton and reiserfsck dies, saying you have bad blocks.
First download and install dd_rescue (if you plan to boot from LiveCD while restoring, you can try this statically linked binary dd_rescue binary), as dd conv=noerror will not help - it will not write something instead of unreadable zones which changes drive size and most of the data, that is after the bad blocks will not be restored /or you will have the files, but with garbage in them/. dd_rescue also shows you how much of the disk cannot be copied, which may give you some hope to restore you files, as most of the time you will have just few megabytes or less in bad blocks.
You will need another hard disk with enough free space to copy the whole partition (not only for used space). Now boot from a good hard drive or from LiveCD (Gentoo, Knoppix, Ubuntu, should not matter). Mount the good hard drive with free space somewhere.
Now if your failed partiton is /dev/sda1, and /mnt/disk2 is a place with enough free space run
dd_rescue /dev/sda1 /mnt/disk2/sda1-img
or
/path/to/just/downloaded/from/above/link/dd_rescue /dev/sda1 /mnt/disk2/sda1-img
now find some work to do as this will be slow.
When dd_rescue finishes you may want to make another copy of just copied image if you have enough free space, this most probably will be faster:
dd_rescue /mnt/disk2/sda1-img /mnt/disk2/sda1-img2
Now run
reiserfsck –rebuild-tree /mnt/disk2/sda1-img
if after you type Yes program dies silently try:
reiserfsck –rebuild-sb /mnt/disk2/sda1-img
first.
Now you should be able to mount your partition as:
mkdir /mnt/sda1fixed
mount -o loop /mnt/disk2/sda1-img /mnt/sda1fixed
now go to /mnt/sda1fixed and see what you have.
If you are unlucky most of your files will be in /lost+found with strange names. The good news is if you find a directory there, it’s contents will have good names. So you may want to try:
cd /mnt/sda1fixed/lost+foud
find -name some_file_with_not_common_name_that_should_be_in_directory_that_is_important_for_you
with
find -name shadow
you should be able to find your /etc directory.
After trying this, if you-re still missing important data, you can try the above procedure, but with adding -S to reiserfsck parameters:
reiserfsck –rebuild-sb -S /mnt/disk2/sda1-img
but first read reiserfsck man page.
Hope this helped you.
And a piece of advice: backup you data regularly.
June 12th, 2011 at 5:22 pm
hello
really good article. Ready to hear more next week,my blog http://fredrichards.sosblogs.com Many Thanks.
June 13th, 2011 at 10:06 pm
hello
really good article. Ready to hear more next week,my blog http://www.zimbio.com/Wedding+Invitations/articles/4ErXz6GdreH/Adressing+Wedding+Invitations+Envelopes Many Thanks.
June 16th, 2011 at 9:19 am
really good article
I have spent a bit of time going through your posts, more than I should have but I must say, its worth it! http://sherlly071.fotopages.com many Thanks.
June 20th, 2011 at 9:58 am
hello
Hello there just quality post! http://paula11.tabulas.com/ ,i’d a good read.thank you for your article,My problem continues to be resolved.
June 20th, 2011 at 11:05 pm
very helpful
I preferred to thank you for this good article. http://wyxbk.blox.pl/html I by all odds liked every little bit of it
June 21st, 2011 at 8:27 pm
Great
You did a great job! http://denna.sier.no/2011/06/20/ana-diaz-adverse-end-of-the-spectrum/
June 22nd, 2011 at 11:18 am
Great
You did a great job! http://denisse.mojblog.hr/p-an-available-letter-to-victorias-secret/221144.html
June 26th, 2011 at 9:17 am
quality post
I have spent a bit of time going through your posts! http://juningju01.livejournal.com/22109.html ,i had a good read.
June 27th, 2011 at 1:03 pm
Greate
It’s such a great site! http://tyshawnatmills.tumblr.com Great post, I just bookmarked it on Digg.
July 18th, 2011 at 9:07 pm
Great One
I must say, its worth it! My link!http://duffy071.fotopages.com ,thanks haha
August 9th, 2011 at 10:12 am
Great
love your blog, http://fannie.blogtrue.com/ ,Thanks again.
August 13th, 2011 at 1:54 am
Great One
I must say, its worth it! My link, http://www.blog-gratuit.com/amanda11/,thanks haha
August 18th, 2011 at 2:42 am
really
Fat women and girls always worried because of their ugly shaped bodies. http://www.bbhighway.com/blog/9046 , but they can not wear these outwears
September 1st, 2011 at 11:27 pm
very helpful
I preferred to thank you for this good article. http://promdressq.beeplog.com/blog.pl?blogid=214133&o=entry&a=add I by all odds liked every little bit of it
October 21st, 2011 at 9:34 pm
Great
Think I’d go for either the Eye Close or the Sofa Lay.. We’d bring home a few more medals with me on board!. What sport do you think should be there and would you be any good at it?. , http://jtxyl.blogs.experienceproject.com/
December 2nd, 2011 at 5:22 am
quality post
ugg boots uk online love, http://www.elmodenawrestling.com ,thanks ugg