LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 06-07-2008, 07:18 AM   #16
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728

Quote:
dd can read about 32 MB of the entire 256 MB and ends with errors. The image contains almost exclusively the pattern of FFs with a few blocks of 00s inside...
Therefore, at least that portion has no pictures in it.

Again, if dd will not read the entire card, I know no other tricks.
 
Old 06-07-2008, 08:21 AM   #17
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Try the noerror,sync options of dd. This will cause it to just keep reading when it finds an error, and it will pad the output file to accommodate those portions of the data that it couldn't read, thus retaining filesize and presumably boundaries etc.

dd conv=noerror,sync if=/dev/sdd of=myoutfileimage bs=512

This WILL force the entire card to be read. Of course, you might just only have garbage there...
 
Old 06-07-2008, 09:22 AM   #18
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by jiml8 View Post
dd conv=noerror,sync if=/dev/sdd of=myoutfileimage bs=512
Thank you jiml8 for the valuable command.

Dd used with the above switch starts to read device without errors up to about 32 MB, then stops for a while, then starts to read large block claiming about errors, then stops for a while etc:

dd: reading `/dev/sdd': Input/output error
63968+960030 records in
1023998+0 records out
524286976 bytes (524 MB) copied, 480.618 s, 1.1 MB/s
dd: reading `/dev/sdd': Input/output error
63968+960031 records in
1023999+0 records out
524287488 bytes (524 MB) copied, 480.618 s, 1.1 MB/s
63968+960032 records in
1024000+0 records out
524288000 bytes (524 MB) copied, 480.644 s, 1.1 MB/s

From the entire 512 MB it read about 512 MB of data in comparison to about 32 MB of output of dd used without any switches.

Final myoutfileimage contains first and foremost null data (the patterns of FFs). From time to time there are small parties of data. For example the first such party starts at offset 0x00030201 and ends at offset 0x00034002, the second starts at offset 0x003381ce and ends at offset 0x0033bfff etc. Before them and between them are the patterns of FFs.

No I go to buy some new xD picture card to test my camera and my card reader, and to compare valid card to invalid one.
 
Old 06-07-2008, 09:51 AM   #19
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
I compared some garbage from the above image to a few valid dscf*.jpg pictures (photos taken with Fujifilm FinePix F30).

The picture should start something like that:

..JFIF..........'.Exif..II*........... ...............................

or something like that:

'Exif..II*........... ..............................................

The first party of garbage starts from:

%~Exif..II*........... ..............................................

(So it starts at the beginning of some picture but it is too short to include complete photo).

The second party of garbage starts from:

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmG..L".yaC.ԩv.?

(So it starts in random place and it is too short to include complete photo).

Etc.

Last edited by w1k0; 06-07-2008 at 10:04 AM.
 
Old 06-07-2008, 10:21 AM   #20
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
YOu might also try it without the sync option. This will remove the output padding and the resulting filesize will be different than the input card size.

You might get more useful information this way, and at a minimum you will know directly how much of the card is considered to be bad.

It would be very interesting if the bad section turns out to be a power of two in size; that would suggest a bad address line in the card (which might be repairable).
 
Old 06-07-2008, 02:24 PM   #21
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
I'm back here. I bought a new xD picture card. There is no in the market 512 MB cards so I was forced to buy 1 GB card.

Smaller cards are better than bigger ones. If small card fails you lose fewer pictures. The recovery of data from smaller cards is cheaper. So it's better to buy four small cards then one big one. Of course I don't take into the consideration the price, but remember: the price of the recovery of data by professional company is a few times higher than the price of the picture card.

Well... My camera works. Mu card reader works. My new card works. So now I need to send my old card to some experts...

***

Thank you jiml8 for the next advice.

# dd conv=noerror if=/dev/sdd of=/rootmyoutfileimagewithoutsync bs=512

