3

i am using samsung s2 and a custom rom, external sd card is mounted to /emmc but i want it to mount to /mnt/sdcard/external_sd, how could i mount it using init.d?

i made a file called "99mount" with a the content

mount -o bind /emmc /mnt/sdcard/external_sd

however, it isn't being executed an start tried also

busybox mount -o bind /emmc /mnt/sdcard/external_sd

and no luck, do i need to add 99mount to some xx.rc file?

Izzy
  • 91,536
  • 76
  • 351
  • 968
Joe
  • 209
  • 1
  • 2

1 Answers1

3

Your SD card isn't prepared at the time that the bind command is executed, because the mounting process hasn't ended yet. To bind, you have to wait several seconds for the mounting of SD card & external SD to be finished.

#!system/bin/sh    
sleep 10    
n="$(dumpsys mount | grep -c 'external')"    
until [ $n -eq 1 ]    
do    
sleep 1    
n="$(dumpsys mount | grep -c 'external')"    
done    
mount -o bind source target

Note: n="??" is changeable by according to your own system.

bmdixon
  • 8,805
  • 17
  • 44
  • 64
lazypawn
  • 31
  • 2