0

I wanted to mount an sdcard. Upon inserting the dmesg logs gives me this:

[Thu Oct 25 10:59:44 2018] sd 0:0:0:0: [sdb] 30318592 512-byte logical blocks: (15.5 GB/14.5 GiB)
[Thu Oct 25 10:59:44 2018]  sdb: sdb1

Looks fine, but when I want to mount it, it fails, using command sudo mount /dev/sdb1 /mnt/sdcard, this is the dmesg output:

[Thu Oct 25 10:59:55 2018] FAT-fs (sdb1): error, invalid access to FAT (entry 0x00038a03)
[Thu Oct 25 10:59:55 2018] FAT-fs (sdb1): Filesystem has been set read-only

Can somebody tell me what's wrong? I don't want to format the card as I would lose all the data.

  • 1
    Not sure if that applies here, with openSUSE I had to install exfat-utils to be able to mount FAT. – eblock Oct 25 '18 at 9:17
1

Reading the Linux kernel source at <source code root>/fs/fat/fatent.c reveals that the message might be somewhat poorly worded: it actually means the FAT entry being accessed is not passing a validity check.

You might want to unmount the card and then run fsck.fat -n /dev/sdb1 to evaluate the health of the filesystem on the card, and then perhaps run fsck.fat -aw /dev/sdb1 to attempt to fix it.

Before attempting to fix the filesystem, if the files in it are important, you might want to make and image file of the contents of the card: dd if=/dev/sdb1 of=/some/place/with/plenty/of/space/sdcard.img bs=16k

0

My first thought was that it might be due to the SD card's locking mechanism, but I Googled around a bit, and it sounds like this is the message you get when Linux tries to read corrupted data from a FAT partition. I would try an fsck. If that doesn't fix it, then you might not have a choice but to reformat. It might still be possible to recover some data, though, if the SD card is indeed at least mounting read-only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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