Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fake a sdcard device with a loopback device on android

Tags:

linux

android

Yesterday I decided to fix the internal front speakers of my "HTC Desire Z" (aka. G2). While I was able to fix them, I broke the connector for the microSD slot (the left one). After trying to fix it for several hours, I gave up. It isn't in the scope of my hardwareskills :-(

Well, since I have like 600mb left on /data and my device is rooted, I tried to find a software solution i.e. "emulate" a SDcard device (because many applications require one to work properly, e.g. the camera app). I found here http://www.android-x86.org/documents/sdcardhowto a description how to create a vfat image and mount it as loopback.

While this is exactly what I want, I don't get it to work:

  1. I don't know how to modifiy /proc/cmdline, or
  2. how the entry in /etc/vold.fstab should look like.

dev_mount sdcard /mnt/sdcard auto /data/sdcard.img didn't work for me. according to logcat, I have this version: I/Vold ( 2368): Vold 2.1 (the revenge) firing up

btw, just mounting the loopback device to /mnt/sdcard didn't work too. For example, the camera app still claims there isn't a SD card inserted.

edit: I also asked this on xda -> http://forum.xda-developers.com/showthread.php?t=1393395

like image 870
lewurm Avatar asked Dec 07 '25 20:12

lewurm


1 Answers

There's no way for an Android application (constrained within the application sandbox) to create a loopback device.

Anything outside of this is not a developer question, and should be posted to another forum (e.g. https://superuser.com/).

like image 119
Trevor Johns Avatar answered Dec 09 '25 13:12

Trevor Johns



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!