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
(https://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
(https://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
. – Irfan Latif Aug 24 '21 at 17:210x83
in case of MBR ... – Irfan Latif Aug 25 '21 at 10:140FC63DAF-8483-4772-8E79-3D69D8477DE4
in case of GPT). Readfdisk
/gdisk
manuals to know how to set these identifiers. // As far as the auto-mounting of second partition is concerned, yes you are correct. Recent Android releases support auto-mounting multiple partitions from SD card or USB. But at leastext4
is not supported (onlyFAT
andexFAT
are), as evident from here ... – Irfan Latif Aug 25 '21 at 10:15