- Dec 3, 2010
- 444
- 46
- 0
Android 2.2 and newer implements it's own Apps 2 SD process. In most ROMs, you can let the OS decide where it should put apps, or tell it explicitly where to put them. You can also go into manage applications and move applications one by one to the sd. Any of the above mentioned processes use a single moint per application, which will eventually degrade your performance.
What the following modification does is make one mount, and moves files, if any are available at boot.
That being said, if you are using this mod and need to reload a phone after flashing a new rom, you may need to fill up the internal memory, reboot the phone and then load the rest of the apps that couldn't fit the first time, and reboot again.
I use this because I have a 16G class 10 card, and I figure I can give up a gig for apps and not miss the space.
Usual Disclaimer:
'We are not responsible if your phone starts to chant and make weird noises at the guy across from you.'
Requirements:
- Root access
- At least a class 4 SD card, recommended class 8 or higher.
- This relies on CM7 or a ROM that looks for userinit scripts during boot and can reference a second partition on the SD. On CM7 you can see that it looks for these scripts, by looking in /etc/init.d (The file that references the userinit scripts is 20userinit). This has been tested with the 4/4 nightly.
Instructions:
1) Make a Nandroid backup.
2) Back up contents of your sd card to a computer.
3) Partition your sd card into two primary partitions, the first being FAT32 and the second being ext(2,3,4). This may work with a FAT32 second partition, but I didn't test that. The first partition must be FAT32, or Windows will no longer see the SD card.
You can use drelisdee's or clockwork's recovery to partition the card directly from the phone. If on linux, you can use gparted or similar. Windows, you can use mini tool Partition Wizard.
4) Restore your SD contents to the first partition.
5) Boot phone with SD card in slot.
6) Put a copy of the userinit.sh script in two locations on your system, after creating a couple directories. First, download attached zip, extract script, and place where ever you will be launching your command prompt from to perform some good ol' adb. Use these commands:
Create the two directories needed:
Push script to two locations:
Change permissions, ownership, and make executable:
There seems to be an issue with the script moving applications from data/app to sd-ext/app, so after issuing above commands, please issue the following manually through adb as it will move the applications for you:
After your phone has settled, you can check to see if this worked, by typing 'mount' in adb shell or terminal emulator. You should be able to find the following in the output returned:
/dev/block/mmcblk0p2 on /data/app
To remove this modification:
Delete scripts in both data/local and sd-ext/userinit.d after mounting data as read/write:
Move apps back to data/app with the following command:
**Keep in mind, that after using this for a while, when one decides to go back to how the ROM natively handles apps2sd, you may have more space used up than can fit on internal memory. In that case, before you undo the modification, you will want the OS to move some of the apps to its version of external, by using manage apps > press on the 'On SD card' tab, press on the app to move, and then press 'Move to SD card'**
Both current version of the recoveries available for this phone restore their backups fine, although you may need to restore, reboot, restore.
This is only supported as is on the CM7 port that zefie had been working on. I am looking into other ROM's, but as the other ROMs do not currently notice a second partition on the sd card, it is unlikely as they are currently set up.
Big thanks to:
mercrapper
What the following modification does is make one mount, and moves files, if any are available at boot.
That being said, if you are using this mod and need to reload a phone after flashing a new rom, you may need to fill up the internal memory, reboot the phone and then load the rest of the apps that couldn't fit the first time, and reboot again.
I use this because I have a 16G class 10 card, and I figure I can give up a gig for apps and not miss the space.
Usual Disclaimer:
'We are not responsible if your phone starts to chant and make weird noises at the guy across from you.'
Requirements:
- Root access
- At least a class 4 SD card, recommended class 8 or higher.
- This relies on CM7 or a ROM that looks for userinit scripts during boot and can reference a second partition on the SD. On CM7 you can see that it looks for these scripts, by looking in /etc/init.d (The file that references the userinit scripts is 20userinit). This has been tested with the 4/4 nightly.
Instructions:
1) Make a Nandroid backup.
2) Back up contents of your sd card to a computer.
3) Partition your sd card into two primary partitions, the first being FAT32 and the second being ext(2,3,4). This may work with a FAT32 second partition, but I didn't test that. The first partition must be FAT32, or Windows will no longer see the SD card.
You can use drelisdee's or clockwork's recovery to partition the card directly from the phone. If on linux, you can use gparted or similar. Windows, you can use mini tool Partition Wizard.
4) Restore your SD contents to the first partition.
5) Boot phone with SD card in slot.
6) Put a copy of the userinit.sh script in two locations on your system, after creating a couple directories. First, download attached zip, extract script, and place where ever you will be launching your command prompt from to perform some good ol' adb. Use these commands:
Create the two directories needed:
adb shell
cd sd-ext
mkdir app
mkdir userinit.d
cd ..
mount -o rw,remount -t yaffs2 /dev/block/mtdblock6 /data
exit
Push script to two locations:
adb push userinit.sh sd-ext/userinit.d/
adb push userinit.sh data/local/
Change permissions, ownership, and make executable:
adb shell
chmod 775 data/local/userinit.sh
chmod +x data/local/userinit.sh
chown root:system data/local/userinit.sh
chmod 775 sd-ext/userinit.d/userinit.sh
chmod +x sd-ext/userinit.d/userinit.sh
chown root:system sd-ext/userinit.d/userinit.sh
There seems to be an issue with the script moving applications from data/app to sd-ext/app, so after issuing above commands, please issue the following manually through adb as it will move the applications for you:
mv /data/app/* /sd-ext/app/
reboot
After your phone has settled, you can check to see if this worked, by typing 'mount' in adb shell or terminal emulator. You should be able to find the following in the output returned:
/dev/block/mmcblk0p2 on /data/app
To remove this modification:
Delete scripts in both data/local and sd-ext/userinit.d after mounting data as read/write:
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock6 /data
rm data/local/userinit.sh
rm sd-ext/userinit.d/userinit.sh
Move apps back to data/app with the following command:
mv sd-ext/app/* data/app
reboot
**Keep in mind, that after using this for a while, when one decides to go back to how the ROM natively handles apps2sd, you may have more space used up than can fit on internal memory. In that case, before you undo the modification, you will want the OS to move some of the apps to its version of external, by using manage apps > press on the 'On SD card' tab, press on the app to move, and then press 'Move to SD card'**
Both current version of the recoveries available for this phone restore their backups fine, although you may need to restore, reboot, restore.
This is only supported as is on the CM7 port that zefie had been working on. I am looking into other ROM's, but as the other ROMs do not currently notice a second partition on the sd card, it is unlikely as they are currently set up.
Big thanks to:
mercrapper
Last edited: