LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-15-2009, 01:55 PM   #1
Aegreen
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
DD Input/output error


Hey just looking for any help or suggestions.

About a week ago my hard drive in my iBook crashed (yes I know I'm posting in a linux forum) after attempting to "repair permissions" with Disk Utility and it freezing I attempted to reboot then got a disctinct clicking noise from the hard drive and it froze during the boot. Booting in verbose mode states something like Journal error (sorry can't remember the detail but this is background info anyway). Basically try creating a disk image with Carbon Copy Cloner and Disk utility by booting off the install disk both of which fail, Disk Utility which fails however quite later and after about 130Gb of the 160Gb drive and doesn't induce the clicking noise, wherease CCC did.

Also booted off an old external hard drive containing mac os x and can't see the drive and induces the drives clicking noise, sometime before the system has loaded. So swapped it out and the bad drive is now in my external.

Also to note I had booted with an ubuntu livecd and ydl off of an external hard drive and can see and mount the drive but can't read all the files (due to permissions) and obv can't right because of HFSPlus journaling issues (I think).

Anyway so I turned to terminal and the dd command. I've run it a few times with a few different variations of the command and still hit a point where I constantly get input/output errors and slows the process down to a crawl. If I cancel the proces (ctrl+c) when it's giving me these errors, I can mount the drive and see most of the contents and it appears ok (proper size of content and free space) but I want to know if i got off as much as I could before I try to restore the drive from the image or installing linux on to the hard drive so I can see if it's physically damaged.

Here is the first couple input output errors and the command I used for dd:

Code:
Computer:~ user$ dd if=/dev/disk1s3 of=/Volumes/ExternalHarddrive/HarddriveSave.dmg conv=noerror,sync
dd: /dev/disk1s3: Input/output error
275044712+0 records in
275044712+0 records out
140822892544 bytes transferred in 32360.694125 secs (4351665 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
275044713+0 records in
275044713+0 records out
140822893056 bytes transferred in 32371.356104 secs (4350232 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
275044714+0 records in
275044714+0 records out
140822893568 bytes transferred in 32382.015771 secs (4348799 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
275044715+0 records in
275044715+0 records out
140822894080 bytes transferred in 32392.682371 secs (4347367 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
275044716+0 records in
275044716+0 records out
140822894592 bytes transferred in 32403.349882 secs (4345936 bytes/sec)
Also tried to use the seek option to extract just the segment that seems to be giving it trouble and came up with a file that was umountable according to os x because it contained no filesystem, I only ran the command for about 5 minutes and only got a 1.5mb disk image. Here is the command and output:

Code:
Computer:~ user$ dd skip=275044712 if=/dev/disk1s3 of=/Volumes/ExternalHarddrive/Error.dmg conv=noerror,sync
dd: /dev/disk1s3: Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 21.116408 secs (0 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
1+0 records in
1+0 records out
512 bytes transferred in 42.760132 secs (12 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
2+0 records in
2+0 records out
1024 bytes transferred in 64.451374 secs (16 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
576+0 records in
576+0 records out
294912 bytes transferred in 120.262264 secs (2452 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
577+0 records in
577+0 records out
295424 bytes transferred in 141.952121 secs (2081 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
578+0 records in
578+0 records out
295936 bytes transferred in 159.294182 secs (1858 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
579+0 records in
579+0 records out
296448 bytes transferred in 170.007339 secs (1744 bytes/sec)
dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
580+0 records in
580+0 records out
296960 bytes transferred in 180.707508 secs (1643 bytes/sec)

.
.
.
.(Just omitted the middle output, just more of the same)
.
.

dd: /dev/disk1s3: Input/output error
dd: /dev/disk1s3: Input/output error
1735+0 records in
1735+0 records out
888320 bytes transferred in 408.134578 secs (2177 bytes/sec)
dd: /dev/disk1s3: Input/output error
^C
2976+0 records in
2976+0 records out
1523712 bytes transferred in 430.077431 secs (3543 bytes/sec)
Any help or suggestions would be awesome!
 
Old 04-15-2009, 03:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
You may want to look at tools like safecopy or dd_rescue,
but that still won't give you back the data on the defunct
sectors of your HDD if they're really badly damaged.
 
Old 04-15-2009, 04:24 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I think "patience is a virtue".
One thing I always include in my dd image commands is, conv=notrunc,noerror. Although that probably won't change anything, it will keep the image exactly as the source.
As far as patience is concerned, you'll have to let it go on, it will try reading bad sectors by making more passes before putting out the error and moving on. You can try using a higher bs count (bs=4096) to help speed things, dd defaults to 512 if you don't specify differently. All file systems write files to blocks/clusters, if the cluster size is 8 sectors, a 200 byte file will use up the whole cluster which is 4096 bytes. 8 sectors per cluster is the smallest cluster size for a hard drive, so increase your byte size count to this factor and you won't omit anything.

There is ddrescue which handles errors differently than dd, it is designed to make sure you get an image before the drive takes the dive. Not sure which Live CD has it, but I'm sure one of them does.

It is obvious the drive has bad sectors, there is an application called SpinRite that can be run from DOS mode, it will revive the drive to the point you can use it normally. It remaps bad sectors, you can also set it to recover data from the bad sectors to get a 100 percent fixed drive. Then you can recover your data normally before playing with it. It has to look at every sector, so it will not be fast, especially if your processor is not considered fast. And it will re-read the bad sectors many times to recover the data if you allow it.

I would first try again with dd as you're already set up, add the higher bs count and the notrunc conversion operand.
Based on your commands, you are only chasing the third partition, not the entire drive.

Last edited by Junior Hacker; 04-15-2009 at 04:31 PM. Reason: Spelling
 
Old 04-16-2009, 05:27 AM   #4
maresmasb
Member
 
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
If the data on the hard disk is really important, then find a company specialized in recovering damaged hard disks. This can be expensive and might even fail, but it's still the best bet.

Having your failed hard disk written out to a large 'dd' file might make you feel like you have achieved something, but parsing through raw data retrieved from a corrupted hard disk is no fun at all.

Last edited by Tinkster; 10-30-2010 at 04:15 PM.
 
Old 04-16-2009, 08:26 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,899
Blog Entries: 27

Rep: Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186
Hi,

If you have hits or failures on the platter then you can't expect to recover much. The physical damage to the area on the platter will prevent you from reading let alone writing.

Data recovery is an art not magic! Just remember that if there are platter damages to a hdd then the probability of data recovery is not very likely. If you have a interface problem then that too can be difficult but possible with the proper tools.

'DD' is a great tool but it can't handle information unless the hdd can provide it.
 
  


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
aplay: pcm_write:1029: write error: Input/output error mimithebrain Linux - Software 2 12-04-2007 12:51 PM
k3b write error for dvd's (input/output) error mocean SUSE / openSUSE 3 06-27-2007 03:39 PM
RPM iinstallation [error: failed to stat /mnt/windows: Input/output error] Ameii83 Linux - Software 1 04-09-2007 08:05 AM
cp - error reading /mnt/cdrom/mpegav/avseq01.dat input/output error manishsingh4u Linux - General 2 10-17-2005 06:02 AM
dd input/output error matazar42 Linux - General 3 10-08-2005 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration