{"id":3456,"date":"2018-08-10T01:47:39","date_gmt":"2018-08-09T17:47:39","guid":{"rendered":"https:\/\/www.bytebot.net\/blog\/?p=3456"},"modified":"2018-08-10T01:47:39","modified_gmt":"2018-08-09T17:47:39","slug":"thumb-drive-data-recovery","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery","title":{"rendered":"Thumb drive data recovery"},"content":{"rendered":"<p>I haven&#8217;t done any data recovery or data rescue work in sometime (the last time was on Linux, with a combination of <code>dd<\/code>, <code>ddrescue<\/code>, and some throwaway code to parse JPGs &#8211; it was a Compact Flash card that needed saving). This time, all I had was macOS, a 16GB thumb drive, and the files were someone&#8217;s life&#8217;s work, which were more than just JPGs but also AI (adobe illustrator), DOC, XLS, PDF, TTF, etc. files. <\/p>\n<p>So via Homebrew, I installed <code>ddrescue<\/code> again. A command like <code>ddrescue -v -n -c 4096 \/dev\/disk2 helena.dmg helena.log<\/code> seemed to work. On macOS, <code>fdisk<\/code> totally couldn&#8217;t get me anything useful and if I ran <code>diskutil list<\/code> the output would be as follows:<\/p>\n<pre><code>\/dev\/disk2 (external, physical):\n   #:                       TYPE NAME                    SIZE       IDENTIFIER\n   0:                                                   *15.5 GB    disk2\n<\/code><\/pre>\n<p>For good measure I wanted to also make an image via <code>dd<\/code>, <code>dd if=\/dev\/disk2 conv=sync,noerror bs=4096 of=helena.img<\/code>. It was clearly throwing many errors, an example of which:<\/p>\n<pre><code>13399375872 bytes transferred in 1263.864380 secs (10601910 bytes\/sec)\ndd: \/dev\/disk2: Input\/output error\ndd: \/dev\/disk2: Input\/output error\n<\/code><\/pre>\n<p>The real problem was mounting either the DMG or the IMG. On Linux you have this option to loopback mount a file; on macOS this isn&#8217;t quite there. There is <code>hdiutil<\/code> but frankly, this doesn&#8217;t work if there is no partition record. I tried to mount it using <code>hdiutil attach -noverify -nomount helena.img<\/code> but that didn&#8217;t work to then do a <code>diskutil mountDisk<\/code>. <\/p>\n<p>Then&#8230; I found a tool: <a href=\"https:\/\/www.cgsecurity.org\/wiki\/PhotoRec\">PhotoRec<\/a>. I wouldn&#8217;t have to write something to parse the magic numbers and extract files. PhotoRec <em>just works<\/em>. It parsed the IMG file, and spat out plenty of files to look at. Recovery was generally full. <\/p>\n<p>For reference, on Linux, there are some good resources: <a href=\"https:\/\/major.io\/2010\/12\/14\/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux\/\">Mounting a raw partition file made with dd or dd_rescue in Linux<\/a>, and <a href=\"https:\/\/www.technibble.com\/guide-using-ddrescue-recover-data\/\">Guide to Using DDRescue to Recover Data<\/a>. From a forensic standpoint, <a href=\"https:\/\/github.com\/aburgh\/Disk-Arbitrator\">Disk-Arbitrator<\/a> looks like a good tool as well.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Thumb%20drive%20data%20recovery&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2018%2F08%2F10%2Fthumb-drive-data-recovery&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"8ec9e10d35\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-3456\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-3456\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-3456\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t done any data recovery or data rescue work in sometime (the last time was on Linux, with a combination of dd, ddrescue, and some throwaway code to parse JPGs &#8211; it was a Compact Flash card that needed saving). This time, all I had was macOS, a 16GB thumb drive, and the files [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Thumb%20drive%20data%20recovery&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2018%2F08%2F10%2Fthumb-drive-data-recovery&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"8ec9e10d35\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-3456\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-3456\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-3456\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2018\/08\/10\/thumb-drive-data-recovery?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[1503],"tags":[767,1939,768,4,1883,1938],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-TK","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1347,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2009\/02\/24\/on-magnolia-and-data-recovery","url_meta":{"origin":3456,"position":0},"title":"On Ma.gnolia, and data recovery","date":"24\/2\/2009","format":false,"excerpt":"There's a good podcast from Chris Messina and Larry Halff, about what really happened at Ma.gnolia. If you're at all interested in what happened (i.e. how did they lose all their bookmark data), don't hesitate to watch the video. I took some quick notes: half a terabyte database file got\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":657,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/11\/06\/raw-management-and-conversion-in-linux","url_meta":{"origin":3456,"position":1},"title":"RAW Management and Conversion in Linux","date":"6\/11\/2007","format":false,"excerpt":"Today, I was playing around with Linux, and RAW management. Not wanting to carry a laptop just for photo editing (i.e. I plan on travel without my MacBook Pro, and beautiful Lightroom, Aperture, iView Media Pro [okay, Microsoft Expression Media now], and Photoshop CS2), I figured I should make Linux\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3393,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2017\/10\/07\/keybase-and-fuse-on-macos","url_meta":{"origin":3456,"position":2},"title":"Keybase and FUSE on macOS","date":"7\/10\/2017","format":false,"excerpt":"I like the concept of Keybase, have had an account there for sometime (https:\/\/keybase.io\/bytebot). I also installed the Keybase app on macOS which has kbfs, the FUSE-based filesystem for Keybase users to share files with encryption (read more). However, I also tend to spend time offline, and sometimes on restricted\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3395,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2017\/10\/07\/updating-the-locate-database-on-macos","url_meta":{"origin":3456,"position":3},"title":"Updating the locate database on macOS","date":"7\/10\/2017","format":false,"excerpt":"Today I uninstalled CrashPlan on my macOS laptop since on August 22 2017 they announced they were exiting the home user market. I think the party is close to being over as even Amazon CloudDrive is now limited to 1TB of storage. I wanted to ensure I removed any traces\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3315,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2017\/03\/03\/upgrade-notes-on-macos-sierra","url_meta":{"origin":3456,"position":4},"title":"Upgrade notes on macOS Sierra","date":"3\/3\/2017","format":false,"excerpt":"I'm notorious for not updating OS X (macOS) too quickly, preferring to wait months on end for Apple to iron out bugs. I just hope that in 2017 they don't make a major release and something sensible, i.e. that fixes usability and makes the OS much more stable. However when\u2026","rel":"","context":"In &quot;Distributions&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3241,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2016\/06\/29\/evernote-significantly-increases-prices-has-the-product-improved","url_meta":{"origin":3456,"position":5},"title":"Evernote significantly increases prices &#8211; has the product improved?","date":"29\/6\/2016","format":false,"excerpt":"I have been an Evernote user since February 2009, and I believe I found it extremely valuable and useful that I have dutifully paid $45\/year for probably that long. Sara practically lives in the application on her Mac, iPad and iPhone. As of this writing, I have 18,198 notes. Today\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/3456"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=3456"}],"version-history":[{"count":1,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/3456\/revisions"}],"predecessor-version":[{"id":3457,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/3456\/revisions\/3457"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=3456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=3456"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=3456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}