4

When mounting my SD Card on my galaxy SIII files and folders in the card with characters that aren't in the ASCII range get corrupted. This happens by simply selecting 'Unmount card' in the Storage settings and mounting back. No need to physically remove the card and putting it back in. Turning the phone off and back on results in corruption as well.

Folders when viewed with a file manager on the phone show up as 0-size files with a date of Dec 31, 1969 (which is the linux epoch) and can't be navigated into to see their contents. They shw as empty folders. Files turn to size zero with that same date and can't be opened nor show in Gallery, music player etc. They open as an empty folder. (See image below)

I am using stock Android version 4.1.2.

The card is a SanDisk 64gb micro sdxc card (class 10). The issue ocurred when the card was factory-formated (with exFAT) and also after formating with the phone (settings > storage).

Examples of filenames that cause folder corruption are "Aṣa" or "דניאל". It makes no difference if the file was copied to the card using usb transfer or by taking the card out and using a reader on a Windows PC, or if the name was changed (using the phone) once the file was on the card.

Files with those same names don't get corrupted if they are in the internal phone memory and I can use them without problem.

When taking the card out and using it on a PC with Windows 7 files can be seen. But sometimes the affected folders appear duplicated. That is, twice with the same name both. Checking the disk with windows reports errors and attempts to fix them. But then when putting the card back in the phone the files are corrupted again.

How can I prevent this corruption from happening?

This is how the file manager shows the corrupted file or folders

Update: with a 2GB card formated with FAT32 files didn't get corrupted. But after I formatted it to exFAT I could reproduce the file corruption. I think I can rule out a bad sd card.

More info, this is a report from Windows 7 after running checkdisk. Note that the 3 files existed in the TestFolder directory, which was corrupted:

[Window Title]
Checking Disk Removable Disk (M:)

[Main Instruction]
Some problems were found and fixed

[Content]
Any files that were affected by these problems were moved to a folder named "Found" on the device or disk. Your device or disk is now ready to use.

If you removed the device or disk before all files were fully written to it, parts of some files might still be missing. If so, go back to the source and recopy those files to your device or disk.

[^] Hide details  [Close]

[Expanded Information]
Volume Serial Number is 6518-E54A
Windows is verifying files and folders...
Corruption was found while examining files in directory \TestFolder\ (0).
Corruption was found while examining files in directory \TestFolder\ (3).
Corruption was found while examining files in directory \TestFolder\ (6).
Corruption was found while examining files and directories.
File and folder verification is complete.
Windows has made corrections to the file system.

  62363648 KB total disk space.
  41656576 KB in 43 files.
       768 KB in 6 indexes.
       256 KB in use by the system.
  20706048 KB available on disk.

    131072 bytes in each allocation unit.
    487216 total allocation units on disk.
    161766 allocation units available on disk.

Folders don't get corrupted if they are created on the phone with hebrew names, then unmounted and checked on windows. Only after re-mounting on the phone.

MORE DATA: this is I think relevant info from adb logcat:

I//system/bin/fsck.exfat( 1897): fsck.exfat 1.1.0p2

I//system/bin/fsck.exfat( 1897): [fsck] Invalid dir entry: (92675,0)
I//system/bin/fsck.exfat( 1897): [fsck] Wrong dir entry name hash
I//system/bin/fsck.exfat( 1897): [fsck] Successfully recovered

I//system/bin/fsck.exfat( 1897): Filesystem was modified.
I/logwrapper( 1897): /system/bin/fsck.exfat terminated by exit(4)

W/Vold    ( 1897): exfat -> Filesystem modified - rechecking (pass 2)
E/Vold    ( 1897): MDM :: sdCardWriteAccessBlocked 0
D/Vold    ( 1897): Detected exFAT file system.

And when booting without problematic filenames I instead get a cute little

I//system/bin/fsck.exfat( 1897): No errors
I/Vold    ( 1897): exfat -> Filesystem check completed OK 

And from adb shell I can try and see the troublemakers (after remount, note 2 directories with apparently the same name, which in a windows console seems to be output as 2 characters per unicode character):

shell@android:/storage/extSdCard/Test $ ls * -l
ls * -l
drwxrwxr-x system   media_rw          2013-02-18 18:39 אבג
אבג: No such file or directory
1|shell@android:/storage/extSdCard/Test $
11
  • From a first glance I'd say this has to do with incompatible character sets used (UTF8 on Android's side, and whatever Windows-specific charset on the PC) -- but file names look spelled correctly on your screenshot... Non-ASCII characters in file names seem to cause a lot of trouble in some cases (this is not the first I see this week), which is why I try to avoid them as far as possible. Luckily my Ethnix albums all use strict ASCII 7bit in the file names :)
    – Izzy
    Commented Feb 14, 2013 at 14:01
  • 1
    @izzy One thing I'll have to update the question with is that the problems happen even if the card is never used on windows. Files created on the phone and then renamed to hebrew get corrupted on next card mount. Files in internal storage are fine.
    – frozenkoi
    Commented Feb 15, 2013 at 0:56
  • That's in fact an important fact to include! So it affects only the external sdcard -- internal "sdcard" (the SGS3 has such?) has no such trouble, neither has "phone memory" (if you are able to test)? In this case it looks like a bug with either mount or fsck in combination with [ex]FAT. Question is: Does it happen at mount time, or at unmount (i.e. after unmounting, taking the card out and use a card reader on your PC, are they already scrambled)?
    – Izzy
    Commented Feb 15, 2013 at 7:28
  • @Izzy I added that information. Corruption happens on mount, not on unmount.
    – frozenkoi
    Commented Feb 16, 2013 at 2:27
  • In StickMount (an app to mount flash drive), there is an option saying "use UTF8 IO if supported by kernel". Will this be some clue?
    – Narayanan
    Commented Feb 16, 2013 at 3:38

4 Answers 4

1

I updated my S3 from Android 4.1.2 (stock Samsung ROM) to 4.3 a couple of days ago. The problem had happened consistently for me for a year and a half, exactly as described above, in two 4.0.x (ICS) versions as well as in Jelly Bean 4.1, but in 4.3 it appears to finally been fixed: After the update I copied many files with Unicode Hebrew names to my microSD card, and they have survived numerous unmount/remounts of the card & phone restarts with no issues.

Incidentally, another issue I had been encountering was that automatic rescans of the media folders on the card (done by Android's "Media Storage" system app), which occur every time a card is inserted or the phone is disconnected from USB, were taking a very long time (sometimes hours). This in turn caused issue with syncing my large music library between my Mac & phone using the iSyncr utility. This issue has also completely gone away, and I suspect that the Android media scanner wasn't dealing well with the corrupted files.

Additional Details: Phone: GT-I9300 International version, unrooted, running the official Israeli unbranded Samsung firmware. Card: SanDisk 64GB Class 10 (same as original asker's IIUC), formatted to exFAT on a Mac. I didn't even bother reformatting after the 4.3 upgrade -- I simply mounted the card on the Mac in order to erase all the existing corrupted 0-length files, which as noted cannot be deleted by the various Android file utilities.

2
  • Good to hear. I'm still waiting for the update to be available for my carrier.
    – frozenkoi
    Commented Mar 16, 2014 at 1:33
  • The update was made available a couple of days ago for the carrier my phone is enslaved, I mean, locked to. Have been able to keep my files so far.
    – frozenkoi
    Commented Apr 16, 2014 at 17:06
2

I have experienced the same with my 32gb Sandisk Micro SD card 10 class using in the Galaxy Tab 2. The SD card is genuine so I know that's not the issue.

However, I have found this to work for me.

  1. Format the card on your PC or Mac, to NTFS file system.
  2. Download Paragon NTFS / HFS apk app for your Android device
  3. Without ANY NTFS app for the android, the android WILL NOT recognise the inserted SD card format as the android only recognises FAT file system
  4. Put the Micro SD card into the device and restart the device (if the card icon shows in the notification bar, bottom right, ignore)
  5. Goto and open on Android Paragon NTFS / HFS tool apk and check disk / format using the android app
  6. Restart device again, with SD card inserted, leave card inserted and connect Android device to PC, the External Disk should now be available formatted to NTFS

The card should AUTO MOUNT via the Paragon NTFS app when the device is turned on.

I've tried every method possible to have the SD card in the FAT 32, but it just doesn't last, folder names change, files disappear.

0

According to the Samsung site it was a bug that is now fixed and due to be released in the next firmware update (whenever that might be).

-3

You have no other solution but to buy another one. You're welcome. ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .