[CMW, Init.d Script] Swap IntenalSD<->ExternalSD

aureusz

Member
Dec 16, 2009
30
6
0
Hello,

Sorry, not working like on sgs 3 and galaxy note 10.1. Dont apply now. I m working on a fix with vold.fstab, but format changes with jellybean.

Ported from scripts created originally for Galaxy S 3.
This script swaps internal and external sd storage from init.d.

- You must have a JellyBean Stock or Stock Based ROM
- Must be rooted to flash.

Attached to this post, you will find the CWM flashable zip.
This have zero chance to brick your device, but I cannot say if your SD card doesn't have any issues etc... so don't blame me for data loss or anything.

This script will NOT COPY DATA from your sd, so you will have missing data after you restart the phone.
The data is still on the original internal SD, so you'll have to copy it back to your bigger sdcard's root.

Code:
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa. With this you can use default internal sd only for app storage #and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip. 
#Script Modified for SgNote N7000 by aureusz

sleep 5
busybox mount -o remount,rw /

#Tries to mount as vfat
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard

#Tries to mount as exfat
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:9 /mnt/sdcard

#If Sd has been mounted, mount internal SD as extSdCard, if not, do nothing, Android should mount it back as internal.
if busybox mount | busybox grep vold/179:9; then
busybox mount -t vfat -o umask=0000 /dev/block/mmcblk0p11 /mnt/extSdCard
fi
Only problem is, if you use usb mass storage connexion, instead of mtp, it will swap back sd cards.

If you want to remove the script, simply delete the file 11extsd2internalsd from /etc/init.d/ with root explorer or a similar app.

Restart the phone and the problem should disappear.
I'll look into a fix for this.

Strange stuff happenning after first reboot (app2sd make apps disappear). Removing file and placing warning back:)


Aureusz.
 
Last edited:
  • Like
Reactions: coelho_

aureusz

Member
Dec 16, 2009
30
6
0
Or you can simply switch mount points in vold.fstab
The problem with this method is that, if you remove SDCARD, the phone will not mount internal SD back to it's place.

With this script, the internal SD will remount back to internal sd path.

I'm not sure, but that's how I understood it when I read the thread where they talked about this method.

Correct me if I'm wrong, I pretty much a noob at this.
 
Last edited:

neobuddy89

Recognized Developer / Recognized Contributor
Mar 13, 2011
5,298
23,503
263
Mumbai
The problem with this method is that, if you remove SDCARD, the phone will not mount internal SD back to it's place.

With this script, the internal SD will remount back to internal sd path.

I'm not sure, but that's how I understood it when I read the thread where they talked about this method.

Correct me if I'm wrong, I pretty much a noob at this.
The solution to that can be decompiling framework-res.apk and editing file storage.xml
Make removable flag true for both storage.

This may or may not work but worth a try.
 
  • Like
Reactions: aureusz

aureusz

Member
Dec 16, 2009
30
6
0
The solution to that can be decompiling framework-res.apk and editing file storage.xml
Make removable flag true for both storage.

This may or may not work but worth a try.
I'm definitely interested in all options regarding this issue, this has been a big hurdle for me on android with sd card slots, so I took to myself to fix it. I know it's easy to do in ASOP roms but, I missed some S-pen features.

Until now, people used bindings for some directories, for large games data, but this proved not to work for some apps, while this solution works for every app.

Spotify for example lost its synced library, because I think the service would check the synchro of the playlist at device startup, and the folders were not yet mounted... etc.. now, it's flawless.

EDIT : not so flawless, looking into modding fstab as suggested by neobuddy89
 
Last edited: