Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am not able to download the contents of my SD card which is full of photos from my Nikon camera.

When I put the card into my camera, I can view the photos, without a problem. But when I put the SD card into the card reader of my IBM X40 notebook or an external USB card reader on another computer, I get some scrambled content.

In windows explorer it looks like this: Emperor or King

In linux, when I insert the card in the card reader and do dmesg I get:

[   76.531535] mmc0: new SD card at address b368
[   76.602280] mmcblk0: mmc0:b368 SDC   1.86 GiB 
[   76.606556]  mmcblk0: p1

sudo cfdisk /dev/mmcblk0 gives me a partition and some empty space:

                           cfdisk (util-linux 2.21.2)

                            Festplatte: /dev/mmcblk0
                       Größe: 2007498752 Bytes, 2007 MB
               Köpfe: 28   Sektoren pro Spur: 27   Zylinder: 5186

    Name        Flags      Part. Typ  Dateisystemtyp   [Bezeichner]  Größe (MB)
 -------------------------------------------------------------------------------
                            Pri/Log   Freier Bereich                       0,14 *
    mmcblk0p1   Boot        Primäre   vfat                              2007,37 *

But sudo parted /dev/mmcblk0 print shows only one partition:

Modell: SD SDC (sd/mmc)
Festplatte  /dev/mmcblk0:  2007MB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos
Disk Flags: 

Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
 1      131kB   2007MB  2007MB  primary  fat16        boot

It is no problem to mount the card with sudo mount -o uid=erik /dev/mmcblk0p1 /mnt/test/ and listing the cards root directory: [erik@mars test]$ ls -l /mnt/test/

insgesamt 96
drwxr-xr-x. 254 erik root 32768 16. Feb 12:34 DCIM
drwxr-xr-x. 224 erik root 32768 16. Feb 12:34 MISC
-rwxr-xr-x.   1 erik root   512 16. Feb 12:34 NIKON001.DSC

But when I try to list the content of the directories on the card via ls, it takes forever and dmesg shows this:

[  337.246359] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[  337.246372] FAT-fs (mmcblk0p1): Filesystem has been set read-only
[  347.729392] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)

Question: Any idea, what the problem could be? Why is the cards contents readable in the camera but not within windows or linux with a card reader (builtin in notebook or external usb card reader).

Is it maybe not vfat/fat32 formatted? What else should I try?

Update

I managed to download the pictures with photorec.

  • After that I formatted the card with mkfs.vfat (linux), but it was not recognized in the camera.
  • I then formatted the card with windows explorer. But the camera again claimed, that the card was not formatted and asked me if it should be formatted by the camera.

This time I selected yes, took a test photo and inserted the card in the card reader again. Now all directories were readable. cfdisk showed me, that it was formatted as vfat again. Strange …

share|improve this question
    
I'm guessing the file system is corrupt. If you need those images then maybe try a recovery tool like piriform.com/recuva or cgsecurity.org/wiki/PhotoRec. What digital camera is it BTW? –  James Mar 11 '13 at 15:11
    
I’ve used photorec to recover the photos. But still I am curious, what happened to the card and why it was readable by the camera but neither by linux nor windows. The camera is a Nikon 3700. –  erik Mar 11 '13 at 17:27
    
Wow that is an old camera - it's 10 years old. I suspect it might be struggling a bit because SD cards have changed a lot since then - there are newer standards like SDHC. I'm not sure it would even support FAT32 and/or cards over a few gigabytes. What capacity is the card? –  James Mar 11 '13 at 17:34
    
The card has 2 GB. And FAT32 was nothing new 10 years ago. Maybe 20 (18) years ago it was new. –  erik Mar 11 '13 at 18:40
1  
Back in 2003 most SD cards were probably only 16-64MB which was well below the limit of FAT16. Indeed, the original SD spec only allowed for cards with a maximum of 1-2GB. You are finding that the camera can only use the card if it formats it itself, so clearly it has some limitation about what it supports. If you read the article here it explains about the limitations of the original SD spec and the fact that FAT16 was standard until SDHC: en.wikipedia.org/wiki/Secure_Digital. –  James Mar 12 '13 at 9:33
add comment

2 Answers

This isn’t a good answer, but –– it may have something to do with the amount of data (or, to be more precise, the number of files) on the card.  I’m struck by the fact that both the DCIM and MISC directories are 32768 (215) bytes long, and DCIM has a link count of 254 (28–1).  Maybe the FAT32 software in the camera is buggy and writes the images to the card in a non-standard way when such high-water marks are hit –– in a way that it can read, but the Windows and Linux OSs cannot.  (Or maybe the FAT32 specification has subtly changed in the past 10 years, so the camera is actually behaving correctly with respect to the specs that were in force when it was built.)

If you plan on continuing to use the camera, I suggest that you avoid letting so many photos accumulate on one card.

share|improve this answer
    
These numbers have to be wrong because it were only about 400 photos on the camera. –  erik Oct 18 '13 at 7:35
add comment

It sounds like the SD card may be corrupt and needs reformatted.

If you need to get the pictures off first, you may be able to put the SD card in the camera, and then mount the camera as an external storage device via USB to transfer the files off the card (assuming your camera has a port that allows for USB transfer).

share|improve this answer
    
The camera needs a cable with micro usb connector, which I don’t have. But I managed to get the pictures with photorec. After that I formatted the card with mkfs.vfat (linux), but it was not recognized in the camera. I then formatted the card with windows explorer. But the camera again claimed, that the card was not formatted and asked me if it should be formatted by the camera. This time I selected yes, took a test photo and inserted the card in the card reader again. Now all directories were readable. cfdisk showed me, that it was formatted as vfat again. Strange … –  erik Mar 11 '13 at 17:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.