I am not responsible for anything you do to your phone. If this goes wrong, it's not my fault. Read the whole post, and the last few pages of the thread. This will get you up to speed. Backup everything! Twice. No, I'm not joking. Do a nandroid, then do a titanium backup.
Important note! Ext4 does NOT work with ClockworkMOD 2.5.x. Nandroid backups will not work unless you upgrade to CWM 3! (data2ext4)
Greetings, earthlings! I have got a new version for you! Almost. Read this: http://forum.xda-developers.com/showpost.php?p=11931210&postcount=341
Update 26/01/2011
Ok, so someone asked about continuing support for ext2. So I will. Ain't I nice. Both scripts are updated, and should have improved performance, as well as a bugfix With both you don't need to start over, just flash the zip and you're done. Backup anyway (of course).
EXT4 version:
Yes, ext4 is slower in benchmarks. No, it doesn't have a real world impact. Not that I can see anyway. As always feedback is welcomed. I really mean that, if your phone genuinely becomes slower, let me know.
The zip is named data2ext4-V4.zip
Instructions (new users):
Ensure that mmcblk0p2 isn't mounted anywhere. You can do this by running "mount|egrep mmcblk0p2". If that returns anything, the ext partition is mounted. Unmount it using "umount directory/that/mmcblk0p2/is/mounted/to". Most often it's mounted to /sd-ext; in this case run "umount /sd-ext"
Format the ext partition to ext4:
Code:
mke2fs -m0 -b4096 /dev/block/mmcblk0p2
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -yf /dev/block/mmcblk0p2
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2
tune2fs -O ^has_journal /dev/block/mmcblk0p2
Flash the attached zip and reboot to normal mode
Open up a terminal or use ADB to execute "data2ext --enable"
Reboot
Click to expand...
Click to collapse
Intructions (upgrading from ext2):
This should keep all your existing data. Back it up anyway
Disable data2ext
Upgrade to ext4 thusly:
Code:
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -yf /dev/block/mmcblk0p2
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2
tune2fs -O ^has_journal /dev/block/mmcblk0p2
Flash the attached zip
Enable data2ext
Click to expand...
Click to collapse
EXT2 version:
This is rather simpler to set up, but is not as safe. It is slightly faster though
The zip is named data2ext2-v7.zip
Flash the zip
ensure /dev/block/mmcblk0p2 isn't mounted anywhere
Format the ext partition to ext2 with a 4KB block size
Code:
mke2fs -m0 -b4096 /dev/block/mmcblk0p2
Run this:
Code:
data2ext --enable
Reboot and enjoy
Click to expand...
Click to collapse
1st boot will take a while, it's copying stuff across.
Java on my PC sucks (it won't work), and I still can't sign zips. You'll live, just toggle signature verification in CWM
Semi-disclaimer:
This is my first real foray into scripting. I am still learning, so this is not as good as it could be. I release this to you to give me an incentive to make it better. I still need to look into mount options and the like, I'm sure this can go faster. Once again, I would class this as beta quality.
What is data2ext?
The phones internal memory is divided into several partitions. The 3 key ones are /system, /data and /cache. The rest we don't need to worry about too much. /system is where the ROM lives. By default it's read only (regardless of S-ON or S-OFF). All the data on our phones (apps, app data, game progress and a few other bits and bobs) is stored on /data. We have a pitiful amount of storage on /data (about 190MB), so we quickly run out when installing apps. 1 solution is to move /data/app (this is where most of the apps are stored) to a partition on your SD card (formatted to ext). But the internal memory still fills up, as anything not in /data/app stays on internal (caches, data and shizz). Other solutions have arisen, like moving dalvik-cache there to the ext partition too. But with the advent of fast SD cards it became possible to move the whole data partition to the ext partition. So people did; this means that the internal memory is barely used (aside from a few bits here and there, they're symlinked back to their original location).
Click to expand...
Click to collapse
It ain't workin'!
Ok. Get a logcat, and use pastebin to paste it here. Then we might be able to work it out, ye?
To use logcat:
Download this and extract it to a known location. Navigate to that folder, and press SHIFT while right-clicking. In the menu there should be a "Open command window here" option. Click it. Now type "adb logcat". Press CTRL+C to end the output. Right click and press mark, then click and drag over all the text and hit ENTER. It's now copied to the clipboard. CTRL+V to paste it somewhere... To debug issues with this script I need the first 5-10 seconds of the boot process.
To make life easier, I need the bit between "--START OF SCRIPT, PASTE LOGCAT FROM HERE ON!--" and "I DON'T NEED ANY MORE OF THE LOGCAT!"
Click to expand...
Click to collapse
Changelog
Version 1
initial release
Versions 2 through 4 were internal testing ones
Version 5
Fixed dalvik-cache rebuild
Made more likely to work
EXT4(v3) version initial release
EXT4 V4
Improved performance
Bugfix (unmount /sd-ext if it exists)
EXT2 V7
Improved performance
Bugfix (unmount /sd-ext if it exists)
Hereafter I shall rename these to make managing this changelog easier
Click to expand...
Click to collapse
Credits:
BlaY0
Anyone who's ever made data2ext scripts. I looked at a few
Click to expand...
Click to collapse
signd version attached
edit: removed
nooob.
but could you also make just ap2sd for ext3 ?
Sent from my Legend using Tapatalk
Noob?! Meh, s'pose I am. What can you do, eh?
http://krikun.ru/2010/10/28/app2sd-for-cyanogenmod-6-x/
TheGrammarFreak said:
Noob?! Meh, s'pose I am. What can you do, eh?
http://krikun.ru/2010/10/28/app2sd-for-cyanogenmod-6-x/
Click to expand...
Click to collapse
i tried that one but doesn't work on gingerbread cm7
OlegKrikun :
"Now cm7 exp. builds not support run start up scripts from /etc/init.d =( when is fix, I publish app2sd for cm7"
noob=== my noob wish.
I don't like to ask questions, so I try to introduce myself into those new things. But I need a confirmation if my theories are correct
1. Google's app2sd is kinda stupid. It uses the normal fat partition on your SD, correct?
2. The a2sd linked here copies all the stuff from /data/app to /sd-ext/app and remounts /data/app to /sd-ext/app
So the Phone means the App is stored on the Phone Memory but in real its stored on the sd.
Do I have to wipe everything after flashing the script. What happens to apps that are currently moved to the SD (by Google Apps2SD). Can I just copy them "to phone" again and they are inside the sd-ext then?
3. Data2ext => Speedup because everything from /data is now on the extfs on SD. Apps are also included, as they are located in /data/app so its has a2sd integrated, right?
EDIT: Damn, now I have to ask a question...
What's stored inside the dalvik-cache? I don't know much about dalvik, thats my biggest problem with android ...
Is it good to move it also to sd-ext with the a2sd script?
fabi280 said:
I don't like to ask questions, so I try to introduce myself into those new things. But I need a confirmation if my theories are correct
1. Google's app2sd is kinda stupid. It uses the normal fat partition on your SD, correct?
2. The a2sd linked here copies all the stuff from /data/app to /sd-ext/app and remounts /data/app to /sd-ext/app
So the Phone means the App is stored on the Phone Memory but in real its stored on the sd.
Do I have to wipe everything after flashing the script. What happens to apps that are currently moved to the SD (by Google Apps2SD). Can I just copy them "to phone" again and they are inside the sd-ext then?
3. Data2ext => Speedup because everything from /data is now on the extfs on SD. Apps are also included, as they are located in /data/app so its has a2sd integrated, right?
EDIT: Damn, now I have to ask a question...
What's stored inside the dalvik-cache? I don't know much about dalvik, thats my biggest problem with android ...
Is it good to move it also to sd-ext with the a2sd script?
Click to expand...
Click to collapse
1. Correct
2. No wipe needed for a2sd or this data2ext. Any app on what the phone believes to be internal memory is in fact sd-ext
3. Correct
Dalvik-cache is a shedload of dex files, quite important. The bug with re-creating it on every boot isn't major enough for me to worry about for now, as I don't think it affects anything other than the startup time. I need to investigate this, so be careful if you use this mod. My worry is that it's due to data being lost somewhere
When I used a2sd I had dalvik-cache on the sd card, but then I have a fast SD card. It can slow things down.
Anyhoo, I would like this thread to be for testing data2ext, not asking questions about a2sd. I have made this to help me learn how these things work, so feedback is welcomed. If anyone has tested this on CM6 then please let me know. And can you also post feedback about the dalvik-cache issue.
gyroing said:
i tried that one but doesn't work on gingerbread cm7
OlegKrikun :
"Now cm7 exp. builds not support run start up scripts from /etc/init.d =( when is fix, I publish app2sd for cm7"
noob=== my noob wish.
Click to expand...
Click to collapse
/system/etc/init.d is where this is run from. It works on CM7
@Grammar,
thx for your work!!! it works very good on my phone. ext2(1 gb) partition as ext3 formatted. i have the "signed" zip from exicar(thx) installs....
lwiss
quadrant: 1686
card: 8gb class 6
rom-version: CM 7 | Gingerbread, 01/03
TheGrammarFreak said:
Anyhoo, I would like this thread to be for testing data2ext, not asking questions about a2sd. I have made this to help me learn how these things work, so feedback is welcomed. If anyone has tested this on CM6 then please let me know. And can you also post feedback about the dalvik-cache issue.
Click to expand...
Click to collapse
Sorry for my Off-Topic-Questions.
I'll try it for you on CM6.
How fast has it to be? I've got a 8GB Class 6 Card, is it enough?
EDIT: Note to myself, never read an article description on amazon on a second screen while writing a reply.
It's a class 4, I looked for a Class 6 on Amazon -_-
But I'll try it anyway..
lwiss said:
@Grammar,
thx for your work!!! it works very good on my phone. ext2(1 gb) partition as ext3 formatted. i have the "signed" zip from exicar(thx) installs....
lwiss
Click to expand...
Click to collapse
What version of CM? And it's not my work, it's BlaY0's. I just made his script work on CM
fabi280 said:
Sorry for my Off-Topic-Questions.
I'll try it for you on CM6.
How fast has it to be? I've got a 8GB Class 6 Card, is it enough?
Click to expand...
Click to collapse
It's not the most off-topic I've seen. Look at the CM experimental build thread . I also have 8GB class 6. I get 1600+
Stupid question. Where to enable data2ext in cyanogenmod settings?
What version of CM?
Click to expand...
Click to collapse
from ali ba (thx)
CM 7 | Gingerbread, 01/03 (with gapps)
lwiss
FUXAS said:
Stupid question. Where to enable data2ext in cyanogenmod settings?
Click to expand...
Click to collapse
If you don't even read the first post I'm not gonna help you. If I haven't made the point clear enough:
This is in testing. There is a major bug where dalvik-cache is re-built on every reboot. This is not a good thing. I would advise that you not use this unless you know what you're doing
fabi280 said:
Sorry for my Off-Topic-Questions.
I'll try it for you on CM6.
How fast has it to be? I've got a 8GB Class 6 Card, is it enough?
EDIT: Note to myself, never read an article description on amazon on a second screen while writing a reply.
It's a class 4, I looked for a Class 6 on Amazon -_-
But I'll try it anyway..
Click to expand...
Click to collapse
Class 4 is definitely too slow, at least on CM6.
I will not provide a Quadrant Benchmark because my Phone is waaay too slow now. It really lags everywhere.
First Start:
Code:
I//system/xbin/run-parts( 59): Initiating Data2EXT...
I//system/xbin/run-parts( 59): Waiting for SD card to settle...
I//system/xbin/run-parts( 59): Executing file system check...
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: 11/65664 files (0.0% non-contiguous), 4451/262144 blocks
I//system/xbin/run-parts( 59): Mounting /dev/block/mmcblk0p2 to /data...
I//system/xbin/run-parts( 59): EXT partition /dev/block/mmcblk0p2 mounted on /data...
I//system/xbin/run-parts( 59): First time initiation, copying files to EXT partition...
I//system/xbin/run-parts( 59): Data2EXT enabled...
I//system/xbin/run-parts( 59): Setting read-write /system overlay...
I//system/xbin/run-parts( 59): Checking for kernel aufs support...
I//system/xbin/run-parts( 59): No aufs driver present in kernel, trying to load aufs module...
I//system/xbin/run-parts( 59): Can not load aufs module, aborting...
Second start:
Code:
I//system/xbin/run-parts( 59): Initiating Data2EXT...
I//system/xbin/run-parts( 59): Waiting for SD card to settle...
I//system/xbin/run-parts( 59): Executing file system check...
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: Entry 'CheckinService.xml' in /data/com.google.android.gsf/shared_prefs (25081) has deleted/unused inode 25583. CLEARED.
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: Entry 'EventLogService.xml' in /data/com.google.android.gsf/shared_prefs (25081) has deleted/unused inode 25074. CLEARED.
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: Entry 'googlesettings.db-journal' in /data/com.google.android.gsf/databases (25087) has deleted/unused inode 25564. CLEARED.
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: 1834/65664 files (0.4% non-contiguous), 46535/262144 blocks
I//system/xbin/run-parts( 59): /dev/block/mmcblk0p2: 1834/65664 files (0.4% non-contiguous), 46535/262144 blocks
I//system/xbin/run-parts( 59): Mounting /dev/block/mmcblk0p2 to /data...
I//system/xbin/run-parts( 59): EXT partition /dev/block/mmcblk0p2 mounted on /data...
I//system/xbin/run-parts( 59): Data2EXT enabled...
I//system/xbin/run-parts( 59): Setting read-write /system overlay...
I//system/xbin/run-parts( 59): Checking for kernel aufs support...
I//system/xbin/run-parts( 59): No aufs driver present in kernel, trying to load aufs module...
I//system/xbin/run-parts( 59): Can not load aufs module, aborting...
I can send you the complete outputs for both starts (got em till the UI was visible)
EDIT: But is the Class4 Card fast enough to handle a2sd (maybe with Dalvik Cache)?
There are several factors affecting read/write speed to/from SD card not just class:
partition alignment
partition type
format options
mount options
readahead settings
etc.
Not going to try and use it yet, but I'm curious now. When using this, you're automatically having all of your apps on your sd card and the app2sd feature isn't needed anymore, right? And your phone gets a speed boost when using it?
m1schi said:
Not going to try and use it yet, but I'm curious now. When using this, you're automatically having all of your apps on your sd card and the app2sd feature isn't needed anymore, right? And your phone gets a speed boost when using it?
Click to expand...
Click to collapse
Apps on sd-ext = yes
Speed Boost, sometimes yes, sometimes its laggy as hell
Sent from my HTC Legend using XDA App
Stupid question. How do you guys get 1600+ in Quadrant on CM7?
For me Quadrant is not finishing tests due to the 3D graphics not working. But even if it'll work, I don't think I'd get so much. On CM 6.1 oc'ed to 787, I'd hardly get 1150. Is it just due to overclocking or this data2ext is speeding it up?
Sent from my Legend using XDA App
Hi all, Oleg Krikun was published app2sd and app2sd-dalvik for CM 7 01/03
I re-uploaded patch here: cm7_app2sd
and cm7_app2sd_dalvik
ktullanux said:
Hi all, Oleg Krikun was published app2sd and app2sd-dalvik for CM 7 01/03
I re-uploaded patch here: cm7_app2sd
and cm7_app2sd_dalvik
Click to expand...
Click to collapse
This has got nothing to do with this thread.
Related
just wondering if im doing something wrong? got NV installed with all 3 partitions and I had 77mb of internal mem. when I install new apps it takes away mem, am I doing something wrong, did I not config something right? I have read that apps2sd are automatic and to do nothing or it will break the system. dont mind the 77mb but would like to have my apps on my sd. any help would be great.
Do you have ext3? Drizzy expressly says you need it. So I assume if you only have ext2 there might be probs with your a2sd.
If that's not it. Did you follow all of these steps before flashing?...
This is how I installed without any problems:
: rename to update.zip
: place in the root of sd card
: shut off device
: boot into recovery
: wipe
: go to console and hit enter
(enter)
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# cd /system/sd
# rm -rf /system/sd/*
# reboot recovery
: now wipe again
: repair ext system
: flash
Enjoy!!
"DO NOT RUN ANY OTHER APPS TO SD IT WILL BREAK YOUR SYSTEM"
JUST EXT3 & LINUX-SWAP 32MB
kree said:
just wondering if im doing something wrong? got NV installed with all 3 partitions and I had 77mb of internal mem. when I install new apps it takes away mem, am I doing something wrong, did I not config something right? I have read that apps2sd are automatic and to do nothing or it will break the system. dont mind the 77mb but would like to have my apps on my sd. any help would be great.
Click to expand...
Click to collapse
your apps are going to the sd..your dalvik-cache is not
yup. checked thru the the console that in fact I do have an ext3 partition. I went thru an infinate loop with out it, also followed all the steps as best as an old newb could, I mean Im not new to flashing roms coming from the herald and wing, but concidering ow these android roms are becoming like full linux distro installs its getting a little hard to keep up, but still willing to try. gonna look up the dav thing to see where that leads me. definately an adventure! thanks!
OK, I'm going to stop polluting other threads with my stuff.
This should help make sure I can keep up on the discussions and provide support for people trying to use my ZIPs and/or scripts.
NOTE: This version requires JACs kernel and init.d mods. Flash his stuff, then flash mine. All this will be integrated at some point and any other dev is welcome to integrate my stuff with theirs.
In addition to the JAC kernel, you need an ext partition on the EXTERNAL SD card. DO NOT USE ROM MANAGER TO PARTITION. You will get into a boot loop and will have to Odin back to stock. For partitioning, you may use "adb shell" in clockwork recovery, an old G1/Mytouch with Amon-Ra/Clockwork, a computer with a card reader and GPartd, Paragon, etc.. If you do it with fdisk, don't forget to format the partitions, here are some sample commands.
This will format an ext2 partition.
Code:
/system/bin/mke2fs /dev/block/mmcblk1p2
Convert from ext2 to ext3
Code:
/system/bin/tune2fs -j /dev/block/mmcblk1p2
Convert ext3 to ext4
Code:
/system/bin/tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk1p2
fsck, any ext version. Do this when you are done converting between types.
Code:
/system/bin/e2fsck -fpDC0 /dev/block/mmcblk1p2
For all of the above, make sure the partition isn't mounted with "mount". You also have to have already flashed either this ZIP, or my e2fsprogs-ext4 ZIP for the files to be installed in /system/bin.
This version will clean up older versions that I know about. It will remove any use of the playlogos hack, and the older version of my script that JAC included in his kernel.
Quadrant - 1722. I have also not seen any lag from this change. I've tried some apps that make heavy use of the database, and so far it's performing quite well. If you do see problems, I suggest fsck on the ext partition, and perhaps formatting it, to ensure it's nice and clean.
Please note that benchmark results will vary based on a large number of factors beyond my control. Try with a clean phone, no background apps. A faster SD card will help as well. I am using an older Transcend 8GB Class 6 that I used to use on my G1. It doesn't help that the free Quadrant tests lots of stuff, not just activity on /data/data and such.
To see if it's working, open a shell and type "mount". You should see entries like this:
Code:
/dev/block/mmcblk1p2 on /sd-ext type ext4 (rw,noatime,nodiratime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/dalvik-cache type ext4 (rw,noatime,nodiratime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/data type ext4 (rw,noatime,nodiratime,barrier=1,data=ordered)
Added data-only ZIP and the disable/revert ZIP.
Added auto-partition ZIP to create 1GB ext3 partition automatically. Note that this will delete ALL SD contents.
Added old-style enable-dc2sd for users of the auto-partition script. Do not use for JAC kernels, use the current dc2sd instead.
Changelog:
8/9/2010: Added loopback style version, should find prior versions and remove them, copying your data from the /sd-ext partition.
v2.
Compatibility fix for JAC -6 kernel.
v1.
Added e2fsprogs w/ext4 support to the ZIP
Better integration with init.d layout
On boot fsck to ensure that the ext partition is kept clean
Automatically copy files if /data has larger directories than /sd-ext
Test versions that should fix busybox to work with the newer JAC kernels. -loop uses the loopback filesystem method (RyanZA style). The other one is for an ext partition on the external SD card.
Feel free to post direct links or links to the kernel thread.
For some reason, the convetr to ext4 command isnt working for me.
Just says "Tune2fs 1.41.6" then back at # prompt
GREAT RESOURCE - Deserves a sticky just for the conversion syntax
EDIT: Maybe not, it said mounted as an ext3 before, now it says ext4
EDIT2: SUCCESS!!!!! EXT4 gives a major boost to the Quadrant score - 1531. WAY better than the~1100 i was getting before. Stupid G1 didnt actually convert ext3 to ext4, even though it said it did. Thanks!
Not that I'm stressin over Quadrant scores, but I just dropped ~100 (previous was 1497) after flashing this. Ah well.
Hmmm, before applying this script, I was just using JAC's v5 kernel, which worked fine, but after applying the OP's script, I cant backup in Clockwork (again lol).
It doesnt seem to mount /data and /datadata, as it only backs up /system and errors out on the other two. Any idea why?
EDIT: The error is really random, Ive now had 2 successful backups, 2-3 that failed due to mount issues, and 2-3 that failed due to MD5 issues. I would like to narrow down the possibilities, and I attempted a restore to stock, rooted, and then used JAC's kernel, same issue occurs (did not use your newest script). That being said, I dont think its your script. (stumped)
When converting to ext4 it said "please run e2fsck on the filesystem"
EDIT: Ran "mount" and it shows same messages you do. So it worked
LovellKid said:
When converting to ext4 it said "please run e2fsck on the filesystem"
EDIT: Ran "mount" and it shows same messages you do. So it worked
Click to expand...
Click to collapse
It's supposed to say that. Do it.
Glad it's working for some of you. As for nandroid, no idea. I'll install jac latest and check it out. Can't think of much I could have done to it though, I can't mod the ramdisk this way.
+1 on the nandroid, I went back and tried and couldnt. Also, tried to flash anamolous deodexed ROM and wouldnt. Gave errors e: cant mount /dev/block etc and failed. Could this be related?
LovellKid said:
+1 on the nandroid, I went back and tried and couldnt. Also, tried to flash anamolous deodexed ROM and wouldnt. Gave errors e: cant mount /dev/block etc and failed. Could this be related?
Click to expand...
Click to collapse
I doubt it, my stuff doesn't run in recovery, at least I don't think it will. I've never seen it run. I'll look into it, but it sounds like the jac mod might have an issue with nandroid right now.
There was a similar issue on the g1 with cm6. I wonder if that fix will work here...
Could you also post the Just DATA, and revert scripts in this thread please
Also, what would be the proper flashing order for just data?
1. JAC init.d
2. reverse
3. Just data
Or do I have to flash init.d, apply kernel, then reboot and flash reverse then just data?
The_Chrome_Coyote said:
Could you also post the Just DATA, and revert scripts in this thread please
Also, what would be the proper flashing order for just data?
1. JAC init.d
2. reverse
3. Just data
Or do I have to flash init.d, apply kernel, then reboot and flash reverse then just data?
Click to expand...
Click to collapse
Added revert and data-only to the OP.
If you don't have any sd-ext hack installed right now:
1. JAC init.d
2. data-only ZIP
3. reboot to download mode and flash the JAC kernel
If you already have dc2sd installed:
1. Revert ZIP
2. JAC init.d ZIP
3. Data-only ZIP
4. reboot to download mode and flash the JAC kernel
If you already have the kernel and the JAC init.d:
1. Revert ZIP
2. Data-only ZIP
I am trying to revert this fix, so I can try the new hack involving a virtual EXT2 partition. I tried the revert, and I manually deleted the a2sd and dc2sd files in init.d, but it rebuilds data when I reboot. ANy ideas?
zimphishmonger said:
I am trying to revert this fix, so I can try the new hack involving a virtual EXT2 partition. I tried the revert, and I manually deleted the a2sd and dc2sd files in init.d, but it rebuilds data when I reboot. ANy ideas?
Click to expand...
Click to collapse
You likely have a script in /system/etc/init.d doing it, or you didn't clean the old playlogos stuff up.
FWIW, I'm working on a similar way of doing it, but with ext4 and a proper init script. I don't like using ext2 for this stuff, too easy to corrupt it.
Does your new loop script require an sdcard with ext 4 partition or does it use the internal sd card?
ttabbal said:
You likely have a script in /system/etc/init.d doing it, or you didn't clean the old playlogos stuff up.
FWIW, I'm working on a similar way of doing it, but with ext4 and a proper init script. I don't like using ext2 for this stuff, too easy to corrupt it.
Click to expand...
Click to collapse
Thanks for your work! I found your dc2-loop-v1 script. Will play w/ that until you come out w/ something better. Is EXT2 really that fragile in terms of corruption when it is virtualized within a journaled file system (which I believe RFS is)
frank707 said:
Does your new loop script require an sdcard with ext 4 partition or does it use the internal sd card?
Click to expand...
Click to collapse
This loop version doesn't use an ext partition. Just the loopback mount. It will copy the files from an ext partition if you have applied that hack.
zimphishmonger said:
Thanks for your work! I found your dc2-loop-v1 script. Will play w/ that until you come out w/ something better. Is EXT2 really that fragile in terms of corruption when it is virtualized within a journaled file system (which I believe RFS is)
Click to expand...
Click to collapse
Most file system journals don't help with the data just the structure. Rfs rides on vfat, so I doubt it's worth much that way.
Gave the dc2-loop script a shot, to convert from the /SD-EXT method to this new ext4 container method. It creates the container correctly, but never seems to copy everything over. All my apps act as if i've never started them up, so Data isnt getting copied over correctly.
EDIT: Tried again, the dc2-loop script def doesnt work, and I have no idea why. It looks perfect (code-wise), but for whatever reason doesnt end up working properly
can't get your loop script working. every other one i have been able to run flawlessly. i just flashed the oc kernel by jac. any further instructions or pre reqs?
The basic idea of this mod is moving all partitions to the SD card, and running the full OS from the SD card.
There are many reasons why not to do this and probably is a bad idea, but the main reason behind this mod is just a proof of concept that can potentially result in a better internal and external memory utilization and speed improvements.
Reasons I can think of for not doing this:
- Reduced responsiveness and overall speed.
- Over stress on the SD card that can potentially leed to permanent damage to the card.
- The need to use modified boot and recovery images, thus leading to an install incompatible with any rom update (as it is) out there.
- Reduced battery autonomy.
- Many more I can't think of right now.
Reasons to do this:
- Because we can.
- As a proof of concept.
- For developing purposes.
- We get the ability to switch between 2 installations just by switching the SD card (of the same rom or roms with compatible boot images: kernel+ramdisk).
Don't do any of this if you don't know what you are doing!!!
Simplified steps (I've only tested this with Mik's CM7 (betas 6.2 and 6.3) + ClockWorkMod recovery on a Ubuntu machine):
- Download and flash ClockWorkMod recovery.
- Download and flash Mik's CM7.
- Do a full backup from recovery.
- Turn the phone off.
- Take out the SD card and put it on a Card reader on your PC.
- Backup the SD Card contents (including the full backup).
- Use Gparted (or any partition manager that has support for ext4 partition creation) to create the following partition structure:
Code:
num mount point size type
1: /sdcard REST fat32
2: /data 500M ext4
3: /system 190M ext4
4: /cache 64M ext4
The partition number is important, so you should calculate the fat32 partition beforehand or resize the existing one.
- Put new boot and recovery images on the fat32 partition. *
- Put the card on the phone and boot into recovery.
- Mount the sdcard trough menu.
- Connect the phone to your pc and start adb shell.
- Flash custom boot and recovery images:
Code:
flash_image boot /sdcard/boot-everything2sd.img
flash_image recovery /sdcard/recovery-everything2sd.img
- Reboot recovery.
- Through menu, mount all partitions.
- Connect trough adb shell and copy your data:
Code:
adb shell
cp -a /int-cache/* /cache/
cp -a /int-system/* /system/
cp -a /int-data/* /data/
- In adb shell, remove the sd_ext mount script:
Code:
rm /system/etc/init.d/05mountsd
- Reboot the phone.
Off course, no other method of storing the apps on the SD is desired as they are already there.
* I've attached custom boot and recovery images for Mik's CWM and CM7 beta 6.2 (updated boot images to Mik's CM7.02 beta 6.3 in post #3), but, the steps for creating them are next:
- Extract the original images (boot.img and recovery.img) from the root of the downloaded zips (signed-recovery.zip and cyanogen_thunderg-ota-eng.mik.zip).
- Unpack the images following this guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images: Alternative Method (Perl scripts are attached, you'll need compiled mkbootfs and mkbootimg for your OS).
- On recovery ramdisk, change the etc/recovery.fstab file as follows:
Code:
# mnt pnt fstype device [device2] [fstype2]
/boot mtd boot
/cache ext4 /dev/block/mmcblk0p4
/data ext4 /dev/block/mmcblk0p2
/misc mtd misc
/recovery mtd recovery
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 ext4
/system ext4 /dev/block/mmcblk0p3
/int-cache yaffs2 cache
/int-data yaffs2 userdata
/int-system yaffs2 system
- On boot ramdisk, change the init.rc file as follows (diff output):
Code:
[email protected]:~/Descargas/bootimages$ diff boot.img-orig_ramdisk/init.rc boot.img-ramdisk/init.rc
22d21
< export SD_EXT_DIRECTORY /sd-ext
68,69d66
< mkdir /sd-ext 0771 system system
<
100,103c97,100
< mount yaffs2 [email protected] /system
< mount yaffs2 [email protected] /system ro remount
< mount yaffs2 [email protected] /data nosuid nodev
< mount yaffs2 [email protected] /cache nosuid nodev
---
> mount ext4 /dev/block/mmcblk0p3 /system
> mount ext4 /dev/block/mmcblk0p3 /system ro remount
> mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev
> mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev
- Recreate the ramdisks and images following the guide posted above, changing the mkbootimg command line to (notice the base and cmdline parameters; for recovery, change boot to recovery on all instances):
Code:
mkbootimg --base 0x12800000 --cmdline 'mem=471M console=ttyMSM2,115200n8 androidboot.hardware=thunderg' --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz -o boot-new.img
Ahaha another sleepless night ahead to test this out. Any Quadrant Advanced I/O score for comparison?
I've updated boot images to Mik's CM7.02 beta 6.3, attached below.
I'm going to run a Quadrant Advanced and let you know. Anyway, I don't think I will get good results, as my SD card is cheap and buggy, half the time it doesn't get mounted, with or without this mod. Also, I think we'll get better scores with your tweaks, especially with the modded libsqlite.so.
The idea behind this is not to get impressive results or leave it as a definitive mod (as it is right now). Instead, the idea I have is to start moving some things back to the internal memory, for instance, mounting [email protected] as /data/dalvik-cache (just an idea). Basically, leaving the things that need fast reading times, but infrequent writes in the SD, and the things that are constantly being written to, in the internal memory.
Seems awesome. I already booted up perfectly with the modded .imgs, no issues.
so what class of sd card do you preffer?
still class 4 above?
well, sorry about what im going to say , but if **** happened and luckily sd card got corrupted, then the phone does as well?
ive not read all of your first post,
but if ever we are changing sd cards, like example upgrading from 4g-8g,
is it necessary to repeat the whole process or copy paste is enough?(i bet not due to ext)
cmangalos said:
so what class of sd card do you preffer?
still class 4 above?
well, sorry about what im going to say , but if **** happened and luckily sd card got corrupted, then the phone does as well?
ive not read all of your first post,
but if ever we are changing sd cards, like example upgrading from 4g-8g,
is it necessary to repeat the whole process or copy paste is enough?(i bet not due to ext)
Click to expand...
Click to collapse
If **** happened you could mount it in a computer with a card reader and perform a disk check + recovery. If the sd card broke, well.. I think there's still hope, since you may boot in recovery and replace the mount points back to the internal memory ( right ? )
As for the storage upgrade, well, it's not exactly copy-paste but you should be able to duplicate the partitions without much hassle..
I really like this idea,we could get 3000+ quadrant score
But can be potentially dangerous. If anything goes wrong i think that Phone can't boot anymore.
how abt two separate roms in 6 separate partitions ???? is the bootloader cracked ??? Can we have a grub like menu to select two roms ???Way 2: Maybe somebody cud mod android's initramfs and add options there to select two different fstabs ...just a thought
a dual boot would be cool... one rom on the internal nand memory and the other on SD card...
Having fastboot disabled is such a pain in the ass...
ciaox said:
I really like this idea,we could get 3000+ quadrant score
Click to expand...
Click to collapse
Not me, because my SD card is very buggy. Anyway, it depends very much on the card, the card reader and the kernel. Anyway, it's just a proof of concept and it opens a great window for experimentation.
ciaox said:
But can be potentially dangerous. If anything goes wrong i think that Phone can't boot anymore.
Click to expand...
Click to collapse
Not at all, recovery can boot even if the SD card is damaged or not present. Then you can flash the original recovery, boot it and flash any ROM without this mod.
Steps:
- Extract recovery.img from your desired custom recovery.
- Boot recovery.
- Mount /int-cache from mounts and storage menu.
Code:
adb push recovery.img /int-cache/recovery.img
adb shell
flash_image recovery /int-cache/recovery.img
- Reboot recovery
- Flash desired ROM from any SD card.
OR: Just flash an original (released by LG) ROM through emergency mode.
sarfaraz1989 said:
how abt two separate roms in 6 separate partitions ???? is the bootloader cracked ??? Can we have a grub like menu to select two roms ???Way 2: Maybe somebody cud mod android's initramfs and add options there to select two different fstabs ...just a thought
Click to expand...
Click to collapse
Bootloader isn't cracked yet, so it would have to be implemented on the boot.img (kernel and/or ramdisk), and I don't know how. Right now is easier to swith SD cards. Anyway, ROMs should be able to share boot.img (kernel + ramdisk).
ciaox said:
Having fastboot disabled is such a pain in the ass...
Click to expand...
Click to collapse
+1. But bootloader isn't cracked yet.
Just a little heads up, but if anyone is paying attention to the Nook Color development, this is exactly how the boot process on that device works, I am running one os off the sd card and if I remove it I am back to stock. The main point of my brining this up is you create the sd card with all it's partitions by flashing an image of the sd card with the WinImage application on windows. Might at least save you some steps. Hope this helps.
tsukisan said:
Just a little heads up, but if anyone is paying attention to the Nook Color development, this is exactly how the boot process on that device works, I am running one os off the sd card and if I remove it I am back to stock. The main point of my brining this up is you create the sd card with all it's partitions by flashing an image of the sd card with the WinImage application on windows. Might at least save you some steps. Hope this helps.
Click to expand...
Click to collapse
Possibilities seem to be limitless.
Sent from my LG-P500 using Tapatalk
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.
Or you can simply switch mount points in vold.fstab
neobuddy89 said:
Or you can simply switch mount points in vold.fstab
Click to expand...
Click to collapse
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.
aureusz said:
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.
Click to expand...
Click to collapse
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.
neobuddy89 said:
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.
Click to expand...
Click to collapse
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
neobuddy89 said:
Or you can simply switch mount points in vold.fstab
Click to expand...
Click to collapse
Is it possible that you post the vold.fstab where the mount point is switched for internal and external SDcard? Thanks.
Re: [CMW, Init.d Script] Swap IntenalSD<->ExternalSD
any updates here?
Sent from my GT-N7000 using xda premium
Link2SD GUIDE
ROOTED DEVICES ONLY
Link2SD is a good solution to save the contents of your internal memory, I know we have a lot but its a good idea in the case of saving more space on your internal memory.
Back up your external sd contents before proceeding!
STEP 1
Install these:
https://play.google.com/store/apps/details?id=stericson.busybox
https://play.google.com/store/apps/details?id=com.sylkat.AParted
https://play.google.com/store/apps/details?id=com.broodplank.initdtoggler
https://play.google.com/store/apps/details?id=jackpal.androidterm
STEP 2
If you've already installed busybox, skip this step.
Install busybox using the busybox installer into /system/xbin
STEP 3
After install, unmount your external sd card from System/Storage/Unmount SD Card
THEN, unmount your external sdcard and sdext2 partition if you have one, from terminal emulator.
Thsi varies from ROM to ROM, I'm on CM11, so I run these commands
Code:
mount -o remount,ro /storage/sdcard1
umount /storage/sdcard1
mount -o remount,ro /data/sdext2
umount /data/sdext2
If you're stock, do this...
Code:
mount -o remount,ro /storage/external_SD
umount /storage/external_SD
mount -o remount,ro /data/sdext2
umount /data/sdext2
Again, rom specific. If you don't have an sdext2 partition, no need for the BOTTOM TWO commands.
STEP 4
Open AParted and resize your external sd card's partition, then make yourself an ext4 formatted sdext partition. Mine is 8 GB in size, since I have a 16 GB card. The journal write takes a long time...usually about a minute and a half. Don't cancel it or you'll end up with a corrupt sd card.
STEP 5
Remount your sd card by your system menu, this is the easy way.
STEP 6
Toogle init.d in Init.d Toggler. Only for stock ROMs without init.d support. Skip this if you've already done init.d or have a ROM that has it baked/enabled.
STEP 7
Install Link2SD and the pro key. The pro key costs money, so if you're poor than I'm sorry. I'm really poor, it's only a few bucks. XD
https://play.google.com/store/apps/details?id=com.buak.Link2SD
https://play.google.com/store/apps/details?id=com.buak.link2sdplus
Run Link2SD after both are installed. If done correctly you'll get a prompt asking you to create your mount scripts, so select ext4 format and confirm, then CANCEL reboot. Go to Link2SD settings and enable Relink Lib files and Relink .dex files at boot. I also make my cache auto-clear every 6 hours or so. Auto link is a really bad idea. Since some system apps break when you link them. Clear the app and dalvik cache. Some of your apps may crash. Recreate your mount scripts again, then REBOOT.
STEP 8
Go into Link2SD and link all your user apps, you can use the filter at the top and serlect "User" to see which ones you installed. DO NOT link anything that modifies your system, since those apps are known to break. For example, voltage control or ROM Manager / ROM Toolbox break when you link them. Since you have the pro version you can link the internal data too!
DO NOT link any system apps. This is a likely known cause for a brick.
DO NOT link CM themes.
DO NOT link launchers.
STEP 9
You have successfully installed Link2SD and have it working! I suggest installing SD booster or making yourself an init.d script to boost your read ahead speed at boot. This helps A LOT with app execution on older sd cards.
I hope this guide helped! Remember, if you fark up you did it to yourself! I'm not responsible.
The L90 D415 is awesome!!!
~LoopyD
Donate to the PayPalz ([email protected])
Partitions with cwm can work too?
I don't use cwm, but TWRP, so wouldn't know.