Recovering lost images from a flash card

There are a lot of expensive recovery methods to restore images off of a camera’s flash card and they all work (in their own way).  However, this is really not something you need to be paying for, unless there is something horribly wrong with the card (physically damaged or very very old).

There are many situations that can cause a card, or even a portion of a card, to become unreadable.  Some of which are:

  • Corrupt block written to the directory.
  • Camera corrupted a single image.

There are many schools of thought as to the reasoning behind any corruption, but the general rule of thumb (aka: “Best Practice”) is to never delete individual images from the card.  There is the temptation, while taking pictures (and the card is in the camera), to delete a bad  (blurry, shot of the floor, etc) image from the card in order to regain that space.  Resist that temptation!  Cameras are good at taking pictures and storing them.  If you delete an image, you are now freeing up previously written blocks in the middle of a section of used blocks.  You an now asking the camera to do block-level file management.  Don’t do it.  Leave those bad images there, and, when you are ready, copy the entire card locally to your machine.  Then, delete the bad images from your local copy, and when you need to re-use the card, reformat the card.

Directory corruption is the one that usually causes the most panic, since the symptom is that you cannot access any of the contents of the card.  Don’t give up and simply reformat the card!!  This is actually an easy one to get out of.

Use the Windows tool called Zero Assumption Digital Image Recovery.  I have attached the free standalone verion (Zero Assumption Digital Image Recovery) of their image recovery tool here, but it looks like they have now integrated it in to their ZAR 8.0 tool, which does a heck of a lot more.  ZAR 8.0 is not free, but the digital image recovery portion of ZAR 8.0 is.

I have had a lot of success with the free standalone tool and see no reason to use anything else.  Feel free to give it a try.  Your mileage may vary.

Mounting an ISO image on Solaris

No doubt you’ve had experience with this under Linux (mount -o loop /root/animage.iso /mnt) or Windows (using Daemon Tools), but I had a need to do this under Solaris. Fortunately, it is a rather simple process using a relatively unknown command: lofiadm. (loopback file admin)
lofiadm is a Solaris tool which can be used to map a file to a block device id. With that, you can then use the mount command to mount that block device id to a directory.

Now, you can do this in two steps:

# lofiadm -a /export/temp/software.iso /dev/lofi/1

# mount -F hsfs -o ro /dev/lofi/1 /mnt

But that requires some cleanup afterwards (rm /dev/lofi/1) otherwise, over time, you end up with a bunch of mapped block devices pointing to files that are no longer on the system. It is a “best practice” to combine the commands in to a single command:

# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt

MythTV: My Personal Fedora Core How To

(this will be edited over time as things get updated)

This has been put together for my own archive since there is no guarantee that existing How-To’s are going to be available when needed (there was a key point in time when the Wilsonet.com site was down, and I really needed access to the steps).

Background

After fighting with MythTV (posted here), I was determined to just get it right. It became near obsession, and I started driving my wife a little crazy since I spent a couple of hours each night tackling different aspects of MythTV.

However, I must say that it has been worth it. And my wife sees that too, as she sees it a being something that could replace our Directv TiVo.

Also, when I built my system, I attacked it as if it were a “Proof Of Concept”. In other words, I did not get too crazy about the processor type, the filesystem layout, the computer case, or really any of that stuff. I just wanted to build a system that worked. Once I got to the point where everything worked as it should, I figured I would then tackle the other items (like a smaller, nicer, and quieter case). I believe that taking this approach made it easier in that there was a lot less pressure: I didn’t really invest much money in to the project in the beginning, and anything that I did buy I could always re-sell on eBay.
Prereqisits

At the very least, you will need the following:

  • A power supply
  • A hard drive
  • A motherboard
  • A processor (CPU)
  • A video capture card
  • Memory
  • Internet Access
  • A copy of Fedora Core
  • A Computer case capable of holding all of the above equipment.

Components

This is more of an aside, but I thought it was worth mentioning some more details about the individual components.

The computer case I chose was a standard tower case. Yes, it was ugly. The power supply in it was one that I got for free, after rebates, a while back (I bought it as an emergency spare) and it was LOUD. The hard drive was another spare item I had around (a 160GB drive). I had gotten the video card a long while back for very little money, after rebates. I had the motherboard and processor and memory (all pretty cheap after rebates.. I hate rebates!) available as well.

I had most of the stuff because it was being used as a temporary machine for my in-laws during a period of time that they stayed with us.

Anyhow, the point is that I already had most of the stuff. I didn’t want to invest a heck of a lot of money in to building a Myth PVR if the end result was going to be something that I couldn’t sell to my wife. When it all comes down to it, if she didn’t like it, then it was highly unlikely that we would use it. She, in essence, was my customer.

Assembling the System

I pieced together the 400W power supply, the tower computer case, the MachSpeed Viper K8M8MS MicroATX motherboard, the AMD64 Sempron 3000 (Socket 754) processor with stock heatsink and fan, the Ultra DDR400 512MB memory, and the 160GB Maxtor ATA100 Hard drive. I added in an XFX Geforce 6200 fanless video card with S-Video out since I would be testing the install on a standard 27-inch CRT TV.
With it all together, I made sure things powered up and were all properly recognized by the system. Since I know that this will eventually be a system without a mouse or keyboard, I made sure that the BIOS was set to ignore any keyboard related errors.

Installing the OS

Installation of the OS was pretty simple. Although I ended up doing it about 6 times due to testing things with MythTV and breaking things, in truth you should really only have to do it once.

I didn’t bother partitioning the drive. I didn’t see the sense in it. MythTV has it’s own space management logic which removes the worry of it filling the filesystem to full capacity. Besides, I figured that, down the road, I would have all of the recordings on a central server rather than local to any one machine.

I did make sure that I selected:

  • Servers -> Windows File Server
  • Servers -> Network Servers (vnc was selected by default)
  • Servers -> Web Server
  • Servers -> MySQL Database
  • Development -> Development Libraries (recommended!)
  • Development -> Development Tools (recommended)
  • Applications -> Sound and Video
  • Applications -> Graphical Internet

The Wilsonet.com how-to lists KDE as a requirement, and I installed it, but I ran everything under Gnome without any problems (KDE is a bit of a resource hog, IMHO.. not that Gnome is much better).

Keep in mind that this was a “proof of concept” machine, so I wasn’t too concerned about optimizations.

Right after the installation of the OS, when “firstboot” came up, I configured up a “mythtv” user, pointed it to my NTP server, and configured authentication to also go through my LDAP server.

Immediately after updating, I logged in as “root” and ran “yum -y update” to get all of the latest updates to the distribution. This took nearly as long as it did to install the base os!

Install Myth

The best thing to do is to go to Wilsonet.com and follow the instructions there. Aside from downloading all of the updates from the ATrpms site, there are a number of other little gotchas that are covered on that page.