2

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 …

erik
  • 2,028

2 Answers2

1

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.

0

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).

Nick Orlando
  • 599
  • 1
  • 5
  • 14