dd: reading `/dev/sdd': Input/output error
127968+0 records in
127968+0 records out
65519616 bytes (66 MB) copied, 467.523 s, 140 kB/s
127968+0 records in
127968+0 records out
65519616 bytes (66 MB) copied, 467.571 s, 140 kB/s

# ls -l
-rw-r--r-- 1 root root 524288000 2008-06-07 16:00 myoutfileimage
-rw-r--r-- 1 root root 65519616 2008-06-07 19:07 myoutfileimagewithoutsync

524288000 - 65519616 = 458768384

It isn't a power of two (at least an integer power):

2 ^ 28 = 268435456
2 ^ 28.773190730622518 = 458768384
2 ^ 29 = 536870912

The content of myoutfileimage and myoutfileimagewithoutsync are similar: parties of garbage divided by patterns of FFs.

***

Wow!

***

And now real miracle...

I decided to try the command suggested by jiml8 at the beginning once again...

# dd conv=noerror,sync if=/dev/sdd of=mytwinoutfileimage bs=512
1024000+0 records in
1024000+0 records out
524288000 bytes (524 MB) copied, 142.581 s, 3.7 MB/s

It ended work without errors!

# cmp myoutfileimage rmytwinoutfileimage
myoutfileimage mytwinoutfileimage differ: byte 27137, line 1

An here's the content of mytwinoutfileimage, which in fact isn't the twin of myoutfileimage:

1. FFs from offset 0x00000000.
2. Nice looking data starting a partition ..FF-DSC01.. .......}.?...5...K.....)...............FAT16 .. etc. from offset 0x00006a00.
3. Then various logically looking data.
4. 00s from offset 0x0000ac2c.
5. Then FFs, then 00s.
6. Logically looking data from offset 0x00016600.
7. 00s.
8. Nice looking set of data including phrase .5......100_FUJI ..d..
9. 00s.
10. Nice looking data such as .5......DSCF2254JPG .d.88...8..J..DSCF2255JPG ...88...8b.....DSCF2256JPG.
11. 00s.
12. The first picture %~Exif..II*....... at offset 0x00030000.
13. The consecutive pictures at offsets 0x001a8000, 0x0031c000, 0x00488000, 0x005ec000, 0x00754000, etc.

It's real miracle! I used the same command but the result isn't the same: myoutfileimage was full of FFs with small parties of garbage -- mytwinoutfileimage looks like the image of the device.

I do almost nothing between myoutfileimage and mytwinoutfileimage. In fact I do something. I used card reader with my new xD card. I can't find any other explanation of that miracle.

***

# fdisk -l /dev/sdd

Disk /dev/sdd: 524 MB, 524288000 bytes
17 heads, 59 sectors/track, 1020 cylinders
Units = cylinders of 1003 * 512 = 513536 bytes
Disk identifier: 0xffffffff

Disk /dev/sdd doesn't contain a valid partition table

Yes, of course, I know.

So I try that nice command for the third time...

# dd conv=noerror,sync if=/dev/sdd of=mytripletsoutfileimage bs=512

dd: reading `/dev/sdd': Input/output error
63968+960031 records in
1023999+0 records out
524287488 bytes (524 MB) copied, 471.287 s, 1.1 MB/s
63968+960032 records in
1024000+0 records out
524288000 bytes (524 MB) copied, 471.31 s, 1.1 MB/s

Well... The miracle can happen only once...

I can't to explain it. I simply can't.

# cmp myoutfileimage mytripletsoutfileimage
myoutfileimage mytripletsoutfileimage differ: byte 197122, line 1

How many times I run that command so many times it makes different image. Strange...

***

Now I will try to manage with pretty mytwinoutfileimage.

***

jiml8 you're a genius!

***

To be continued...
 
Old 06-07-2008, 03:33 PM   #22
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
bad connection of the card to the device.

You plugged it in one time and it worked, but it is erratic. You might try cleaning the contacts, or you might just accept that you did get a good dump and go with that, and scrap out that card.
 
Old 06-07-2008, 04:47 PM   #23
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
I removed 27136 bytes of data from the beginning of mytwinoutfileimage, mounted the remain in the file system, and copied 91 photos to hard disk. Bingo!

Not all photos are pretty. 1 displays nothing (that file starts with a block of FFs); 3 have at the edge narrow stripe cut up from the same photo (it's possible to frame them); 7 have more or less wide gray stripe and sometimes additional geometrical distortions (it's impossible to frame them in a reasonable way); 6 have geometrical distortions (they look like cut up into rectangles and stripes, and puzzled together in a strange way); 74 are pretty.

In total: 81% of pretty photos, 3% usable after framing, 6.5% usable if you like strange effects, 8.5% unusable. Good result assuming a few hour ago I had nothing.

I don't think that problem is caused by dirty contacts. My old picture card is clean and my old card reader reads my new card without problems. I think it's a kind of undeterministic bug in my old card. I will try to create a few mytoutfileimages to see the results.

The facts: my old picture card has invalid partition table; in most of cases my card reader can't read entirely my old picture card without errors; if it read it some photos are invalid.

Thank you very much for your assistance, jiml8.
 
Old 06-07-2008, 05:25 PM   #24
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
Well... After a few attempts (between 5 and 10) dd made the second usable image of that drive -- it's a twin brother of mytwinoutfileimage.

Good news: that six pictures with geometrical distortions can be edited and corrected in GIMP. I think it will take between one and two hours of work.

So 9% can be corrected in GIMP. It means 90% are recovered. Very good result.

Last edited by w1k0; 06-07-2008 at 05:41 PM.
 
Old 06-08-2008, 05:09 PM   #25
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I am totally impressed how you stuck with this. Do you realize the percentage that give up at the first roadblock?

So we can all sleep better, please assure us that you won't try to use that card in your camera again. Flash memory simply goes bad after a while, and no amount of tweaking or formatting will change that.
 
Old 06-08-2008, 06:32 PM   #26
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
I took that night the pictures of a few persons. I felt obliged to do everything I could to recover that photos -- not for me but for them.

That particular picture card is logically almost dead. I don't intend to use it for any other purpose than some tests.

Thank you all guys for your assistance. Every your tip, every your hint was valuable. Thank you very much.

Last edited by w1k0; 06-08-2008 at 06:36 PM.
 
Old 06-08-2008, 07:00 PM   #27
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Sometimes persistence pays. I have had to do things like this sometimes to recover stuff off of a dead hard drive. I once found one that would work if I stood it on edge, but not if I laid it flat.

Whatever works. Glad this worked out for you.
 
Old 06-09-2008, 06:07 AM   #28
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
I just called Ontrack Data Recovery department in my country. The standard procedure takes a few days. Expert analysis costs 40 USD; recovering of the data costs from 180 to 550 USD.

The picture card can be damaged logically or physically.

As I said above there is no 512 MB xD picture cards on the market. The price of 1 GB xD picture card is 27 USD.
 
Old 06-09-2008, 10:57 AM   #29
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Your card is damaged physically. The symptoms make that absolutely clear, and if the damage was logical then dd would have extracted everything for you.
 
Old 06-09-2008, 01:27 PM   #30
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by w1k0 View Post
The picture card can be damaged logically or physically.
The above general remark about picture cards I referred to pixellany, who wrote in #13:

Quote:
Originally Posted by pixellany View Post
I don't know what "hardware repair" you have in mind for a solid-state device, but I wish you the best of luck.
He was doubt the picture card can be physically damaged. I asked the guys from Ontrack and they said it can.

***

As for my picture card I thought so far it's logically damaged, because I could read data using software methods. Now I think you're right, jiml8. It explains strange, non-logical behavior of that card.

Last edited by w1k0; 06-09-2008 at 01:48 PM.
 
  


Reply

Tags
data, genius, hardy, linux, picture, recovering, slackware, ubuntu, wow


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I mount 2GB xD Picture Card? paul.leopardi Linux - Hardware 15 08-01-2007 08:03 AM
xD-Picture card , how to mount/read in SUSE 10.2 linux_junky Suse/Novell 4 01-15-2007 07:27 AM
TV Card - Picture but no sound A_Complete_Idiot Linux - Hardware 6 07-31-2006 10:35 PM
TV-out on ATi card giving rolling picture? NobeyamaGP Linux - Hardware 2 07-21-2006 01:06 PM
damage to ati video card? pharmd Linux - Newbie 2 02-25-2005 01:38 PM


All times are GMT -5. The time now is 01:25 PM.

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