9

On the emulator, I can unmount the SD card from the Settings.

I can then mount it on my OS, then unmount it normally.

I haven't been able to figure out how to re-mount it then on the emulator (without rebooting it).

hints:

  • the adb command remount is unrelated: it's about /system
  • the emulator command is unrelated: it's only about starting the emulator
  • mounting the SD card in two places of course messing everything up (I tried)

more:

  • mount outputs the following:

    /dev/block//vold/179:0 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

  • trying to mount again from the shell after unmounting it, using the same options as above, gives a segfault

  • no idea why the double slash in block//vold, I guess it's just a typo
Simon Hayter
  • 3,131
  • 27
  • 53
o0'.
  • 11,739
  • 19
  • 60
  • 87

2 Answers2

10

The developers guide suggests that this isn't possible:

SD Card Emulation

You can create a disk image and then load it to the emulator at startup, to simulate the presence of a user's SD card in the device. To do this, you can use the android tool to create a new SD card image with a new AVD, or you can use the mksdcard utility included in the SDK.

The sections below describe how to create an SD card disk image, how to copy files to it, and how to load it in the emulator at startup.

Note that you can only load disk image at emulator startup. Similarly, you can not remove a simulated SD card from a running emulator. However, you can browse, send files to, and copy/remove files from a simulated SD card either with adb or the emulator.

The emulator supports emulated SDHC cards, so you can create an SD card image of any size up to 128 gigabytes.

While Android will unmount the SD card, the emulator process keeps the backing file open.

$ ls -go /proc/`pidof emulator`/fd | grep sdcard.img
lrwx------ 1 64 2010-05-13 01:50 10 -> /home/x/.android/avd/WithSD.avd/sdcard.img

Someone more familiar with QEMU may be able to provide further insight but, if I were you, I would just try to use NFS to solve this problem.

Tim Kryger
  • 11,166
  • 4
  • 52
  • 41
  • Hmm. I've had no trouble doing this, after unmounting by going to Settings -> SD card -> Unmount. But I concede I may just have been lucky. – telent Oct 05 '10 at 11:57
  • Note that as of the 4.1.2 System Image, there is no more Settings -> SD card, but Settings -> Storage and there is no more Unmount option, only "Erase SD Card." So that workaround is no longer possible with the Emulator and this must be done on a device. – louielouie Nov 25 '13 at 16:35
-1

I tried going to Settings and unmounting the SD card and this worked fine. Give it a try; remounting it is quite simple.

Doesn't seem like this can be done via adb/cli though.

Michael De Silva
  • 3,808
  • 1
  • 20
  • 24
  • I was simply confirming what @telent mentioned above; read the third line, "I haven't been able to figure out how to re-mount it then on the emulator (without rebooting it)." - he seems to indicate he had trouble remounting even within the OS, let alone via adb. – Michael De Silva Dec 22 '10 at 15:56
  • Exactly: it can't be remounted. Which is what I asked. So what's the point of this answer? *I'm sorry to be rude, really.* – o0'. Dec 29 '10 at 16:00