Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Hi i'm Trying fixing my Windows 7 system with a broken harddrive, but it's still running.

I'm trying copy all data to a new drive to reinstall Windows 7. Drive called SQSERVICE.

I can't copy at all - see below:

$ sudo dd if=/dev/sdc1 of=/dev/sda1
dd: reading `/dev/sdc1': Input/output error
11233976+0 records in
11233976+0 records out
5751795712 bytes (5.8 GB) copied, 187.731 s, 30.6 MB/s

How to fix this "Input/output error"?

share|improve this question
    
@Gertvddijk thanks to fix my spelling problem, i'm from netherlands still learning english well. –  Erazer Feb 9 '13 at 13:36

2 Answers 2

You said it yourself: your disk is broken. You can try ddrescue, it may be able to work around the broken path. Beware though, that you will lose data.

Restoring from backup will be easier :)

share|improve this answer
    
yes i said that but restoring from backup it's on that drive.. and i this drive have only sector problem, well how can i use that command? im just newbie linux user.. –  Erazer Feb 9 '13 at 13:31
1  
So your backup is on the same drive as the drive you're bcaking up?! boggles –  Dennis Kaarsemaker Feb 9 '13 at 13:44
    
well same drive yes but not on same partition. well i'm little bit stupid :'( backup its not imporant at all –  Erazer Feb 9 '13 at 13:45

I don't know if this is useful to anyone, but if I found this page in my search, maybe it will help someone (other than the OP who hopefully solved his problem months ago).

ddrescue may be the best choice in this case, for data recovery (different from "fixing" the error/disk as the original question was worded), as Dennis suggested.

Alternatively, you could also mount the disk and copy the files. This is MUCH faster if there is lots of empty space, or if you only want some particular files. WARNING: done from a Linux machine, this loses all extended attributes, such as file permissions, so is a very bad choice for OS files, but tolerable for user files. Doing it from windows should preserve those, but might not handle errors smoothly, possibly making it go very slow.

Another option to actually "fix" the sectors, not just bypass them, is to reallocate the bad sectors. If you know the sector number (in your case, 11233976 assuming your block size in dd, and sector size are 512), just run this, and run again for each new bad sector you find:

hdparm –write-sector 11233976 –yes-i-know-what-i-am-doing /dev/sdb

WARNING: This will destroy the data on that sector. So be sure you really do know what you're doing. If this sector can't be read, overwriting it will stop the errors, but it will mean that sector will contain garbage, possibly corrupting an important file.

See this for more info: http://www.sjvs.nl/forcing-a-hard-disk-to-reallocate-bad-sectors/

And if your disk has a large number (thousands perhaps) of bad sectors (either seen as Current_Pending_Sector, Offline_Uncorrectable or Reallocated_Sector_Ct), or if it's new and still on warranty, or if the number consistently goes up over time, then you should replace the disk anyway. Don't let them tell you that reallocating fixes the disk. It only fixes the known bad sectors and consumes the sectors reserved for reallocation. If the disk is prone to developing more bad sectors, the problem will just keep coming back, each time corrupting some data.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.