Skip to content

Instantly share code, notes, and snippets.

@langri-sha
Created January 11, 2016 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save langri-sha/a16de0399998fd7eda41 to your computer and use it in GitHub Desktop.
Save langri-sha/a16de0399998fd7eda41 to your computer and use it in GitHub Desktop.
NTFS undelete session highlights
# List deleted files from the MFT, sort by date
sudo ntfsundelete /dev/sdb1 | sort -n -r -k4 | \
# Construct commands to undelete each INODE to ~${date}/${inode}-{filename}
awk '{print "sudo ntfsundelete -u /dev/sdb1 -i " $1 " -o \"/run/media/fdupanovic/WD/" $4 "/" $1 "-" $7 "\"";}' | \
# Truncate day from dates
sed -r "s/-[0-9]+//2" | \
# Split into files with 2048 commands each to avoid memory segmentation errors
split -l 2048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment