User Tools

Site Tools


data_rescue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

data_rescue [2018/03/26 20:17] (current)
sebastian created
Line 1: Line 1:
 +====== Rescuing data from a USB Stick ======
 +In this example we will go through the steps to rescue data from a USB stick that contains a VFAT file system.
 +
 +===== Preparation =====
 +In general create a copy of the media you try to restore data from. Experimenting with the copy is safer than with the only original.
 +
 +Install ''​ddrescue''​ which is a more robust version of ''​dd''​ that keeps on going in case of errors.
 +
 +<code bash>
 +apt install ddrescue testdisk
 +</​code>​
 +
 +===== Restoring the data step-by-step =====
 +Steps:
 +  - Identify the device in the ''/​dev''​ file system (e.g. ''/​dev/​sdf1''​)
 +  - Make sure the stick is unmounted
 +  - Create an identical copy of the contents
 +
 +<code bash>
 +RESDIR=~/​rescue
 +RESFILE="​$RESDIR"/​usbkey_rescue.img
 +mkdir "​$RESDIR"​
 +ddrescue /dev/sdf1 "​$RESFILE"​
 +testdisk "​$RESFILE"​
 +</​code>​
 +
 +===== Looking into the image =====
 +If the file system is intact (or after a successful repair), you can mount the image via the loop device:
 +
 +<code bash>
 +mount -o loop -t vfat "​$RESFILE"​ /mnt
 +</​code>​
 +
  
data_rescue.txt ยท Last modified: 2018/03/26 20:17 by sebastian