• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Mod]Externel2internal

the original script should allow for this to work:

Code:
#!/system/bin/sh

# Wait for the system to mount the internal media and remout it as r/o
# this should prevent the system from writing to it until we make the 
# switch, yet keeps the /data/media r/w, so at the end it won't be r/o
for i in $(seq 1 1 3000)
do
    if ( grep -c "/storage/sdcard0" /proc/mounts ); then
        mount -o remount,ro /storage/sdcard0
        break;
    fi
    usleep 100000
done

# now wait for the external media and remount
for i in $(seq 1 1 3000)
do
    if ( grep -c "/storage/extSdCard" /proc/mounts ); then
   
        # create new temporary mount point 
        mount -o remount,rw /
        mkdir /storage/tmpmnt
        mount -o remount,ro /  

        # do the rebinding using the temporary mount point
        mount -o bind /data/media /storage/tmpmnt
        mount -o bind /storage/extSdCard /storage/sdcard0
        mount -o bind /storage/extSdCard /data/media
        umount /mnt/extSdCard
        mount -o bind /storage/tmpmnt /storage/extSdCard
        umount /storage/tmpmnt
		
		# make bind for ums mode
		mkdir -p /storage/extSdCard/external_sd/sdcard1
		touch /storage/extSdCard/external_sd/.nomedia
		mount -o bind /storage/sdcard0 /storage/extSdCard/external_sd/sdcard1
    
        # done
        break;
    fi
    usleep 100000
done

exit

put this in /system/etc/init.d/ after init.d has been enabled
it should run and work
 
the original script should allow for this to work:

Code:
#!/system/bin/sh

# Wait for the system to mount the internal media and remout it as r/o
# this should prevent the system from writing to it until we make the 
# switch, yet keeps the /data/media r/w, so at the end it won't be r/o
for i in $(seq 1 1 3000)
do
    if ( grep -c "/storage/sdcard0" /proc/mounts ); then
        mount -o remount,ro /storage/sdcard0
        break;
    fi
    usleep 100000
done

# now wait for the external media and remount
for i in $(seq 1 1 3000)
do
    if ( grep -c "/storage/extSdCard" /proc/mounts ); then
   
        # create new temporary mount point 
        mount -o remount,rw /
        mkdir /storage/tmpmnt
        mount -o remount,ro /  

        # do the rebinding using the temporary mount point
        mount -o bind /data/media /storage/tmpmnt
        mount -o bind /storage/extSdCard /storage/sdcard0
        mount -o bind /storage/extSdCard /data/media
        umount /mnt/extSdCard
        mount -o bind /storage/tmpmnt /storage/extSdCard
        umount /storage/tmpmnt
        
        # make bind for ums mode
        mkdir -p /storage/extSdCard/external_sd/sdcard1
        touch /storage/extSdCard/external_sd/.nomedia
        mount -o bind /storage/sdcard0 /storage/extSdCard/external_sd/sdcard1
    
        # done
        break;
    fi
    usleep 100000
done

exit
put this in /system/etc/init.d/ after init.d has been enabled
it should run and work

What should the file be called?? And can I just merge the two etc. folders into one? Having two makes me get OCD-like symptoms, haha.
 
Oh, I see that. So should the ext2int only be in the ect folder then? Cuz that's where it was, before I copied it into the etc folder. You still didn't answer my other question, though, lol. What should the file be called?
 
Hello there peeps,
Been lurking for a bit. This thread has picked up quite a bit of speed. Nice.

