Can't share SD card between Android and GNU/Linux
I'm having some weird problem with an SD card being rejected by Android (Replicant, Marshmallow) as "corrupted" when it is not. I typically move this card between a camera, my laptop, and Android and as it was called "corrupted" I decided to move everything off, overwrite the entire space, and re-format. The camera expects a particular UID, so I had to manually edit the FAT32 partition's identifier. What I'm finding out is that Android accepts this card when I use a new UID, but when I specify the old one, it is automatically corrupt.
Is there any way to completely reset Android's knowledge of SD cards? Something seems off here. |
Are you formatting the card on the camera or the android device?
|
try formatting your SD card and choosing FAT instead of NTFS, FAT seems to be more friendly towards mobile devices
|
Quote:
here: Quote:
|
Hmmm.
Quote:
Take my post with a grain of salt. These waters I am in are deeper than I am used to. |
I would expect a camera and an android to format sdcards as FAT.
You need to unmount fat partitions because they automatically set (and ignore) a 'dirty' bit. Then when you unmount it, it clears that 'dirty' bit. If you don't unmount it, the next OS will wag fingers at you. It's a pain, nothing to go reformatting about. Just repair it. |
Not to bump an old thread, but having run into this issue again, I thought I would share my findings in case anyone else has this problem too.
Android has two ways of dealing with removable SD cards, one which uses it as storage for installed apps, and another which treats it as a removable flash drive. If you insert an SD card into your Android device that was formatted and filled with data elsewhere, it will be treated as the second. In this case, if an app tries to store its own data on the SD card (either on its own will or if you tell it to), Android will no longer be able to tell which of the two ways it should treat the SD card. If you go through the system logs using logcat, you will probably see something like Code:
11-28 00:15:02.175 1934 1986 E cutils : Failed to lstat(/mnt/runtime/write/F045-D0FA): Transport endpoint is not connected The solution to this problem is: 1. Uninstall whatever app tried to write to the SD card (meaning, whatever app tried to write to your 'removable' sd card while treating it as 'internal storage'. (First back up any necessary data, of course.) 2. Make sure the SD card is physically removed. 3. Reboot the device. 4. Re-insert the SD card. It shouldn't be marked as 'corrupted' anymore. For this scenario, rest assured, your SD card is certainly NOT corrupted, so don't take Android up on its offer to format your SD card. In my case, I dropped my supposedly corrupted SD card into another identical phone, and it was read without issue. Likewise you do not need to alter the UUID. This issue in 2021 is still found in the latest Replicant images. So it is still a relevant problem to be watched out for. |
All times are GMT -5. The time now is 05:35 PM. |