Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. [root@tachikoma ~]# crib
  2. Categories:
  3. * vid
  4. * arch
  5. * house
  6. * web
  7. [root@tachikoma ~]# crib arch
  8. Cribs in category arch:
  9. * ddrescue
  10. * adduser
  11. [root@tachikoma ~]# crib arch ddrescue
  12. 'ddrescue --direct' will open the input with the O_DIRECT option for uncached reads. 'raw devices' are not needed on newer kernels. For older kernels see below.
  13.  
  14. First you copy as much data as possible, without retrying or splitting sectors:
  15.  
  16. ddrescue --no-split /dev/hda1 imagefile logfile
  17.  
  18. Now let it retry previous errors 3 times, using uncached reads:
  19.  
  20. ddrescue --direct --retry-passes=3 /dev/hda1 imagefile logfile
  21.  
  22. If that fails you can try again but retrimmed, so it tries to reread full sectors:
  23.  
  24. ddrescue --direct --retrim --retry-passes=3 /dev/hda1 imagefile logfile
  25.  
  26. You can now use ddrescue (or normal dd) to copy the imagefile to a new partition on a new disk. Use the appropriate filesystem checkers (fsck, CHKDSK) to try to fix errors caused by the bad blocks. Be sure to keep the imagefile around. Just in case the filesystem is severely broken, and datacarving tools like testdisk need to to be used on the original image.
  27.  
  28. -------
  29.  
  30. losetup -f /path/to/floppy
  31. mount /dev/loop0 /floppy
  32. umount /floppy
  33. losetup --detach /dev/loop0
  34.  
  35. -------
  36.  
  37. CHECKING: badblocks -v /dev/fd0
  38. WRITING: dd if=filename of=/dev/fd0 bs=1024 conv=sync ; sync
  39.  
  40. -------
  41.  
  42. Don't forget to modprobe floppy first.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement