Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently obtained an older Android phone, so that I could test Android Apps on it. I've needed it because I have a Nexus 7 but not older Android versions, hardware, etc. to test on.

I'm having a problem with it under Linux Mint with Cinnamon. When I plug the phone in, or remove and plug the sdcard from the phone back to it while the phone is plugged in, Linux automatically mounts the sdcard. This is a problem because once it is mounted under Linux, it dismounts from the phone running Android 2.3.5, and I can no longer test Android Apps I write that require the sdcard to be present, writable.

I went to Menu > System Tools > System Settings > System > Details > Removable Media, and it brings up this window.

Removable Media Settings

I have changed the settings to always "Ask what to do" on "Select how media should be handled". However, the sdcard still gets mounted and then I am asked how I want to open these files (media players, photo importers, file browser, etc.). If I click the checkbox for "Never prompt or start programs on media insertion", then the sdcard is mounted, and I am not asked how to open these files.

Prompt, AutoMount

Eject is just a noob word for Ubuntu users that means umount (unmount) like "Adminstrator" is another ubuntu noob word for the root user. And if I unmount the sdcard, the phone doesn't recognize it again until I take the sdcard out and plug it back in. The phone sees it for a brief moment until Linux Mint takes it over.

There are 2 possible solutions and maybe more:

1) Prevent Linux from automounting sdcards some how

2) Tell Android not to allow the computer it is plugged into to take over the sdcard, HOW?

Edit:

I found out how to prevent the sdcard from being automatically mounted:

dconf-editor

Now it gets recognized by Linux:

bullshark@beastlinux ~ $ dmesg | tail -n 25
[597212.218323] sd 21:0:0:0: [sde] Attached SCSI removable disk
[597212.218639] sr 21:0:0:1: Attached scsi CD-ROM sr2
[597212.218910] sr 21:0:0:1: Attached scsi generic sg7 type 5
[597217.139373] sd 21:0:0:0: [sde] 3862528 512-byte logical blocks: (1.97 GB/1.84 GiB)
[597217.140726] sd 21:0:0:0: [sde] No Caching mode page present
[597217.140735] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597217.143595] sd 21:0:0:0: [sde] No Caching mode page present
[597217.143602] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597217.152240]  sde: sde1
[597389.751008] 4:2:1: cannot get freq at ep 0x84
[597390.238742] 4:2:1: cannot get freq at ep 0x84
[597624.903132] sde: detected capacity change from 1977614336 to 0
[597637.677763] sd 21:0:0:0: [sde] 3862528 512-byte logical blocks: (1.97 GB/1.84 GiB)
[597637.679616] sd 21:0:0:0: [sde] No Caching mode page present
[597637.679626] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597637.682508] sd 21:0:0:0: [sde] No Caching mode page present
[597637.682515] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597637.692758]  sde: sde1
[597661.857979] sde: detected capacity change from 1977614336 to 0
[597688.775455] sd 21:0:0:0: [sde] 3862528 512-byte logical blocks: (1.97 GB/1.84 GiB)
[597688.776814] sd 21:0:0:0: [sde] No Caching mode page present
[597688.776823] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597688.780055] sd 21:0:0:0: [sde] No Caching mode page present
[597688.780062] sd 21:0:0:0: [sde] Assuming drive cache: write through
[597688.788639]  sde: sde1
bullshark@beastlinux ~ $ 

However, the phone still unmounts the sdcard upon being detected by Linux.

enter image description here

Linux detects but does not mount, and a few seconds later:

enter image description here

Edit #2 (Solution):

I solved this one by changing the usb connection type (was usb mass storage) :

enter image description here

share|improve this question

migrated from stackoverflow.com Apr 13 '13 at 0:17

This question came from our site for professional and enthusiast programmers.

    
Am I at the wrong *flow site for Linux Gurus? –  BullShark Apr 12 '13 at 23:14
    
Hi! Welcome to StackOverflow! StackOverflow is for programming questions, and this is not a programming question. Please use other sites, like android.stackexchange.com, for non-programming Android questions. –  CommonsWare Apr 12 '13 at 23:15
    
I think it's gnome-volume-manager that needs to be killed/stopped to prevent the auto mounting. –  Petesh Apr 12 '13 at 23:17
    
I have no android experience, but regular Linux distributions have a file /etc/fstab which supports the noauto flag as an option. –  Hennes Apr 13 '13 at 0:19
    
noauto won't work. from man fstab, "noauto do not mount when "mount -a" is given (e.g., at boot time)" –  BullShark Apr 13 '13 at 7:06
show 1 more comment

1 Answer

Linux Mint Cinnamon is a fork of the Gnome Shell and I found that gsettings was installed by default. That is why

gsettings set org.gnome.desktop.media-handling automount false

worked in my case to prevent the OS from auto-mounting SD cards.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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