Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I want to thank JVene for his work and confirm that I implemented this successfully. JVene's posts are informative, but long-winded, so here is a TL;DR for people that want to try this. I'm assuming you vaguely know what you're doing (comfortable with linux command line), so I'm not going into extreme detail. Read all the steps first and if it doesn't make sense, I wouldn't recommend trying it as you could mess something up.
1. Partition and format an SD card with a Fat32 partition (1st) and an Ext4 partition (2nd). Choose your size for each. Fat32 will be your new "sd card" and Ext4 will be your new "internal storage".
2. Download and extract the app_process binary that JVene attached to one of his posts.
3. Mount /system read-only ("mount -o remount,rw /system", you need root). Rename your original /system/bin/app_process to something else for backup. Copy JVene's app_process to /system/bin/app_process.
4. Create /system/etc/init.d/zinit.sh (in a nutshell, JVene's modified app_process runs this script before Android initializes) and chmod 755 zinit.sh.
5. Insert "#!/system/bin/sh" as the first line in zinit.sh, then insert your boot-time commands below it. You have several options for your commands, what I personally did was mount the ext4 partition at a temp mount point, copy /data to it, then mount it at /data. This will copy /data to the ext4 partition of the sd card while keeping your original /data partition intact. You can also enable USB debugging beforehand and enter sleep x as your command where x is the number of seconds you want the device suspended prior to loading Android. This will give you time to connect with ADB and manually perform file operations. You could also just mount the new partition at /data and start with a clean slate. The ext4 partition on the sd card is /dev/block/mmcblk1p2, so to mount it at /data: "mount -o rw -t ext4 /dev/block/mmcblk1p2 /data".
6. zinit.sh will be executed during each boot. If you added commands to temporarily mount your sd card partition and copy your current data partition to it, remember to remove them after the first reboot. Your first reboot will also take a fair amount of time at the boot screen as your /data partition is copied. The only command that stays in your zinit.sh file after the first boot is the mount command (unless you want to do more).
#!/system/bin/sh
# NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK!
# tested on LG MS50012b
PARTITION1="/dev/block/vold/179:33"
PARTITION2="/dev/block/vold/179:34"
TMP_DIR="/cache/data_tmp"
MOUNT_OPT=nosuid,nodev,noauto_da_alloc,resuid=1000,errors=continue
VALID_TAG=".LGF6DataOnSD_DO_NOT_REMOVE"
INIT_TAG=".LGF6DataOnSD_INIT"
if [[ -f /data/$VALID_TAG ]]; then
exit 0
fi
if [[ -b $PARTITION2 ]] && [[ ! -d $TMP_DIR ]]; then
mkdir $TMP_DIR
mount -t ext4 -o $MOUNT_OPT $PARTITION2 $TMP_DIR
if [[ "$?" = "0" ]]; then
if [[ -f $TMP_DIR/$VALID_TAG ]] && [[ -d $TMP_DIR/dalvik-cache ]]; then
mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data
else
mount -t vfat $PARTITION1 $TMP_DIR
if [[ "$?" = "0" ]]; then
if [[ -f $TMP_DIR/$INIT_TAG ]]; then
rm $TMP_DIR/$INIT_TAG
umount $TMP_DIR
rm -r $TMP_DIR/*
rm -r $TMP_DIR/.*
cp -a /data/. $TMP_DIR
touch $TMP_DIR/$VALID_TAG
mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data
else
umount $TMP_DIR
fi
fi
fi
umount $TMP_DIR
fi
rmdir $TMP_DIR
fi
Thanks to JVene for all the hard work and info. His posts provided enough details to get the solution working. Also thanks to likwid2 for confirming this method works.
Prerequisites:
To install:
- rooted stock rom. Having stock may not be necessary, but the file JVene provided is built against Android 4.1.2.
- microSD card with fast random read/write. Use Samsung or SanDisk.
- some way to partition and format the microSD. Do it on a PC or use one of the available guides to do it on the phone.
- some way to manage files. Use a file manager or a terminal emulator.
To use:
- Get the replacement "app_process".
- Download JVene's "app_process_4_1_2_r1.gz" (post #16).
- Uncompress to get "app_process_4_1_2_r1" (size=9572).
- Copy "app_process_4_1_2_r1" to the phone's /system/bin directory.
- Correct file owner and permissions of "app_process_4_1_2_r1": uid=0 (root), gid=2000 (shell), permissions=755 (-rwxr-xr-x).
- Rename the original "app_process" (size=9500) to something else like "app_process-original" and rename "app_process_4_1_2_r1" to "app_process".
- Under /system/etc, create subdirectory "init.d" (uid/gid=0, permissions=755, drwxr-xr-x).
- Under /system/etc/init.d, either create "zinit.sh" (uid/gid=0, permissions=750, -rwxr-x---) or copy the file there then modify owner/permissions:
Code:#!/system/bin/sh # NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK! # tested on LG MS50012b PARTITION1="/dev/block/vold/179:33" PARTITION2="/dev/block/vold/179:34" TMP_DIR="/cache/data_tmp" MOUNT_OPT=nosuid,nodev,noauto_da_alloc,resuid=1000,errors=continue VALID_TAG=".LGF6DataOnSD_DO_NOT_REMOVE" INIT_TAG=".LGF6DataOnSD_INIT" if [[ -b $PARTITION2 ]] && [[ ! -d $TMP_DIR ]]; then mkdir $TMP_DIR mount -t ext4 -o $MOUNT_OPT $PARTITION2 $TMP_DIR if [[ "$?" = "0" ]]; then if [[ -f $TMP_DIR/$VALID_TAG ]] && [[ -d $TMP_DIR/dalvik-cache ]]; then mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data else mount -t vfat $PARTITION1 $TMP_DIR if [[ "$?" = "0" ]]; then if [[ -f $TMP_DIR/$INIT_TAG ]]; then rm $TMP_DIR/$INIT_TAG umount $TMP_DIR rm -r $TMP_DIR/* rm -r $TMP_DIR/.* cp -a /data/. $TMP_DIR touch $TMP_DIR/$VALID_TAG mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data else umount $TMP_DIR fi fi fi umount $TMP_DIR fi rmdir $TMP_DIR fi
First time booting will take a while. The script will copy all files from internal /data storage to the SD card's ext4 partition. Afterwards, the SD's ext4 will become the /data partition. The phone's internal /data partition is hidden and unmodified.
- Create two partitions on SD card. Make the first fat32. It will be external_SD to Android. Some software can resize a partition so you can keep files on an existing fat32 partition. Make the second ext4. It will be Android's /data partition. The order matters. Make sure the ext4 partition is larger than the phone internal storage (duh). Make sure whatever software you use to make partitions is able to properly align them.
- In the first fat32 partition, make an empty file ".LGF6DataOnSD_INIT" in the partition's root directory. Normally the first fat32 partition is mounted as /storage/external_SD on the phone. In other words, if you do this step on the phone, create an empty "/storage/external_SD/.LGF6DataOnSD_INIT".
- Insert the SD card into the phone if it's not in there already. Then reboot the phone.
To uninstall:
Some notes:
- Remove "/system/etc/init.d/zinit.sh".
- Remove "/system/etc/init.d" if the directory is empty.
- Remove "/system/bin/app_process" (size=9572) and rename the original file ("/system/bin/app_process-original" in the above example) back to "app_process".
I hope everything is clear. Good luck.
- Do not remove the SD while the phone is using it as the /data partition.
- To boot the phone with its internal /data storage, simply remove the SD card (with phone powered off). If you need to access the SD's fat32 partition afterwards, insert the SD after the phone has booted (powered on) with its internal /data. Rebooting the phone with the SD inserted should mount the SD's ext4 as /data again.
- Don't use CWM or similar to wipe data. I don't know what would happen. Since you can now take out the SD card (with phone powered off), you can wipe (or copy/backup/restore/resize) the SD's ext4 partition on a PC.
- The script puts an empty file ".LGF6DataOnSD_DO_NOT_REMOVE" in the SD's ext4 partition's root directory. Don't remove it. The script checks it at boot. However, if you want to start over from the state of the phone's internal /data without reformatting, you can remove ".LGF6DataOnSD_DO_NOT_REMOVE" from the ext4 partition (under /data on the phone), create an empty ".LGF6DataOnSD_INIT" on the fat32 partition (under /storage/external_SD on the phone), and reboot. Doing this will erase all files on SD's ext4 partition and copy all files from the phone's internal /data partition to the SD's ext4 partition again.
- The script has minimal error checking, so it might not mount the SD partition if something goes wrong. However, in that case, the phone should be able to boot up with its internal /data intact.
- As JVene has said, this method is not compatible with Xposed. To get them to work together, The "app_process" of Xposed will need to be modified to run zinit.sh before Android itself is loaded. This requires editing its source and recompiling.
Is this almost same as "F6Utilities2.3.1.apk" ?
so result should be same like install F6Utilities in a rooted stock rom ?
difference ?
....so.....i tried my hand at this....and got a looping boot animation...i'm using the KK beta4 rom...so ...i dunno if that was the issue...
or i'm just too dumb to follow the instructions correctly...
it was kinda comical to watch the android wiz on the apple...but ,after the 10th time i was'nt sure if that was the way things were supposed to go...and reflashed KK...
things are normal as it gets.... i was hoping it would work...and followed the instructions ...but, i was'nt getting lucky ...
i had to go through this with my samsung admire (the tiny internal memory)...but, things were more compliant when i used app2sd .....
all these hacks ....i tried the flip flop init file and it did what it said what it would do...when it would'nt break itself...or make emulations and not just make things go on the sd card..
man...i wish i had known this phone had such a awful flaw and read more than the super cool features..what a downer :thumbdown:
Thanks to JVene for all the hard work and info. His posts provided enough details to get the solution working. Also thanks to likwid2 for confirming this method works.
Prerequisites:
To install:
- rooted stock rom. Having stock may not be necessary, but the file JVene provided is built against Android 4.1.2.
- microSD card with fast random read/write. Use Samsung or SanDisk.
- some way to partition and format the microSD. Do it on a PC or use one of the available guides to do it on the phone.
- some way to manage files. Use a file manager or a terminal emulator.
To use:
- Get the replacement "app_process".
- Download JVene's "app_process_4_1_2_r1.gz" (post #16).
- Uncompress to get "app_process_4_1_2_r1" (size=9572).
- Copy "app_process_4_1_2_r1" to the phone's /system/bin directory.
- Correct file owner and permissions of "app_process_4_1_2_r1": uid=0 (root), gid=2000 (shell), permissions=755 (-rwxr-xr-x).
- Rename the original "app_process" (size=9500) to something else like "app_process-original" and rename "app_process_4_1_2_r1" to "app_process".
- Under /system/etc, create subdirectory "init.d" (uid/gid=0, permissions=755, drwxr-xr-x).
- Under /system/etc/init.d, either create "zinit.sh" (uid/gid=0, permissions=750, -rwxr-x---) or copy the file there then modify owner/permissions:
Code:#!/system/bin/sh # NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK! # tested on LG MS50012b PARTITION1="/dev/block/vold/179:33" PARTITION2="/dev/block/vold/179:34" TMP_DIR="/cache/data_tmp" MOUNT_OPT=nosuid,nodev,noauto_da_alloc,resuid=1000,errors=continue VALID_TAG=".LGF6DataOnSD_DO_NOT_REMOVE" INIT_TAG=".LGF6DataOnSD_INIT" if [[ -b $PARTITION2 ]] && [[ ! -d $TMP_DIR ]]; then mkdir $TMP_DIR mount -t ext4 -o $MOUNT_OPT $PARTITION2 $TMP_DIR if [[ "$?" = "0" ]]; then if [[ -f $TMP_DIR/$VALID_TAG ]] && [[ -d $TMP_DIR/dalvik-cache ]]; then mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data else mount -t vfat $PARTITION1 $TMP_DIR if [[ "$?" = "0" ]]; then if [[ -f $TMP_DIR/$INIT_TAG ]]; then rm $TMP_DIR/$INIT_TAG umount $TMP_DIR rm -r $TMP_DIR/* rm -r $TMP_DIR/.* cp -a /data/. $TMP_DIR touch $TMP_DIR/$VALID_TAG mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data else umount $TMP_DIR fi fi fi umount $TMP_DIR fi rmdir $TMP_DIR fi
First time booting will take a while. The script will copy all files from internal /data storage to the SD card's ext4 partition. Afterwards, the SD's ext4 will become the /data partition. The phone's internal /data partition is hidden and unmodified.
- Create two partitions on SD card. Make the first fat32. It will be external_SD to Android. Some software can resize a partition so you can keep files on an existing fat32 partition. Make the second ext4. It will be Android's /data partition. The order matters. Make sure the ext4 partition is larger than the phone internal storage (duh). Make sure whatever software you use to make partitions is able to properly align them.
- In the first fat32 partition, make an empty file ".LGF6DataOnSD_INIT" in the partition's root directory. Normally the first fat32 partition is mounted as /storage/external_SD on the phone. In other words, if you do this step on the phone, create an empty "/storage/external_SD/.LGF6DataOnSD_INIT".
- Insert the SD card into the phone if it's not in there already. Then reboot the phone.
To uninstall:
Some notes:
- Remove "/system/etc/init.d/zinit.sh".
- Remove "/system/etc/init.d" if the directory is empty.
- Remove "/system/bin/app_process" (size=9572) and rename the original file ("/system/bin/app_process-original" in the above example) back to "app_process".
I hope everything is clear. Good luck.
- Do not remove the SD while the phone is using it as the /data partition.
- To boot the phone with its internal /data storage, simply remove the SD card (with phone powered off). If you need to access the SD's fat32 partition afterwards, insert the SD after the phone has booted (powered on) with its internal /data. Rebooting the phone with the SD inserted should mount the SD's ext4 as /data again.
- Don't use CWM or similar to wipe data. I don't know what would happen. Since you can now take out the SD card (with phone powered off), you can wipe (or copy/backup/restore/resize) the SD's ext4 partition on a PC.
- The script puts an empty file ".LGF6DataOnSD_DO_NOT_REMOVE" in the SD's ext4 partition's root directory. Don't remove it. The script checks it at boot. However, if you want to start over from the state of the phone's internal /data without reformatting, you can remove ".LGF6DataOnSD_DO_NOT_REMOVE" from the ext4 partition (under /data on the phone), create an empty ".LGF6DataOnSD_INIT" on the fat32 partition (under /storage/external_SD on the phone), and reboot. Doing this will erase all files on SD's ext4 partition and copy all files from the phone's internal /data partition to the SD's ext4 partition again.
- The script has minimal error checking, so it might not mount the SD partition if something goes wrong. However, in that case, the phone should be able to boot up with its internal /data intact.
- As JVene has said, this method is not compatible with Xposed. To get them to work together, The "app_process" of Xposed will need to be modified to run zinit.sh before Android itself is loaded. This requires editing its source and recompiling.
....so.....i tried my hand at this....and got a looping boot animation...i'm using the KK beta4 rom...so ...i dunno if that was the issue...
That's interesting. Do you know what type(s) of folders failed with cp? I also thought about using tar in the script, but I couldn't be sure the temporary file would always fit on the phone so I just used cp.I had to go in ADB and copy my stuff manually because certain folders wouldn't work with cp.
You're welcome and thanks for the confirmation.Everything works perfect, 100% issue free.
For some reason, it was skipping over folders that were full of cached images, namely chrome and my home screen app. This wasn't really a problem with the chrome cache, but the images for my home screen app are only downloaded once, so I would've had to reinstall to redownload them. No matter what options I put, cp would always say it doesn't support that type of file when I cp'd everything, but would work just fine when I only did those folders separately.That's interesting. Do you know what type(s) of folders failed with cp? I also thought about using tar in the script, but I couldn't be sure the temporary file would always fit on the phone so I just used cp.
#!/system/bin/sh
# NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK!
# tested on LG MS50012b
PARTITION1="/dev/block/vold/179:33"
PARTITION2="/dev/block/vold/179:34"
TMP_DIR="/cache/data_tmp"
MOUNT_OPT=nosuid,nodev,noauto_da_alloc,resuid=1000,errors=continue
VALID_TAG=".LGF6DataOnSD_DO_NOT_REMOVE"
INIT_TAG=".LGF6DataOnSD_INIT"
if [[ -f /data/$VALID_TAG ]]; then
exit 0
fi
if [[ -b $PARTITION2 ]] && [[ ! -d $TMP_DIR ]]; then
mkdir $TMP_DIR
mount -t ext4 -o $MOUNT_OPT $PARTITION2 $TMP_DIR
if [[ "$?" = "0" ]]; then
if [[ -f $TMP_DIR/$VALID_TAG ]] && [[ -d $TMP_DIR/dalvik-cache ]]; then
mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data
else
mount -t vfat $PARTITION1 $TMP_DIR
if [[ "$?" = "0" ]]; then
if [[ -f $TMP_DIR/$INIT_TAG ]]; then
rm $TMP_DIR/$INIT_TAG
umount $TMP_DIR
rm -r $TMP_DIR/*
rm -r $TMP_DIR/.*
cp -a /data/. $TMP_DIR
touch $TMP_DIR/$VALID_TAG
mount -t ext4 -o $MOUNT_OPT $PARTITION2 /data
else
umount $TMP_DIR
fi
fi
fi
umount $TMP_DIR
fi
rmdir $TMP_DIR
fi
Don't worry. I didn't take whatever you've said negatively. Besides, I like constructive criticism and information regarding other methods, so feedback and comments of that nature are helpful. JVene's posts are like an engineering journal, and I've learned a lot from them. I'm not sure if I want to or am able to take his concept further. He had a lot of great ideas in his posts, but to make anything else work will probably require a lot of learning first.Also, just to be clear I was in no way trying to diminish or take anything away from what you accomplished! From the little bit I've picked up trying to figure out the best solution for the mem problem of the F6, you did a fantastic job of taking Jvene's concept and making it happen. You could possibly automate things even more, make a Xposed version, a version for different Android builds, even package it as an app for the Markets!
My guess is that not all files were copied successfully, since you've had problems with that part the first time. So like I said before, ifFor the most part, this has been great. Many thanks to JVene for the method and WarrantyVoider for the script because I couldn't write one that worked. The only problem I've had is, since actually getting it to mount to the SD card, my phone has been randomly freezing and rebooting a few times a day. I'm not sure what is causing this problem and it's baffling me. I have a Sandisk Pixtor UHS-class 1 card in it, so I doubt it's transfer rate and being as JVene's only change to app_process was to include zinit before zygote, I don't think it's that. I'm just so lost. :/
cp -a /data/. $TMP_DIR
tar -cp -C /data ./ | tar -xp -C $TMP_DIR