"Error: bad cluster 0xc0000000" on exfat SD card

Bug #1728687 reported by Renardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
exfat-utils (Ubuntu)
New
Undecided
Unassigned

Bug Description

For my digital camera I use a micro SD flash card that came formatted with exfat. Reading this card with a card reader under Ubuntu 17.10 used to work fine, and I could also write GPS assist data onto the card.

Now pictures have accumulated on the card, and for the first time I removed files from the card (under 17.10). The card still worked in the camera but when I put it into the card reader again, nautilus told me
    Error mounting /dev/sdb1 at … Command line 'mount -t "exfat" -o uhelper=udisks2,nodev,nosuid,uid=1007,gid=1007,iocharset=utf8,namecase=0,errors=remount-ro" "/dev/sdb1" /media/…/…
    stdout: FUSE exfat 1.2.7
    stderr: ERROR bad cluster 0xc0000000 while reading root directory

I tried three different card readers and also tried mounting the SD card under MS Windows. The result is the same. Linux and Windows cannot read the card, the camera can read and write it.

My guess is that deleting files from the SD card corrupted the file system.

fdisk says:
    Disk /dev/sdb: 59,5 GiB, 63864569856 bytes, 124735488 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x00000000

gparted days:
    unavailable unavailable 16.00 MiB
    /dev/sdb1 exfat 59.64 GiB

exfatfsck says:
    exfatfsck 1.2.7
    Copyright (C) 2011-2017 Andrew Nayenko

Revision history for this message
Andrew Nayenko (relan) wrote :

Hi Renardo,

I'm fuse-exfat developer. Do you remember how many files and directories were there in the root directory? Could you post the output of

    dumpexfat -s /dev/sdb1

It will print filesystem details.

Revision history for this message
Renardo (renardo) wrote :

Hello Andrew, thanks for your reply. Here is the output from dumpexfat:

    Volume serial number 0x61613331
    FS version 1.0
    Sector size 512
    Cluster size 131072
    Sectors count 124702720
    Clusters count 486992
    First sector 32768
    FAT first sector 16384
    FAT sectors count 16384
    First cluster sector 32768
    Root directory cluster 4
    Volume state 0x0002
    FATs count 1
    Drive number 0x80
    Allocated space 100%

The card content was the usual Panasonic directory structure with JPEG files in subdirectories of DCIM; when a subdirectory reaches 1000 files a new one is created. I restored my pictures with testdisk, so I can tell there were 7069 pictures in 8 directories – but that includes those that I had deleted and which were partly also restored by testdisk.

Here is the directory structure; I think I had deleted 124_PANA, 125_PANA, and 126_PANA but am not exactly sure:

 - AD_LUMIX
   - GPSDATA.DAT
   - GPSDATA20171027.DAT
 - DCIM
   - 124_PANA (642 pictures restored)
   - 125_PANA (993 pictures restored)
   - 126_PANA (998 pictures restored)
   - 127_PANA (993 pictures)
   - 128_PANA (997 pictures)
   - 129_PANA (996 pictures)
   - 130_PANA (998 pictures)
   - 131_PANA (452 pictures)
 - MISC (empty, not restored)
 - PRIVATE (Panasonic proprietary data)

I suppose that the deleted 124_PANA also had contained almost 1000 pictures but that many could not be restored because their space had been used to store new pictures.

Anything else I can do?

-- Renardo

Revision history for this message
Renardo (renardo) wrote :

I had overlooked one thing: The root directory contained not only the four directories mentioned but also a small text file called nomo.txt. (Had added that myself.) -- Renardo

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.