Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Get data from unmountable reiserfs partition
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
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Sun Jun 08, 2003 9:15 am    Post subject: Get data from unmountable reiserfs partition Reply with quote

Short story
I have a damagad sector on my hda. The sector occurs to be on hda1, where my / partition is. So I can not mount it. I need to get back the data there anyway!
All other partition works, storage, music and so on. But root is dead! How can I get back the data there without mounting the partition?
A bit longer story
Damaged sector on my IBM Deskstar 60 GPX 41 Gb. Hitachi's (they merged with IBM's harddrive section) tool for checking the disk (DTF) reports that sector 0x00BBC0 is damaged. The disk sounds something like "krrr krrr krrr /pause/ krrr krrr krrr /pause/" and so on. It's surely a phisical error - it occured after only 2 years of usage...but I read on other forums that a lot of people have this problem with 60gpx and 75gpx.
Well, I know that only ONE sector is damaged! That should let me access the other sectors on the partition. But, unfortunately, it seems like one of the first sectors, needed when mounting, is damaged. I can't even mount it from LiveCD (althougt other partition, as mentioneded above, are mountable).

Some output, this is from mount:
Code:
hda: dma_inir: status=0x51 { DriveReady SeekComplete Error }
hda: dma_intr: error=0x40 { UncorrectableError }, LBAset=15204415, sector=15204352
end_request: I/O error, dev 03:01 (hda), sector 15204352
sh-2029: reiserfs read_bitmaps: bitmap block (#1900544) reading failed
reiserfs_read_super: unable to read bitmap

And this is from fsck.reiserfs (quite similar):
Code:
Will check consistency of the filesystem on /dev/hda1
and will fix what can be fixed w/o --rebuild-tree
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):###########
reiserfsck --fix-fixable started at Sun Jun  8 12:00:52 2003
###########

The problem has occurred looks like a hardware problem.
Check your hard drive for badblocks.

bread: Cannot read the block (1900544).

It seems hopeless, doesn't it?
But since ReiserFS and Linux is so great, there should be a way to access data on unmountable partition, right?
Please, help me! It's *extremly* important. I need to get back my /home/jacob !
Cheers,
Jacob
P.S. As you noticed I was soooooo stupied and had home on root partition. I'll *never* do it again! But here's something even more stupied (if possible): I acctually had backup on my whole home dir. And guess where I put it? /root/backups ...... No comments.....
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
marshall_j
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2003
Posts: 98
Location: NZ

PostPosted: Sun Jun 08, 2003 11:29 pm    Post subject: Reply with quote

You might be able to copy it using the DD command (man dd to get the useage)

Something like
Code:

dd if=/dev/hdx of=/mnt/datalocation bs=1024 count=1024

where count is the size of the data to be copied. good luck :)
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Jun 09, 2003 7:59 am    Post subject: Reply with quote

Good, I will try it. But bsize is block size, right?? And if memory servers me correct, I use 4kb blocks, not 1. So should I change 1024 to 4192?
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Jun 09, 2003 8:02 am    Post subject: Reply with quote

And one more thing. You say that "count is size of data to be copied". Does that mean that dd will (in this case) only copy first kilobyte on the /dev/hdX ?
BTW, Thanks a lot for this suggestion =)
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Mon Jun 09, 2003 8:23 am    Post subject: Reply with quote

OK. First of all, of=/dev/hdaX and not /mnt/something cause if you use /mnt dd will say that /mnt/xxx is a directory.
Secondly, I think that without count=XX it will copy everything, right?
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
hhaamu
Apprentice
Apprentice


Joined: 23 Aug 2002
Posts: 253
Location: Finland

PostPosted: Tue Jun 10, 2003 4:35 pm    Post subject: Reply with quote

qnx wrote:
OK. First of all, of=/dev/hdaX and not /mnt/something cause if you use /mnt dd will say that /mnt/xxx is a directory.


You point dd to a file (even a non-existant will do), not to a directory. In marshall_j's example a file named "datalocation" will be created in the /mnt directory. In that file, you will find the raw data that you may be able to recover.

qnx wrote:
Secondly, I think that without count=XX it will copy everything, right?


Correct. marshall_j's example copies 1024 1k blocks from /dev/hda, so it will copy a total of 1 meg of data from the start of the hda (no specific partition, just the whole hard disk, including the partition table).

qnx wrote:
So should I change 1024 to 4192?


No. The blocksize argument doesn't matter very much, just makes it faster when copying.
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Tue Jun 10, 2003 7:09 pm    Post subject: Reply with quote

Here's what I would try... boot off a cd and mount one of your other partitions just to get some temporary space.

dd if=/dev/damagedpartition of=/mnt/otherpartition/tempfile bs=1024 count=1024 conv=noerror

this will copy the first meg of the partition to the temp file. At this point, check and make sure that the temp file is exactly 1 meg. I'm not sure if dd skips bad sectors or fills them in with nulls (if it skips them, this won't work right, so STOP now if it's not 1 meg)

Now, reverse if= and of= to reverse the order, and copy the meg back.

Why, you ask? because when you overwrite the bad sector, the hard drive will allocate a new sector for it. After that's done, run reiserfsck on the partition, and hopefully it can be fixed.

Also, just to clarify, we want to copy data from the partition, not the actual drive, so it would be if=/dev/hda1 instead of if=/dev/hda if you decide to try this.

good luck
Back to top
View user's profile Send private message
caenus
n00b
n00b


Joined: 03 Jun 2003
Posts: 13

PostPosted: Sat Jul 12, 2003 6:31 pm    Post subject: Reply with quote

I'm currently in a very similar situation and trying to recover some data from a hosed reiser partition. Someone mentioned you can copy certain parts of the bad partition into a temp file and should be able to recover the data from that. Say for example I copied 100mb off the partition into a test file, how would I then recover? Currently I'm trying that read the bad block area into a test file, then write it back so it will reallocate those bad blocks. After it completes, I'll try reiserfsck. Any other recommendations I should do or try? Thanks.
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