Recovering ride data from Garmin Edge 500
For the second time now I lost a ride from my Garmin Edge 500. But this time, thanks to this great blog post I was able to recover the data and upload to strava
I followed the steps in that blog post pretty closely, so this is largely a re-hash of that post for my own reference. But here’s what I did on OSX:
- Make a copy of the garmin device using dd
dd if=/dev/disk2 of=~/temp/garmin.img bs=1m
You can (but don’t need to) mount the device using Finder:
open ~/temp/garmin.img
- Get sleuthkit
- Download latest from http://www.sleuthkit.org/sleuthkit/download.php
- Fix the junit path in bindings/java/nbproject/project.xml . Change from:
<classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/junit-4.8.2.jar;lib/sqlite-jdbc-3.8.0-SNAPSHOT.jar</classpath>
to
<classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/junit-4.8.2.jar;lib/sqlite-jdbc-3.8.7.jar</classpath>
- Fix the junit version in bindings/java/ivy.xml . Change from:
<dependency org="org.xerial" name="sqlite-jdbc" rev="3.8.0-SNAPSHOT" >
to
<dependency org="org.xerial" name="sqlite-jdbc" rev="3.8.7" >
- Build
./configure && make
- Get scalpel:
git clone https://github.com/machn1k/Scalpel-2.0.git . ./configure && make && sudo make install
- Create a scalpel.conf:
#fit file definition from http://www.thice.nl/recovering-data-from-garmin-edge500 #fit y 1000000 \x0E\x10\x98\x00??????\x00\x2E\x46\x49\x54\x00\x00\x40\x00 \x01\x00\x00\x1A\x01??# updated fit definition as per data on my Garmin fit y 1000000 \x0E\x10\x98\x00???\x00\x2E\x46\x49\x54\x00\x00\x40\x00 \x01\x00\x00\x1A\x01??
It’s worth noting that the first definition does find some files on the device (perhaps from an earlier version of the firmware), but the second definition finds a lot more files (including the recent file I was missing). I found the common header and footer by using hexdump on some known good .fit files on the device, e.g.
for f in $(ls -1 2014-1*.fit); do hexdump -n16 $f; done
- Run scalpel on the copy of the garmin device:
scalpel -c scalpel.conf -o garmin.out garmin.img
There will now be a bunch of files in the garmin.out directory
- Get FitDump and GarminFit perl scripts:
mkdir fitdump; cd fitdump curl http://pub.ks-and-ks.ne.jp/cycling/pub/fitdump-0.04.tar.gz > fitddump/fitdump.tar.gz curl http://pub.ks-and-ks.ne.jp/cycling/pub/GarminFIT-0.12.tar.gz > garminfit.tar.gz tar -xzvf fitdump.tar.gz tar -xzvf garminfit.tar.gz
- Do something like this to find the file you're looking for
for f in $(ls -1 ../../garmin.out/fit-0-0/*.fit); do echo $f; ./fitdump $f | grep time_created; done > ~/temp/garmin.out/time_created.out
Then you can look through the time_created.out file to find the file containing the ride you're missing based on the date. You can then directly upload this file to Strava
March 9th, 2015 at 5:39 pm
Thank you for the help. Solution worked great; however, was not able to find file.
Eric
March 11th, 2015 at 2:19 pm
@eric, it’s worth poking around some of the known good files (as referenced at the end of step 4) and trying some different file definitions in the scalpel config
May 10th, 2015 at 1:23 pm
thank you for this great step-by-step manual. being not very fluent in terminal/compiling/installing stuff i ran into some problems. i can’t get scalpel to install as it reports: configure: error: Scalpel requires libtre and libtre-dev. See http://laurikari.net/tre/.
so i am stuck at this point. i have the image file.
do you have any advice for me?
would be greatly appreciated.
paul
May 10th, 2015 at 1:57 pm
Hey Paul, looks like I had to install libtre too. Looks like these are the commands I used:
Then I compiled scalpel after that. Let me know if that helps.
Ethan
March 28th, 2016 at 1:41 pm
Hi,
Having the same issue trying to get Scalpel onto OSX, have installed Tre (as best of my knowledge), but Scalpel is still complaining of the same error above; “Scalpel requires libtre and libtre-dev”
Sorry to ask, I’m just trying to retrieve a 3hr training ride from today (or at least see if I might be able to retrieve!) – any pointers I would be hugely grateful.
Cheers,
Rich
May 23rd, 2016 at 9:24 pm
That’s one clear step-by-step manual. I got my hopes up that it might work for my edge 810, but I’m having a problem at the first step. It’s telling me permission denied for dev/disk2. Any suggestions? Thanks.
May 24th, 2016 at 5:30 pm
Marieke, you may need to run that command as root, so:
June 10th, 2016 at 8:58 pm
Thank you! This worked as written! I only followed the image making and scalpel parts and was able to find all missing fit -files from my Edge 500!!! I tried some data recovery programs but they wouldn’t even find the folders “Activities” and “µCTIVI~1”, which probably should’ve contained the nuked .fit files! I could see these folders with Linux/Windows still..
September 4th, 2016 at 3:00 pm
Could someone help me with recovering a .bak file or converting it to a file I can use in strava/garmin connect? Thanks
July 25th, 2017 at 3:52 am
Everything works perfectly, except…it can’t find any fit files, even the ones on the device right now (EDGE 500)
I tested this by doing the following.
Went onto the GARMIN usb, and pulled out the two current .fit files on the device.
Created an image of a folder containing those files, then ran scalpel
It found those files and pulled them out
When I use the image I’ve created, it finds no files matching the header, but the image should have the two current activities on there, right?
Please help, I’ve debugged this as best I can, but I’m lost why it’s not finding the current activity files on there.