Maybe you could take a look at an app called directory bind, it mounts quickly and allows for the remap of any, [just about] dir to the extsd. I've allso got an app that tries to mount the extsd to int by way of a script, but it's looking for a second partition on the extsd labeled as SD-EXT . The app is called Mounts2SD it depends on loading a script to start the swap. I havent tried it on my Ring yet, tried on a craneevb v13[pop in asia, it's branded as a craig tab] But I havent been able to get to the recovery.
Great work peeps, I love the kernel, runs quick and smooth. I'll try v5 as soon as the finishing touches are applied
Ben
 
That goes into the ext2int file? How do we know if init.d has been enabled?

the one with bluetooth and init.d folders, there should be a file called install-recovery.sh
if not, thats also good
just create it and put this in the file:

#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d

this will enable init.d so the ext2int script will work.
note: you also need busybox installed for this to work!

^
This. And I don't think you're supposed to put that code inside the ext2int file...are we??
 
Hello there peeps,
Been lurking for a bit. This thread has picked up quite a bit of speed. Nice.

Maybe you could take a look at an app called directory bind, it mounts quickly and allows for the remap of any, [just about] dir to the extsd. I've allso got an app that tries to mount the extsd to int by way of a script, but it's looking for a second partition on the extsd labeled as SD-EXT . The app is called Mounts2SD it depends on loading a script to start the swap. I havent tried it on my Ring yet, tried on a craneevb v13[pop in asia, it's branded as a craig tab] But I havent been able to get to the recovery.
Great work peeps, I love the kernel, runs quick and smooth. I'll try v5 as soon as the finishing touches are applied
Ben

I've tried a lot of the apps out there that's supposed to work, and most of them don't. I heard about Directory Bind, and I think that one might actually work (I don't really remember), but the problem with it is let's say you have ten folders, each with ten sub-folders, and those sub-folders had 20 files. I'd rather not do the math, but hopefully you would know that's a whole lot of files. In Directory Bind, you can't "mount" folders, only files. If you could, it would still take some time to manually do all those folders, but think about how much time it would take from doing all those files! And then if you install something...you'd have to do the process all over again.
 
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d

goes in /system/etc/install-recovery.sh
if it exists delete it and remake it with taht text (its the file that overwrites cwm on boot)
then set perms as 755

the long text i posted earlier goes into that 11external2internalsd file, delete the old one and remake it with that text, set perms to 644
 
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d

goes in /system/etc/install-recovery.sh
if it exists delete it and remake it with taht text (its the file that overwrites cwm on boot)
then set perms as 755

the long text i posted earlier goes into that 11external2internalsd file, delete the old one and remake it with that text, set perms to 644

Set perms? How?
 
su
mount -o remount,rw /system /system
chmod 755 /system/etc/init.d/*
chmod 755 /system/etc/install-recovery.sh

this should do the trick
 
su
mount -o remount,rw /system /system
chmod 755 /system/etc/init.d/*
chmod 755 /system/etc/install-recovery.sh

this should do the trick

Say what? I can only think of trying that in the shell terminal, and it gives me ": bad option". I'm super confused here.
 
Actually, I retried it and now it says operation not permitted. it says it after "mount -o remount,rw /system /system"
 
Um...you mean to make sure I'm rooted? Because I know I am. When I just tried to put in # into the terminal it said "syntax error: unexpected EOF" So I guess I'll try the commands in busybox then.

EDIT: Apparently I didn't install BusyBox, just downloaded it. Installing it right now.
EDIT 2: How do you use commands in Busybox? The app says it was installed, but now the app just says install/uninstall.
 
the first command should change $ to # in the terminal app
the command "su"^^
then run the commands with busybox (busybox mount --------)
 
so...

su
busybox mount -o remount,rw /system /system
chmod 755 /system/etc/init.d/*
chmod 755 /system/etc/install-recovery.sh

?

EDIT: "su" goes through, doesn't say anything, and it's still $
 
like this:
busybox mount -o remount,rw /system /system
busybox chmod 755 /system/etc/init.d/*
busybox chmod 755 /system/etc/install-recovery.sh

but su not changing $ to # is a HUGE problem i think.
 
Is it the script that changes the $ to #? I just did "busybox mount -o remount,rw /system /system" and it said "permission denied (are you root?)". So I now know what you meant by that, lol. I wonder if it's just me not being able to do su, or if everyone else can't either.
 
Back
Top Bottom