How to copy files with bad sectors

written by Admin


Posted on 2013-10-28


Problem

I must copy a file that has bad blocks (only a file, not a partition)

Solution

You can use dd in a root shell:
# dd if='source_file' of='dest_file' bs=4k conv=noerror,sync

To watch progress, open a new shell, find the pid of the dd process using pgrep (or ps) and run watch to force the process to print statistics on the first shell:
# pgrep -l '^dd$'
1019 dd

# watch -n 10 kill -USR1 1019

Feedback


Comments

Leave a Comment:

Search

Welcome

We need collaboration and a real boost from our community: write us an email for every trick you find!

This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting

Our database grows if YOU send us your tips and trick as soon as you find them every day!