My Galaxy S9+ running Android 10 crashes whenever I insert my microsd card containing upwards of 9000 sub-directories and 92000 files. The SDCard is using 330GB out of 400GB.
Basically the way this happens is that I insert the sdcard and then a notification displays saying "Checking SanDisk SD card... Reviewing current content
Obviously some kind of timeout is occurring when android attempts to scan the sdcard. I have tried to disable the scanning a number of ways, making all the sub-directories hidden by prefixing them with a dot, putting a .nomedia file in every sub-directory and by not using any sub-directories and instead having all the files loose in the top level of the sdcard. This last "solution" actually works to stop the crashing but is unacceptable to me.
Basically my question boils down to this: Is there any way to disable android scanning the sdcard upon boot and when it is inserted ? I have rooted my phone so I could make modifications to the system to achieve this.
I simply want the sdcard to be usuable like on my linux desktop computer, I insert the sdcard, browse it with a file browser, and that's it. I don't want anything to happen by itself when it is inserted, no scanning, no indexing, nothing!
The MicroSD Card is formatted as exFAT
fstab
(android.stackexchange.com/a/217355/218526) or create a small first partition on SD card which gets auto-mounted, and not the second one. Another option is to format the SD card with a filesystem which isn't supported on SD card e.g.ext4
(android.stackexchange.com/a/220020/218526) but it can be mounted manually. Another option is to use a partition ID which isn't supported byvold
.