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
11-28 00:15:02.175 1934 1986 V vold : /dev/block/vold/public:179_17: UUID="F045-D0FA" TYPE="vfat"
11-28 00:15:02.175 1934 1986 E vold : public:179_17 failed to create mount points: Transport endpoint is not connected
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {652 public:179_17 vfat}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {653 public:179_17 F045-D0FA}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {654 public:179_17 sdcard1}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {656 public:179_17 /mnt/media_rw/F045-D0FA}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {655 public:179_17 /storage/F045-D0FA}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {651 public:179_17 6}
11-28 00:15:02.175 2372 2485 D VoldConnector: RCV <- {400 23 Command failed}
11-28 00:15:02.180 2372 2484 D MountService: Volume public:179_17 broadcasting checking to UserHandle{0}
11-28 00:15:02.180 2372 2484 D MountService: Volume public:179_17 broadcasting unmountable to UserHandle{0}
11-28 00:15:02.180 2372 2392 I ActivityManager: Killing 9966:com.android.shell/2000 (adj 13): empty for 1802s
11-28 00:15:02.215 2549 2549 D StorageNotification: Notifying about public volume: VolumeInfo{public:179_17}:
11-28 00:15:02.215 2549 2549 D StorageNotification: type=PUBLIC diskId=disk:179_16 partGuid=null mountFlags=VISIBLE
11-28 00:15:02.215 2549 2549 D StorageNotification: mountUserId=0 state=UNMOUNTABLE
11-28 00:15:02.215 2549 2549 D StorageNotification: fsType=vfat fsUuid=F045-D0FA fsLabel=sdcard1
11-28 00:15:02.215 2549 2549 D StorageNotification: path=/storage/F045-D0FA internalPath=/mnt/media_rw/F045-D0FA
Of note is the part "Transport endpoint not connected" and the SD card being flagged as unmountable.
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.