2

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

8
  • There is one major problem: the indexing operation builds the AndroidMedia database. This database is the only way to write to the sd-card for apps without root option. A lot of apps also use this database for finding files as direct file-system access is more and more reduced in newer Android versions. Therefore if the sd-card is not indexed then some apps may not be able to find some the files on this card or even add new files.
    – Robert
    Aug 24 '21 at 15:46
  • I don't need any apps without root access to be able to write to the sd-card, I use rsync with root access to write into the top level of the sd-card or I can just write on the sd-card from my PC. The only app I use to access this sd-card for reading is gonemad media player which can simply access a folder, no indexing required.
    – ploprof
    Aug 24 '21 at 16:00
  • So if you know how to disable this indexing, please let me know ! :)
    – ploprof
    Aug 24 '21 at 16:01
  • 2
    Disable auto-mounting of SD card and mount it manually. To disable auto-mounting edit 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 by vold. Aug 24 '21 at 17:21
  • So I am trying what you suggested now, what kind of partition ID is not supported by vold ? making a small first partition on the sdcard surprisingly doesn't stop the phone from auto-mounting in my case, the phone simply mounts both partitions even if one is ext4, and I don't really want to mess with the fstab so I think the partition ID trick could be my best option
    – ploprof
    Aug 24 '21 at 18:50
0

Irfran Latif's comment answered my question, I ended up mounting formatting the SDCard as ext4 and mounting it from the command line with appropriate namespaces and permissions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.