LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-19-2010, 05:26 PM   #1
ModMaker
LQ Newbie
 
Registered: Nov 2010
Location: Washington, USA
Distribution: Ubuntu, Backtrack
Posts: 8

Rep: Reputation: 0
Reading Raw Filesystems


I damaged my 4GB zip drive while it was plugged in. This caused the file-system to become corrupt. I cannot load it into either Ubuntu or Windows. I need a way to get my data off of it. I can connect it to the computer, but the file-system is not recognized. I have used dd to copy the contents of my device file to an external file, however about 21MB into it, it says:

dd: reading `/dev/sdb': Input/output error
43232+0 records in
43232+0 records out
22134784 bytes (22 MB) copied, 10.4637 s, 2.1 MB/s

It happens the exact same for several tries. I have read the file with a hex editor and I can find the contents of my files, however I still need the rest of the drive. It is OK if I only get the raw hex data from the drive, I can sift through it later, but I need to get the data off of it. How can I get the data off of it? Thanks.
 
Old 12-19-2010, 05:37 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Sometimes, depending on what's causing the error,
using dd with the option:

Code:
conv=noerror
will allow dd get past the error. Have you tried that?
 
1 members found this post helpful.
Old 12-19-2010, 05:47 PM   #3
ModMaker
LQ Newbie
 
Registered: Nov 2010
Location: Washington, USA
Distribution: Ubuntu, Backtrack
Posts: 8

Original Poster
Rep: Reputation: 0
It just posts those lines several times before saying this and quiting:

dd: `/dev/sdb': cannot seek: Invalid argument

It also stops at the same byte every time, except the first time I tried, when it copied almost 250MB.
 
Old 12-19-2010, 07:41 PM   #4
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
OK, if there is a seek error then you might try the option:

Code:
skip=
You use it to specify a number of blocks to skip on the input. For example, in your case, it could be interesting to try a value such as 50000, or other somewhat higher values to see if you can start trying to read data after the spot where you had trouble, around block 43232. You might want to try to that combined with the

Code:
conv=noerror
option.

If all else fails, you might be able to write a little fault tolerant program to try to specifically seek each block on the device, then if the seek is successful, read the block.
 
Old 12-20-2010, 02:46 PM   #5
ifo
LQ Newbie
 
Registered: Dec 2010
Location: Munich, Germany
Distribution: Slackware64 14.2
Posts: 7

Rep: Reputation: 0
You may also be looking for a program like dd_rescue.

I haven't tested (and needed) it yet, but according to http://linuxwiki.de/dd#Defekte_Platte_sichern (in German) and the project website it doesn't just skip defect sections like dd would do with noerror option set (i.e. dd creates a file with missing bytes, the final image is smaller than the original). If you just want to get the raw data this difference may be negligible, though.
 
Old 12-20-2010, 11:50 PM   #6
ModMaker
LQ Newbie
 
Registered: Nov 2010
Location: Washington, USA
Distribution: Ubuntu, Backtrack
Posts: 8

Original Poster
Rep: Reputation: 0
The skip works (ish), I could read my 4GB drive 10MB at a time, however I would like to do it faster. I tried dd_reasue, it doesn't work at all. However it lead to an enlightening error:

dd_rescue: (info) expect to copy 3915776kB from /dev/sdb
...
dd_rescue: (info): read /dev/sdb (10.0k): EOF

So I think that it is stopping because it fopen (which is what dd_rescue uses) says that it is at the end of the file. It may be because it is trying to read the disk too fast. Also, I am getting this text sometimes:

dd: reading `/dev/sdb': Input/output error
0+0 records in
0+0 records out
0 bytes (0 B) copied, 8.9529 s, 0.0 kB/s

Usually it then says that /dev/sdb doesn't exist. After a few seconds, I try again and it will find the file. I usually get the least errors after connecting the device. Any ideas?
 
Old 12-20-2010, 11:53 PM   #7
ModMaker
LQ Newbie
 
Registered: Nov 2010
Location: Washington, USA
Distribution: Ubuntu, Backtrack
Posts: 8

Original Poster
Rep: Reputation: 0
Also, an interesting development. My zip drive has a light on it that flashes when it is being read or written. The first one or two times I try to copy the data, it flashes like it should. However, after a few times, it stops flashing when I try to read the data. It even happens when dd actually gets data.
 
Old 12-21-2010, 04:15 AM   #8
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
There can be various factors that affect a drive access light. Some lights are very fast, reading a single block might almost not make a visible flash at all. While other lights are fairly slow, a single block read can cause the light to be on for quite some time.

Also, Linux tends to make fairly good use of memory. For example, depending on the situation, reading a single block over and over again, might only physically access the device the first time the block is read, but on subsequent reads, the system might just be able to get the block from system memory buffers.

If you haven't already, you might want to check your system messages files to see what the system thinks is happening with the device. On the Linux I'm using, that file is /var/log/messages. It may be elsewhere on other distros.
 
  


Reply



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
Reading the ip address from a packet raw sockets linuxtest Programming 2 12-10-2008 02:43 PM
Linux RAW Video (YUV/RGB) Reading & Transformation amatiman Linux - Software 2 02-03-2006 03:55 AM
reading non-interleaved raw data performance problem James_dean Programming 1 01-26-2006 12:20 AM
reading raw data in to memory whizbit Programming 77 07-07-2005 10:20 AM
Reading raw hard disk sectors villie Programming 4 05-13-2004 12:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:03 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration