The Artima Developer Community
Sponsored Link

Weblogs Forum
Open source saves another marriage

4 replies on 1 page. Most recent reply: Mar 22, 2011 5:46 AM by Shaftain Anwar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Barry Warsaw

Posts: 12
Nickname: pumpichank
Registered: Jun, 2003

Open source saves another marriage (View in Weblogs)
Posted: Jul 18, 2008 6:55 PM
Reply to this message Reply
Summary
My wife saved two important SD cards from her camera to a faulty USB disk I'd given her. The images got corrupted and she'd deleted the files from her cards. Could Open Source come to the rescue? Let's hope so because divorces are expensive!
Advertisement

Barry Gets In Trouble

My wife recently went on a trip with her sisters to Nicaragua, and took lots of great pictures with her digital SLR camera. The hard drive on her Mac had filled up so I gave her a USB external drive that I'd used several times before, confident that she could export her images onto it instead.

Well, apparently there was something wrong with the disk because all the images exported from the card got corrupted. To make matters worse, she'd deleted the images from the cards. Needless to say, she was very discouraged at the loss of these pictures, and I started to fluff up the throw pillows on the couch.

Barry Uses The Googles

Like any caring and mortally afraid husband, I reassured my wife that I could fix things, so I took the cards and her camera and retreated to my cave, er, office. Knowing almost nothing about SD cards, I immediate typed in the first brilliant search that came to mind: "recover SD card images". This lead me to lots of commercial software products, almost all of which ran exclusively on Windows. Of course, we're a Windows-free home, so I prepared for a long stay on that very uncomfortable couch.

Motivated by the phantom twinges prickling my lower back, I did a clever thing: I went to Wikipedia and looked up SD cards. As most of you probably know, SD cards for digital cameras are usually formatted with FAT16 or FAT32 file systems. This ancient crufty file system was actually an advantage for me in this case, because deleted files don't actually get deleted, they essentially get hidden by being renamed. I'd never trust my company data to such an insecure file system, but now I was glad for it, and I was beginning to smell the brownie points baking.

Sharpening up my Google-fu led me to this great page:

http://lists.slug.org.au/archives/slug/2006/05/msg00002.html

Here, there's lots of good advice on using dd and fsck to try to recover the files. The dd command was particularly useful as I could experiment on a copy of the SD card's image and not directly on the card. Unfortunately, I couldn't make much headway with fsck.vfat. I hoped the dog would welcome some (purely platonic!) company tonight.

Open Source to the Rescue

More googlin' finally led me to this page:

http://www.cgsecurity.org/wiki/PhotoRec

PhotoRec is an open source digital image recovery program that ignores the underlying file system (now known to be hosed) and goes right after the image data. Hmm, I wonder if it was available on my Ubuntu machine:

% apt-cache search photorec
testdisk - Partition scanner and disk recovery tool
% sudo apt-get install testdisk

(PhotoRec uses testdisk and the photorec binary is provided with that package.)

Now, the only thing left was to thoroughly read the manual, and carefully, non-destructively, and systematically experimenting on the image files. I noticed that it was getting pretty dark outside, and my wife was refilling her wine glass, so I threw caution to the wind and invoked Warsaw's Fourth Law:

% sudo photorec sdcard.bad1

The curses u/i was a bit clunky, but fairly easy to navigate, and my clueless guesses at some of the options yielded almost immediate results. PhotoRec quickly recovered about 300 pictures off the first bad card! I ran downstairs, tore the half-completed divorce papers from my wife's shaking hands, and dragged her upstairs to show her the pictures imported into F-Spot. Having done almost nothing more than a bit of web searching, a package installation, and a shot-in-the-dark program execution, I now looked like a hero. Thanks Google, Ubuntu, and Christophe GRENIER (the author of PhotoRec).

My One Complaint

This basic scenario has played itself out countless times in my open source career. There's usually some very cool little program that does almost exactly what you need, but if there's a recurring theme, it's that such nuggets can be quite difficult to find. You're faced with a problem, you suspect there's a solution Out There, but getting from problem to solution is a mysterious path. How many such problems go unsolved just because their existing solution isn't easily found?

I don't have any great ideas to make this path from problem to solution less windy and rocky. I welcome your comments. But right now, it's bed time. Oh honey...


Rusty Wright

Posts: 8
Nickname: lumpynose
Registered: Jul, 2007

Re: Open source saves another marriage Posted: Jul 20, 2008 10:34 AM
Reply to this message Reply
I keep hearing about Mac users having pictures corrupted on external drives. What's up with that?

Kazim Zaidi

Posts: 2
Nickname: kazim59
Registered: Jul, 2008

Re: Open source saves another marriage Posted: Jul 29, 2008 9:25 PM
Reply to this message Reply
The other product from CGSecurity -- testdisk -- has saved my life more than 3 times. In situations where you've messed up your partition table, testdisk is magical. And you look like a hero!

My friend had lost great amount of data on his harddisk, so I was looking up for solutions. We tried some Windows solutions (although I was not happy with them), but it turned out that even after 6 hours of processing the results were highly disappointing! Then Google told me about testdisk. Not surprising though, but testdisk recovered every single file!

Even when testdisk fails, tools like dd are enough to save whole partitions. Here's where dd saved me like a miracle -- http://tuxplayground.blogspot.com/2008/02/recovering-lost-reiserfs-partition.html

Anyways, you could've called the post "USB External Drive threatened another marriage". :-P

Timothy Pick

Posts: 1
Nickname: tjpick
Registered: Feb, 2007

Re: Open source saves another marriage Posted: Jul 30, 2008 12:05 AM
Reply to this message Reply
This has saved my skin a couple of times http://www.cs.washington.edu/homes/oskin/saveimg.html

Shaftain Anwar

Posts: 1
Nickname: shaftain
Registered: Mar, 2011

Re: Open source saves another marriage Posted: Mar 22, 2011 5:46 AM
Reply to this message Reply
love you and your articles and also your laws :D

Flat View: This topic has 4 replies on 1 page
Topic: Oracle forks Jenkins Previous Topic   Next Topic Topic: Scala 2.8.0 + Lift 2.1 + IntelliJ: First Step(s)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use