[Q] How do I stop automatic external SD mounting?

jim333

Member
Jul 14, 2011
12
2
0
I am having issues with external SD cards. I have 16 and 32 gb cards and every 2-5 days they become corrupted/damaged/blank. I have to format them and copy my backup files over at least once per week. I have had no luck finding a good solution for the SD card problems. I notice that my SD card will randomly mount / media scan / antivirus SD card scan when I unlock my screen. I assume this is causing the problems. I want to leave my external SD card UNmounted until i want to use it, then i will manually mount it under settings. My problem is when i leave it unmounted, Android will automatically mount it later when my screen is off. How do i change this so that the external SD will ONLY mount when i manually mount it in settings?
 
Last edited:
  • Like
Reactions: MTranceAvB

jim333

Member
Jul 14, 2011
12
2
0
the antivirus isn't the problem, randomly whenever the screen is turned on, the micro SD re-mounts (it somehow unmounted when the screen was off)... when it re-mounts Android automatically does a media scan and my AV scans it like it just connected... over time the SD card fails or becomes corrupted so I have to format. I'm looking for a way to DISABLE Android from automatically mounting an external micro SD... I assume people on this forum are knowledgeable on Android coding... disabling this function shouldn't be that hard...
 
Last edited:

jim333

Member
Jul 14, 2011
12
2
0
i have tried that several times.... perhaps i need to re-phrase the question....

Can someone please copy and paste the code within Android that automatically mounts an external SD card when it is inserted while the phone is on. Please also include the file name and directory. Thanks!
 

Phalanx7621

Senior Member
Jul 17, 2011
4,988
2,255
0
Bethany Beach, Delaware
Well the problem is it's clearly either a hardware problem in the phone or that sd card. Wouldn't it be less of a pain to diagnose that and just try several other sd cards, then you wouldn't even have the issue anymore.
 

SteveMurphy

Recognized Contributor
Apr 22, 2012
1,656
2,702
153
Atlanta
I am in the same situation please provide a fix if you got it fixed
What ROM are you on? Do you have this device? Some newer ROMs have the ability to control the media scanner running at boot, which likely was the cause for these older issues.

An example of a current ROM having this is ResurrectionRemix.
 
Last edited:
  • Like
Reactions: creepyncrawly

ryvandal

Senior Member
Nov 30, 2012
67
4
0
What ROM are you on? Do you have this device? Some newer ROMs have the ability to control the media scanner running at boot, which likely was the cause for these older issues.

An example of a current ROM having this is ResurrectionRemix.
Rom is stock Android 4.4.

Does 4.4 have that feature? I am Rooted.
 

SteveMurphy

Recognized Contributor
Apr 22, 2012
1,656
2,702
153
Atlanta
Rom is stock Android 4.4.

Does 4.4 have that feature? I am Rooted.
Stock will not have it, you will need to install a custom ROM that includes the Media Scanner setting (there are KK ROMs that support it). Look around in the Development forum and see if one is to your liking; if the ROM has the feature they will often include it in the first post. The Ported forum also has much to choose, including the ROM I noted in my reply above yours.
 
  • Like
Reactions: creepyncrawly
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone