My wife has been complaining about some problem she was having looking at a few pictures she took with our digital camera. She said the error message was something like, “Unable to view image — Bad image file”. I kind of blew her off after using the camera without any problems. Then, yesterday she asked me to load them onto the win xp machine we use to store our images and I found the problem she was talking about.
Sure enough, there were some corrupted images on the card. I tried to perform the sync 3 or 4 times before I realized that it just wasn’t going to happen. I tried to find the images on the camera and delete them but it just locked the camera up when I would try to select a bad image. Still no luck. After a little brainstorming I decieded it was time to plug the camera into my RH9 box and mount the CF card and see what I could do. I had done this about a month or so ago and was actually going to write an article about it on uptime, but before I got around to it a friend had an article up on the same subject (see Frank Merenda’s article). Anyways, I plugged the camera into my usb slot, openned a terminal window and tailed my /var/log/message file, and then powered up the camera.
Looking at my tail. I see the camera/CF card are clearly recognized and the USB driver sets up “SCSI emulation” on my card.
Nov 9 22:46:27 localhost kernel: hub.c: new USB device 00:1f.4-1, assigned address 2
Nov 9 22:46:27 localhost kernel: usb.c: USB device 2 (vend/prod 0x4b0/0x114) is not claimed by any active driver.
Nov 9 22:46:30 localhost /etc/hotplug/usb.agent: Setup usb-storage for USB product 4b0/114/100
Nov 9 22:46:30 localhost kernel: Initializing USB Mass Storage driver…
Nov 9 22:46:30 localhost kernel: usb.c: registered new driver usb-storage
Nov 9 22:46:30 localhost kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Nov 9 22:46:30 localhost kernel: Vendor: NIKON Model: NIKON DSC E3100 Rev: 1.00
Nov 9 22:46:30 localhost kernel: Type: Direct-Access ANSI SCSI revision: 02
Nov 9 22:46:30 localhost kernel: USB Mass Storage support registered.
Next I mount the camera
[root@localhost root]# mount /dev/sda1 /mnt
[root@localhost root]# ls /mnt
dcim misc nikon001.dsc
So I’m “in business”. Now I need to find my pics. They end up being in
Now that I was in the card I needed to try to find the “bad images”. I achieved this by starting at the top and just opening each image in my browser. The first two opened fine, but then I was getting an, “unable to open image” message. I simply worked down the list until I could open one, and then deleted everything in-between. Not the most scientific process, but it worked great. How I would have done this without a linux machine? I have no idea.