Results 1 to 10 of 10
Hello, I have been on a journey to try and recover the photos from an xD memory card, which was filled with my mums photos from her holiday of a ...
- 12-11-2006 #1Just Joined!
- Join Date
- Dec 2006
- Location
- Bath, UK
- Posts
- 5
Are these photos really lost forever?
Hello, I have been on a journey to try and recover the photos from an xD memory card, which was filled with my mums photos from her holiday of a lifetime - until 'card error' appear on the camera. I fear this was because the card was never formatted before being placed in the camera.
I basically installed Linux because I had had no luck with any kind of file recovery software in windows, and I had found a Java program that someone had written to search an image file of a 512mb xD card for certain bytes which show the beginning and end of a jpg file...
Anyway, I now think I will never get that far as it seems I can't even mount the xD card when it is in my card reader...
I've got an old 16Mb xD card which works fine, to use as a 'control' to see if what I am doing is right, as I have never used Linux before (I am using Ubuntu btw).
If I type:
"mount /dev/sde1 /media/usbdisk"
when the 16 mb card is inserted, it mounts the card and I can read the data on it.
However if I unmount this drive, place the 'damaged' card into the same slot on the reader and repeat the command:
"mount /dev/sde1 /media/usbdisk"
then all I get is a message saying:
"mount: special device /dev/sde1 does not exist"
If it works with one card and not the other, does this mean that the photos on the 512Mb card are truly lost and forever inaccessible?
I am on the verge of giving up now. Its just so frustrating knowing that the data which makes up those photos might be there somewhere but I cant get at it...especially as my mum was able to review all the photos on her camera many times over her holiday before the dreaded 'card error' struck...
Thank you for any advice.
- 12-11-2006 #2Linux Newbie
- Join Date
- Jun 2006
- Posts
- 150
I'm still a linux newbie myself, but are you sure that your second xD card has the same file in /dev? I mean, are you sure that the second card is still trying to use /dev/sde1? Could it be using /dev/sda1 or /dev/sde2? If those don't work, and you haven't overwritten the pictures, then I guess that you could get a hex editor and either fix one or two bytes or... do a nearly impossible amount of work parsing out the pictures by hand... Can you see the pictures on the camera? If you can, then it means that the card is probably just not formatted in vfat (a.k.a. fat16) and it would just be a matter of finding the correct format to put in your /etc/fstab file. But, as I said, I'm still a newbie...
- 12-11-2006 #3Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
It doesn't look too hopeful but we can take a peek and see if we can at least diagnose the problem.
Run dmesg, then plug in the card, then run dmesg again. The new lines are associated with the card being plugged in. Copy that out and paste it here. It will also check Alaric's idea that the device is just appearing at a different /dev/* location.
Even if the filesystem is damaged the photos could be intact if we can copy the data off without mounting it.
Failing that you might have to enlist the help of a data recovery service. I recall an article about recovering data from these cards, and they nailed one of the cards to a tree and still managed to get some of the data back. Here it is.
Let us know how you get on.
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 12-11-2006 #4Just Joined!
- Join Date
- Dec 2006
- Location
- Bath, UK
- Posts
- 5
I admit I'm a real newbie, but are you saying if I plug the same type of card into the same slot on a card reader, then it might not use the same /dev/xxx location as the previous card? Surely it must be the same? Or have I been using windows too long and don't understand how Linux does stuff like this?
Originally Posted by Alaric
Thanks for you help. I assume when you say "run dmesg" i just type in "dmesg" at the command line? (As I said Im new to this). I have tried it and I get over hundreds of lines of stuff I dont understnand, but I have included what I got in two text files (attached).
Originally Posted by kakariko81280
If I could even see the data on this card it would be an achievement, are you saying data can be retrieved without mounting the card? How is this possible?
Thanks
- 12-15-2006 #5Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
Yup, just typing dmesg at the command line was the right thing to do. The interesting bit of the file looks like this:
What this is telling you is that the device is indeed being made available at sde1. I've highlighted the important bit.[ 4639.797325] SCSI device sde: 32000 512-byte hdwr sectors (16 MB)
[ 4639.801632] sde: Write Protect is off
[ 4639.801635] sde: Mode Sense: 43 00 00 08
[ 4639.801637] sde: assuming drive cache: write through
[ 4639.805815] SCSI device sde: 32000 512-byte hdwr sectors (16 MB)
[ 4639.807126] sde: Write Protect is off
[ 4639.807129] sde: Mode Sense: 43 00 00 08
[ 4639.807131] sde: assuming drive cache: write through
[ 4639.807326] sde: sde1
[ 4640.016992] FAT: utf8 is not a recommended IO charset for FAT filesystems, fi
lesystem will be case sensitive!
You don't need to mount the device to access data, just to use it like a filesystem. Now that does sound like semantic hair splitting, but if we can copy the data off the damaged card then we might be able to repair the filesystem of the copy.
Plug in the card and try the following commands.
The first command will show us if the device is there and the permission info. The second command will perform a block by block copy of the card.Code:ls -l /dev/sde1 dd if=/dev/sde1 of=~/card.img conv=noerror
It may take some time to complete, especially if the card is actually damaged (I had to run if for a week to get the available data from a shot 80GB HD).
If that works then we can use losetup to mount the card.img file and try to repair the filesystem.
Let us know how you get on,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 12-15-2006 #6Just Joined!
- Join Date
- Dec 2006
- Location
- Bath, UK
- Posts
- 5
Thanks for your reply Chris.
I fear I am doing something wrong, because I started by trying these commands on my 'good' 16Mb Xd card to see if it would work, but when I type in both of those commands you mentioned I just get
andCode:ls: /dev/sde1: No such file or directory
As I am working with the good card, is it something I could be doing wrong? Im still getting used to all this 'superuser' business, and I realise that Ubuntu has a system whereby you can use the 'root' account by typing "sudo -i" when you first fire up a terminal, which changes the text on the command line fromCode:dd: opening `/dev/sde1': No such file or directory
toCode:joe@joe-desktop:~$
I assume that I have to do all of this through the root account?Code:root@joe-desktop:~#
I should also mention that when I insert my good card, Ubuntu automounts it, so before trying any of these commands I unmount it, but leave it in the card reader to try and mimic the situation with the bad card, which Ubuntu is unable to automount when it is inserted. Is this the right thing to do?
I have tried your commands on both cards and just get the "No such file or directory" error.
Could I be doing something wrong, as surely this should work on the good card?
Thanks for all your help, sorry this is taking so long! Some things are never simple!
Cheers
Joe
-----------------
EDIT: I thought I should mention that if I insert my good 16Mb card and allow it to be automounted and leave it mounted, and run the commands then it works.
The first command comes up with
and the second command givesCode:brw-rw---- 1 root plugdev 8, 65 2006-12-15 19:01 /dev/sde
But this isnt really helpful as the bad card cannot be mounted like the good card, and so this proves nothing...surely I should be able to run these commands when the good card is unmounted as well?Code:31959+0 records in 31959+0 records out 16363008 bytes (16 MB) copied, 4.05769 seconds, 4.0 MB/s
- 12-15-2006 #7Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
the good card doesn't appear to be partitioned. If you imagine it as a hard disk, then you can either just dump data on it or partition it up into bits. Sometimes memory cards have no partitions, in which case they will show up as /dev/sd*. Most times (in my experience) they have a single partition that takes up the whole card, netting you /dev/sd* and /dev/sd*1. Sometimes they have a number of partitions, but that is usually 'cos the user has been messing with it.
What you saw with the good memory card is exactly what I wanted to happen. If you issue the following command as root then you can mount the card image as a filesystem.
This will use the loopback module to create a block device out of the file, then mount the block device as a filesystem. If we can make the last set of commands I posted work then we will be breaking down the steps that mount command performs so we can try some filesystem repair in the middle.Code:mkdir /mnt/loopmnt mount -o loop ~/card.img /mnt/loopmnt
To get back to the point. Plug in the broken card and run dmesg. Look for a few lines near the end that will tell you where the device is available at (or errors if it has problems). Use that device in the commands and you should be golden. If you are unsure, just post the bits of dmesg that seem relevant so we can take another peek.
As for running as root, actually you don't at least in this case.
This is saying that the user root and the members of the group plugdev have read and write (RW-) access to the block (B) device listed. If you run "groups" at a command line you will see the groups you are a member of which should include groupdev. That will allow you to run all the commands I've given you as your normal user.Code:Code: brw-rw---- 1 root plugdev 8, 65 2006-12-15 19:01 /dev/sde
And don't worry about this taking time, it'll all be worth it if we can rescue your photos.
Let us know how you get on,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 12-16-2006 #8Just Joined!
- Join Date
- Dec 2006
- Location
- Bath, UK
- Posts
- 5
Right, I see what you are talking about, using /dev/sde as opposed to /dev/sde1 seems to get me a little further.
If I type
I getCode:ls -l /dev/sde
regardless of if either the good or bad card is plugged in to the card reader or even if neither of them are plugged in and the card reader is empty.Code:brw-rw---- 1 root plugdev 8, 64 2006-12-16 18:29 /dev/sde
I managed to turn off the automount feature to give me a level playing field to compare the good card and bad card. Then I noticed that when I plug the good card in, although ununtu doesn't automatically mount the drive, if I have my file browser window open, then "Generic SM" appears down the side of the window. Now this doesn't happen with my bad card....nothing happens at all.
To make matters worse, if I insert the good card and enter
then if works and creates the "card.img" fileCode:dd if=/dev/sde of=~/card.img conv=noerror
But if I insert the bad card and enter
then I get the following error messageCode:dd if=/dev/sde of=~/card.img conv=noerror
Is this then end? To me this says that the card is truly unfixable and the data is not possible to retrieve....?Code:dd: opening `/dev/sde': No medium found
- 12-17-2006 #9Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
I'm afraid it looks like it is broken beyond my ability to fix. Sorry. It looks like the card reader isn't able to do anything with the card (saying that 'cos the card reader works with a known good card).
From here you could look for sites that specialise in data recovery, or just crack your checkbook and take it to a specialist. There is still hope, these things are remarkably robust, but it might be expensive.
Wish I could be more help.
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 12-18-2006 #10Just Joined!
- Join Date
- Dec 2006
- Location
- Bath, UK
- Posts
- 5
Ah...thats what I thought.
Now I'll have to decide how much more time and money its worth investing in getting these photos back...
In anycase thanks very much for your help, I've learnt a lot more about Linux than I knew before!
Joe


Reply With Quote