Faster CM11 - Xperia SP General

Hi,
Just to give a return about 2 tweaks I use on my phone running MrSteve555 v12.5 CM11 LBL ROM that gave me ~1500 more points on antutu (28340 reached). Antutu score is not important but my phone is significantly more responsive (and battery life probably improved too):
1- Qualcomm Optimized dalviq libs and executables from here : http://forum.xda-developers.com/showpost.php?p=53963337&postcount=1287
The right package is cwm-Qualcomm.Optimized.Dalvik-1+One-CAF.zip
Depending the cm11 you’ re runing you may have to modify this zip install because some libs can be located in an other place (ask your rom dev).
I added also these 2 lines in build.prop (Not sure it helps):
dalvik.vm.verify-bytecode=false
dalvik.vm.dexopt-flags=m=y,o=v,u=y
Then, wipe dalviq cache and restart
2- Now, an old tweak I used on my old motorola atrix runing cm7: disabling ext4 journal on the 3 partitions. On Atrix I never faced any corrupted datas in 2 years, I hope this will continue with my SP. But obviously it’s important to have a stable rom, any unexpected reboot may result in data corruption. It’s not a safe tweak in theory.
To do that I reboot recovery using TWRP. With it I can access the device with adb :
- umount /cache and /system and /data
- tune2fs -o journal_data_writeback /dev/block/mmcblk0p13
- tune2fs -O ^has_journal /dev/block/mmcblk0p13
- repeat this 2 commands with mmcblk0p14 (cache) and mmcblk0p15 (data)
- I also put this script in /system/etc/init.d but didn’t made any benchmark to see if it gives an improvment (it was on my atrix so I put it in my SP) :
#!/system/bin/sh
# Perfect Mounting
# Cut atime
for k in $(mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime,nodiratime $k
done;
# Ext4 tweaks
busybox mount -o remount,rw,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /system
busybox mount -o remount,rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /data
busybox mount -o remount,rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,nobh,delalloc,noauto_da_alloc,discard /cache
That's it. Have fun, or not ...

Related

Need help with apps2sd on milestone

I found a guide to aply apps to sd on my milestone. I got it working, but the problem is, that apps installed in the data/app-private folder doesn't show as installed. I can see that they are placed in ext2 partion on my sd card along with the other apps, that normaly installes in data/app.Here is the guide i used
After creatting a ext2 partition on my SD card, i copied ext2. To sd card along with
mot_boot_mode script
#!/system/bin/sh
export PATH=/system/bin:$PATH
mot_boot_mode.bin
insmod /data/ext2.ko
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
Then in recovery mode i entered
adb shell
su
cp /sdcard/ext2.ko /data/ext2.ko
insmod /data/ext2.ko
mkdir /data/sdapp
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
cp /data/app/* /data/sdapp/
mkdir /sdcard/sicherung
cp /data/app/* /sdcard/sicherung
rm -r /data/app
umount /data/sdapp
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
ls /data/sdapp
ln -s /data/sdapp /data/app
chmod 644 /data/sdapp/*
/data/busybox/chown -h 1000:1000 /data/app
/data/busybox/chown 1000:1000 /data/sdapp/*
/data/busybox/chown 1000:1000 /data/sdapp
insmod /data/ext2.ko
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
mount -o remount,rw / /system
mv /system/bin/mot_boot_mode /system/bin/mot_boot_mode.bin
cp /sdcard/mot_boot_mode_script /system/bin/mot_boot_mode
chmod 755 /system/bin/mot_boot_mode
Do i need to make a symbolic link in data/app-private also?
I would realy like to get this working, because i purchased a lot of apps on the marked. But i have only half of them installed. It used to work on my HTC hero. But it was allready enabled in a custom rom. And that is not possible to do on a Milestone
Thanks
Fixed it by changing app-private folder two
hey glaus...
this almost seems like a guide, hehe...
i'm trying to get apps2sd to work on my milestone as well...
i tried booting in recovery mode and entering the chain of commands you just set out....
but when i go into recovery mode, i see the reboot system option, apply sdcard:update.zip, wipe data/factory reset and wipe cache partition....
and under it, i have e: can't open /cache/recovery/command
any ideas on how to fix this or where can i enter those commands you set out?
i tried in adb shell, but i get a /data/busybox/chown is not found error when setting the permissions...
thanks!
do
crap me too and it deleted some apps 2 i really want this been trying for a week oh i have a telus milestone and get the same above error.busybox is installed and hard drive is partioned
ah crap market is gone 2 lol gotta do a nano restore......man i want this bad i even bricked my phone and brought it back to life this week arghhhh
yeah...i don't know where claus is from...but if he has a telus milestone, he's the only one i've seen been able to install apps2sd with a telus milestone
i've seen other countries, even some with the same bands as we have, but none have had the actual "telus" one....the funny thing is that i can get everything else to work..
i have titanium backup pro, emulator, root explorer and everything is at superuser access...
if claus can help, i will bear his children
edit: how the heck do you install/activate the mot_boot_mode script? I see reference to it in a few wikis on basically that's what will allow us to use apps2sd...but I have no clue how to implement it
got app2sd working on milestone using a diff method will post soon
ok i got app2sd working on my telus milestone here is how i did it if u tried this method here ur gunna have to unroot then root or use a nano backup of freshly rooted phone busybox need mot to be installed so use titanium for back up and proceed http://forum.xda-developers.com/showthread.php?t=692367
ClausG76 said:
I found a guide to aply apps to sd on my milestone. I got it working, but the problem is, that apps installed in the data/app-private folder doesn't show as installed. I can see that they are placed in ext2 partion on my sd card along with the other apps, that normaly installes in data/app.Here is the guide i used
After creatting a ext2 partition on my SD card, i copied ext2. To sd card along with
mot_boot_mode script
#!/system/bin/sh
export PATH=/system/bin:$PATH
mot_boot_mode.bin
insmod /data/ext2.ko
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
Then in recovery mode i entered
adb shell
su
cp /sdcard/ext2.ko /data/ext2.ko
insmod /data/ext2.ko
mkdir /data/sdapp
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
cp /data/app/* /data/sdapp/
mkdir /sdcard/sicherung
cp /data/app/* /sdcard/sicherung
rm -r /data/app
umount /data/sdapp
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
ls /data/sdapp
ln -s /data/sdapp /data/app
chmod 644 /data/sdapp/*
/data/busybox/chown -h 1000:1000 /data/app
/data/busybox/chown 1000:1000 /data/sdapp/*
/data/busybox/chown 1000:1000 /data/sdapp
insmod /data/ext2.ko
mount -t ext2 /dev/block/mmcblk0p2 /data/sdapp
mount -o remount,rw / /system
mv /system/bin/mot_boot_mode /system/bin/mot_boot_mode.bin
cp /sdcard/mot_boot_mode_script /system/bin/mot_boot_mode
chmod 755 /system/bin/mot_boot_mode
Do i need to make a symbolic link in data/app-private also?
I would realy like to get this working, because i purchased a lot of apps on the marked. But i have only half of them installed. It used to work on my HTC hero. But it was allready enabled in a custom rom. And that is not possible to do on a Milestone
Thanks
Click to expand...
Click to collapse
fixed http://forum.xda-developers.com/showthread.php?t=692367

About data2loop to increase stability

My English is poor, so I only give the code, without more explanation.
code modiy from ownhere's data2ext
create 3rd ext4 partion for loopback device.
Please note '-o sync,commit=5',This will enhance the stability.
Code:
$BUSYBOX mknod /dev/loop0 b 7 0
$BUSYBOX losetup /dev/loop0 /dev/block/mmcblk3p3
$BUSYBOX mount -t ext4 -o sync,commit=5,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/loop0 /mnt/asec/extdata
you can turn off journal for speed:
Code:
/system/bin/tune2fs -O ^has_journal /dev/block/mmcblk3p3
Code:
busybox ls -lL /dev/loop*
brw------- 1 0 0 7, 0 Jan 9 19:17 /dev/loop0
brw------- 1 0 0 7, 1 Jan 9 19:17 /dev/loop1
brw------- 1 0 0 7, 2 Jan 9 19:17 /dev/loop2
brw------- 1 0 0 7, 3 Jan 9 19:17 /dev/loop3
brw------- 1 0 0 7, 4 Jan 9 19:17 /dev/loop4
brw------- 1 0 0 7, 5 Jan 9 19:17 /dev/loop5
brw------- 1 0 0 7, 6 Jan 9 19:17 /dev/loop6
brw------- 1 0 0 7, 7 Jan 9 19:17 /dev/loop7
Scoring won't be so high, but stability will increase a lot
Hi Chenglu, I've actually already tried to modify your original data2loop script to use ext4 and run it with a kernel with ext4 built in. It actually benchmarks great on first boot, somewhat better than the original ext2 data2loop version, but the tablet won't boot again, it crashes sometime during boot and I have to wipe data and restart.
Not sure if the sync,commit=5 options will make a difference - maybe I'll give that a try and see if it helps...
EDIT: No, it still pukes out on reboot, those options don't make a difference. I've attached my inandop.sh file here. If you diff this with yours, there are only a few changes, and I'm just not sure why it doesn't work. Any ideas?
Chenglu...
Thanks... this should help... but I am still very concerned with this approach..
Even though you are performing a sync you still can not guarantee that the data has been flushed out.. Flushing will depend on what other operations are in queue within the I/O sub system. In addition, right now you have a commit of every 5 seconds which honestly again leaves room for possible corruption. Again should help as this setting is meant for removable storage...
Lastly DO NOT turn off the Journal. yes it will speed up the file system BUT at a HUUGE risk of data loss in the event of unclean shutdown. This is your only fail safe that ensures filesystem consistency even across unclean shutdown.
Generally I agree with this approach for many situations but NOT your entire system partition or critical data partitions...
These devices are too portable with unreliable power sources (not the battery but the ability for it to reboot on its own and the ability for you to accidentally power it off)..
I for one am against this performance boost...
Chenglu said:
My English is poor, so I only give the code, without more explanation.
code modiy from ownhere's data2ext
create 3rd ext4 partion for loopback device.
Please note '-o sync,commit=5',This will enhance the stability.
Code:
$BUSYBOX mknod /dev/loop0 b 7 0
$BUSYBOX losetup /dev/loop0 /dev/block/mmcblk3p3
$BUSYBOX mount -t ext4 -o sync,commit=5,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/loop0 /mnt/asec/extdata
you can turn off journal for speed:
Code:
/system/bin/tune2fs -O ^has_journal /dev/block/mmcblk3p3
Code:
busybox ls -lL /dev/loop*
brw------- 1 0 0 7, 0 Jan 9 19:17 /dev/loop0
brw------- 1 0 0 7, 1 Jan 9 19:17 /dev/loop1
brw------- 1 0 0 7, 2 Jan 9 19:17 /dev/loop2
brw------- 1 0 0 7, 3 Jan 9 19:17 /dev/loop3
brw------- 1 0 0 7, 4 Jan 9 19:17 /dev/loop4
brw------- 1 0 0 7, 5 Jan 9 19:17 /dev/loop5
brw------- 1 0 0 7, 6 Jan 9 19:17 /dev/loop6
brw------- 1 0 0 7, 7 Jan 9 19:17 /dev/loop7
Click to expand...
Click to collapse
Fast internal storage and ext4 partion is the fundamental solution.
loopback device In some respects have an advantage.
I dont dispute the performance gain... but at a risk. Everyone should be aware of this and accept the risk... If you do then thats fine...
I guess I'm more conservative when it comes to my data.
Chenglu said:
Fast internal storage and ext4 partion is the fundamental solution.
loopback device In some respects have an advantage.
Click to expand...
Click to collapse
rcgabriel said:
Hi Chenglu, I've actually already tried to modify your original data2loop script to use ext4 and run it with a kernel with ext4 built in. It actually benchmarks great on first boot, somewhat better than the original ext2 data2loop version, but the tablet won't boot again, it crashes sometime during boot and I have to wipe data and restart.
Not sure if the sync,commit=5 options will make a difference - maybe I'll give that a try and see if it helps...
EDIT: No, it still pukes out on reboot, those options don't make a difference. I've attached my inandop.sh file here. If you diff this with yours, there are only a few changes, and I'm just not sure why it doesn't work. Any ideas?
Click to expand...
Click to collapse
your busybox support ext4?
Chenglu said:
your busybox support ext4?
Click to expand...
Click to collapse
good point, that was a mistake. I am now using a statically compiled version of mkfs.ext4 that seems to work. Mount doesn't need explicit ext4 support in busybox, should just work. And I think I'm using a version of fsck that supports ext4.
EDIT: Okay, I'm using mkfs.ext4 which I've tested from the command line and it is clearly making a real ext4 filesystem. Also using a version of es2fsck that ought to work with ext4. These are both from the Desire forums, but seem to be generic ARM binaries so they seem to run on our G Tablet.
Still same result - works on first boot, not thereafter.
Maybe I need to use a version of busybox that explicitly supports ext4? Trying that next.
BTW, I got the binaries I'm using from the data2ext.zip file here: http://forum.xda-developers.com/showthread.php?t=859419
Also - ownhere's script looks pretty badass. We should consider using something based on that.
EDIT2: I am using busybox, mkfs.ext4 and e2fsck from the Desire forums, so it should support ext4 fully. Nonetheless, the exact same screen flicker followed by screen shutting off occurs with this. Attached is my updated inandop.sh. This is just baffling.
rcgabriel said:
good point, that was a mistake. I am now using a statically compiled version of mkfs.ext4 that seems to work. Mount doesn't need explicit ext4 support in busybox, should just work. And I think I'm using a version of fsck that supports ext4.
EDIT: Okay, I'm using mkfs.ext4 which I've tested from the command line and it is clearly making a real ext4 filesystem. Also using a version of es2fsck that ought to work with ext4. These are both from the Desire forums, but seem to be generic ARM binaries so they seem to run on our G Tablet.
Still same result - works on first boot, not thereafter.
Maybe I need to use a version of busybox that explicitly supports ext4? Trying that next.
BTW, I got the binaries I'm using from the data2ext.zip file here: http://forum.xda-developers.com/showthread.php?t=859419
Also - ownhere's script looks pretty badass. We should consider using something based on that.
EDIT2: I am using busybox, mkfs.ext4 and e2fsck from the Desire forums, so it should support ext4 fully. Nonetheless, the exact same screen flicker followed by screen shutting off occurs with this. Attached is my updated inandop.sh. This is just baffling.
Click to expand...
Click to collapse
I'm working on this as well...
Took a look at your script. It looks like you've put everything (including busybox) into /system/bin instead of /system/xbin? Your environment variable for busybox shows /system/bin...
Just wanted to confirm...
rcgabriel said:
EDIT2: I am using busybox, mkfs.ext4 and e2fsck from the Desire forums, so it should support ext4 fully. Nonetheless, the exact same screen flicker followed by screen shutting off occurs with this. Attached is my updated inandop.sh. This is just baffling.
Click to expand...
Click to collapse
I'm unable to get the loop file to mount as ext4 with ADB after it fails...
I'm not sure if/why it actually mounted in the first place, but I'm thinking this is a kernel issue. Are you positive that your kernel supports ext4? Also, I'm thinking ext4 might need to be compiled into the kernel instead of a module.
I could be wrong, though....
Also check which mount binary you are using. Busybox has one, but there is also a "mount" sometimes linked to the "toolbox" binary in /system/bin.
Ok so I (sort of) got it working.
After getting a kernel that is known working with ext4, the system was able to mount the partition again. I was getting the vegan "loop", so I went in with ADB and saw that the partition was mounted but all of the files were gone.
I then booted into CW and mounted USB, and at the same time on my PC I extracted my /data/data folder from a recent clockwork backup and copied it to /sdcard. I then unmounted USB and mounted /system and /sdcard from CW. Then from ADB I copied the data folder over to /mnt/asec/extdata and fixed the perms. I created empty folders for app-private and anr because they were empty on my backup (other than a traces.txt file in anr).
After bouncing the tab it booted up, but some of my settings were blown away. No big deal. Quadrant crashes at the I/O test part, but it might be because I don't have an Internet connection. The wifi is broken with the kernel I'm using.
Let me know if you still can't get things mounted. I'll test this more tomorrow when I get a fixed kernel.
I'm going to start working on the alternate approach of adding a 3rd partition...
anlog said:
Ok so I (sort of) got it working.
After getting a kernel that is known working with ext4, the system was able to mount the partition again. I was getting the vegan "loop", so I went in with ADB and saw that the partition was mounted but all of the files were gone.
I then booted into CW and mounted USB, and at the same time on my PC I extracted my /data/data folder from a recent clockwork backup and copied it to /sdcard. I then unmounted USB and mounted /system and /sdcard from CW. Then from ADB I copied the data folder over to /mnt/asec/extdata and fixed the perms. I created empty folders for app-private and anr because they were empty on my backup (other than a traces.txt file in anr).
After bouncing the tab it booted up, but some of my settings were blown away. No big deal. Quadrant crashes at the I/O test part, but it might be because I don't have an Internet connection. The wifi is broken with the kernel I'm using.
Let me know if you still can't get things mounted. I'll test this more tomorrow when I get a fixed kernel.
I'm going to start working on the alternate approach of adding a 3rd partition...
Click to expand...
Click to collapse
The kernel should support ext4, I built it myself with ext4 enabled in the config file. And yeah, I put the busybox executable in /system/bin so it wouldn't conflict with the one in /system/xbin that Vegan already has. I also dumped mkfs.ext4 in /system/bin.
What I realized is that busybox has a nasty habit of failing partially at doing things - I keep assuming that it's exactly like the stock Linux command line tools, and it's not always identical. I ended up tearing out the important stuff and running it as a standalone test script from the command line to see what was happening.
Mkfs.ext4 runs with no obvious issues (I see it creates a journal at the end, so I know it's creating an ext4 filesystem now).
But then I got an error:
Code:
mount: mounting /dev/loop0 on /mnt/asec/extdata failed: Invalid argument
followed by:
Code:
umount: can't umount /mnt/asec/extdata: Invalid argument
e2fsck 1.41.6 (30-May-2009)
ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /data/ext4 is mounted.
/system/bin/e2fsck: Superblock invalid, trying backup blocks...
/system/bin/e2fsck: Bad magic number in super-block while trying to open /data/ext4
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
mount: mounting /dev/loop0 on /mnt/asec/extdata failed: Invalid argument
So mount failed to mount the file device that was created - that would seem to be a big issue. And then e2fsck failed to fsck it that one I'm baffled by.
I don't really understand how this "partially works" when it runs from inandop.sh but seems to fail entirely when I run it from the command line, but I sense that it "works once" because something it's getting sometimes written as ext4 sometimes as ext2/3 and that's leading obviously to corruption. Will figure more out later when I have time. I may just try adapting ownhere's script directly, he's obviously put a ton of thought into filesystem stuff and I'm not an expert in that area at all.
rcgabriel said:
The kernel should support ext4, I built it myself with ext4 enabled in the config file. And yeah, I put the busybox executable in /system/bin so it wouldn't conflict with the one in /system/xbin that Vegan already has. I also dumped mkfs.ext4 in /system/bin.
What I realized is that busybox has a nasty habit of failing partially at doing things - I keep assuming that it's exactly like the stock Linux command line tools, and it's not always identical. I ended up tearing out the important stuff and running it as a standalone test script from the command line to see what was happening.
Mkfs.ext4 runs with no obvious issues (I see it creates a journal at the end, so I know it's creating an ext4 filesystem now).
But then I got an error:
Code:
mount: mounting /dev/loop0 on /mnt/asec/extdata failed: Invalid argument
followed by:
Code:
umount: can't umount /mnt/asec/extdata: Invalid argument
e2fsck 1.41.6 (30-May-2009)
ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /data/ext4 is mounted.
/system/bin/e2fsck: Superblock invalid, trying backup blocks...
/system/bin/e2fsck: Bad magic number in super-block while trying to open /data/ext4
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
mount: mounting /dev/loop0 on /mnt/asec/extdata failed: Invalid argument
So mount failed to mount the file device that was created - that would seem to be a big issue. And then e2fsck failed to fsck it that one I'm baffled by.
I don't really understand how this "partially works" when it runs from inandop.sh but seems to fail entirely when I run it from the command line, but I sense that it "works once" because something it's getting sometimes written as ext4 sometimes as ext2/3 and that's leading obviously to corruption. Will figure more out later when I have time. I may just try adapting ownhere's script directly, he's obviously put a ton of thought into filesystem stuff and I'm not an expert in that area at all.
Click to expand...
Click to collapse
I was able to reboot 5 times and it kept the settings for me. I just couldnt test all apps because wifi was broken with the kernel I was using. I can test more today.
Are you sure that your ext4 format is completing? I got an mtab error when first trying to create the journal, so I just changed the script to format it with the -O ^has_journal option and it competed.
Vegan runs fine for me with latest busybox...
modify init.rc for mount ext4 /data
you must have tune2fs mkfs.ext4 e2fsck binary file.
Code:
#!/system/bin/sh
##get highest priority
/system/bin/renice -20 -r -g $$
ECHO_TARGET=/misc/inandop.log
BUSYBOX="/system/bin/busybox"
#data2loop by xiaolu
echo "try data2loop" >> $ECHO_TARGET
if [ "`$BUSYBOX df /dev/loop0 | grep loop`" != "" } ; then
exit 0
fi
$BUSYBOX ln -s /dev/block/loop0 /dev/loop0
$BUSYBOX ln -s /dev/block/loop1 /dev/loop1
$BUSYBOX ln -s /dev/block/loop2 /dev/loop2
$BUSYBOX ln -s /dev/block/loop3 /dev/loop3
$BUSYBOX ln -s /dev/block/loop4 /dev/loop4
$BUSYBOX ln -s /dev/block/loop5 /dev/loop5
$BUSYBOX ln -s /dev/block/loop6 /dev/loop6
$BUSYBOX ln -s /dev/block/loop7 /dev/loop7
if [ ! -e /data/system.firstrun.finish ];
then
# first run data not create do nothing, data2loop after reboot
#/system/bin/mkfs.ext4 -b 4096 -m 0 -F -L userdata /dev/block/mmcblk3p2
#/system/bin/tune2fs -o journal_data_writeback /dev/block/mmcblk3p2
#/system/bin/e2fsck /dev/block/mmcblk3p2
#/system/bin/tune2fs -O ^has_journal /dev/block/mmcblk3p2
$BUSYBOX mkdir /data/anr
$BUSYBOX touch /data/system.firstrun.finish
exit 0;
fi
$BUSYBOX umount /cache
echo "0" > /data/misc/screen_lock_status
$BUSYBOX chown 1000.1000 /data/misc/screen_lock_status
$BUSYBOX chmod 644 /data/misc/screen_lock_status
$BUSYBOX mkdir /mnt/asec/extdata
/system/bin/tune2fs -o journal_data_writeback /dev/block/mmcblk3p2
$BUSYBOX mount -t ext4 -o remount,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk3p2 /data
result=$?
echo "mount mmcblk3p2:$result" >> $ECHO_TARGET
$BUSYBOX chown 1000.1000 /data
$BUSYBOX chmod 771 /data
echo "+++Need create loopback device for data, please wait... " >> $ECHO_TARGET
if [ ! -e /data/data2loop.finish ];
then
if [ -e /dev/block/mmcblk3p3 ];
then
echo "+++Found mmcblk3p3, will use it for /data/data, create ext4 fs on it now..." >> $ECHO_TARGET
/system/bin/mkfs.ext4 -b 4096 -m 0 -F -L extdata /dev/block/mmcblk3p3
/system/bin/tune2fs -o journal_data_ordered /dev/block/mmcblk3p3
/system/bin/e2fsck -y -v -f /dev/block/mmcblk3p3
#/system/bin/tune2fs -O has_journal /dev/block/mmcblk3p3
/system/bin/tune2fs -O ^has_journal /dev/block/mmcblk3p3
$BUSYBOX mount -t ext4 -o loop,commit=5,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk3p3 /mnt/asec/extdata
result=$?
echo "mount /dev/block/mmcblk3p3:$result" >> $ECHO_TARGET
else
echo "+++Need create 512M ext2 loopback device for data, please wait... " >> $ECHO_TARGET
$BUSYBOX dd if=/dev/zero of=/data/ext2 bs=1048576 count=512
$BUSYBOX mke2fs -m 0 -F -L datadata /data/ext2
echo "+++Loopback device create done... " >> $ECHO_TARGET
$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext2 /mnt/asec/extdata
fi
$BUSYBOX chown 1000.1000 /mnt/asec/extdata
$BUSYBOX chmod 771 /mnt/asec/extdata
for i in data app-private anr ; do
if [ ! -d /mnt/asec/extdata/$i ] ; then
$BUSYBOX mkdir /mnt/asec/extdata/$i;
fi
$BUSYBOX chown 1000.1000 /mnt/asec/extdata/$i;
$BUSYBOX chmod 771 /mnt/asec/extdata/$i;
#if [ ! -h /data/$i ] ; then
$BUSYBOX cp -a /data/$i /mnt/asec/extdata/;
$BUSYBOX rm -rf /data/$i;
$BUSYBOX ln -s /mnt/asec/extdata/$i /data/$i;
result=$?
echo "ln -s:$result" >> $ECHO_TARGET
#fi
done
$BUSYBOX umount /mnt/asec/extdata
$BUSYBOX touch /data/data2loop.finish
fi
if [ -e /dev/block/mmcblk3p3 ];
then
/system/bin/e2fsck -y -v -f /dev/block/mmcblk3p3
#/system/bin/tune2fs -O ^has_journal /dev/block/mmcblk3p3
/system/bin/tune2fs -o journal_data_writeback /dev/block/mmcblk3p3
$BUSYBOX mknod /dev/loop0 b 7 0
$BUSYBOX losetup /dev/loop0 /dev/block/mmcblk3p3
#$BUSYBOX mount -t ext4 -o sync,commit=5,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/loop0 /mnt/asec/extdata
$BUSYBOX mount -t ext4 -o barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/loop0 /mnt/asec/extdata
result=$?
echo "mount /dev/loop1:$result" >> $ECHO_TARGET
else
/system/bin/e2fsck -y -v -f /data/ext2
$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext2 /mnt/asec/extdata
fi
$BUSYBOX chown 1000.1000 /mnt/asec/extdata
$BUSYBOX chmod 771 /mnt/asec/extdata
$BUSYBOX mkdir /data/cache
$BUSYBOX mount -o bind /data/cache /cache
$BUSYBOX chmod 777 /cache
sync;
exit 0;
Code:
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
/dev/block/mtdblock6 /logodata yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/block/mmcblk3p2 /data ext4 rw,nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=writeback 0 0
/dev/block/mtdblock0 /misc yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/loop0 /mnt/asec/extdata ext4 rw,nosuid,nodev,noatime,nodiratime,barrier=0,data=writeback 0 0
/dev/block/mmcblk3p2 /cache ext4 rw,nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=writeback 0 0
/dev/block/vold/179:17 /mnt/sdcard2 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=07
02,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:17 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmas
k=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard2/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/vold/179:25 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=070
2,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:25 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmas
k=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
chenglu can you post the instructions on how to create a third partition and mount that instead of creating a loop file? I want to test that today.
Thanks,
anlog said:
chenglu can you post the instructions on how to create a third partition and mount that instead of creating a loop file? I want to test that today.
Thanks,
Click to expand...
Click to collapse
Code:
busybox fdisk /dev/block/mmcblk3 -l
Disk /dev/block/mmcblk3: 16.0 GB, 16097738752 bytes
4 heads, 16 sectors/track, 491264 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk3p1 1 397087 12706776 83 Linux
/dev/block/mmcblk3p2 397088 458497 1965120 83 Linux
/dev/block/mmcblk3p3 458498 491264 1048544 83 Linux
reboot into recovery mode
Code:
busybox fdisk /dev/block/mmcblk3
The number of cylinders for this disk is set to 491264.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
m
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
"d" delete a partition 1 and 2
"n" create primary partition 1 2 3
busybox mkdosfs /dev/block/mmcblk3p1
mkfs.ext4 -b 4096 -m 0 -F -L userdata /dev/block/mmcblk3p2
In your instructions it looks like partition 3 isn't referenced, but instead you're formatting /data as ext4 instead of ext3? Or am I missing something???
Add the -O ^huge_file file option to your mkfs.ext4 when formating the partition. (it won't work with this feature since it requires special kernel option that brakes compatibility with existing modules)
mkfs.ext4 -O ^huge_file ........
Report back...
anlog said:
I was able to reboot 5 times and it kept the settings for me. I just couldnt test all apps because wifi was broken with the kernel I was using. I can test more today.
Are you sure that your ext4 format is completing? I got an mtab error when first trying to create the journal, so I just changed the script to format it with the -O ^has_journal option and it competed.
Vegan runs fine for me with latest busybox...
Click to expand...
Click to collapse

[Video] [Guide] How to Create a Swap Partition for Android

http://www.youtube.com/watch?v=OWAbpWWwJ9Y
Commands: fdisk -l dev/block/mmcblk_
swapon /dev/block/mmcblk_p_
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
vi /system/etc/init.d/05userinit
#Activate swap at boot
#!/system/bin/sh
swapon -a
chmod 750 /system/etc/init.d/05userinit
vi /system/etc/fstab
/dev/block/mmcblk_p_ swap swap
echo vm.swappiness=60 >> /system/etc/sysctl.conf
Thanks for the guide! I'm a noob in this kind of thing (partition, hd2sd, and etc)
Quite interesting... Maybe try to add to my ROM
Deleted by me
well....i didn't take a look at vid.....but i must say this.....swap partition is sort of uselles on our phone because phone gets veeery lagy if we use it...at least i had huge lags until i deleted swap script & partition aswell....

[Q] oc kernel, battery drain & full backup

I've rooted my Nook Simple Touch thanks to the advice and instructions xda (thank you all) and after a few days decided to instal the custom kernel (174 modified from the thread in the dev forum).
Battery drain went from moderate to losing about 10/15% per day even when turned off?!?
I made a full backup via nookmanager before rooting. I would like to try uninstalling the oc kernel first but don't know how to pull files from the backup or what files need replacing or deleting.
I'm willing to do a full restore but only as a last resort. Please could someone tell me how to get back to a stock kernel?
Thank you.
chipsugar said:
I've rooted my Nook Simple Touch thanks to the advice and instructions xda (thank you all) and after a few days decided to instal the custom kernel (174 modified from the thread in the dev forum).
Battery drain went from moderate to losing about 10/15% per day even when turned off?!?
Click to expand...
Click to collapse
Are you leaving WiFi enabled? What extra apps have you installed?
I made a full backup via nookmanager before rooting. I would like to try uninstalling the oc kernel first but don't know how to pull files from the backup or what files need replacing or deleting.
Click to expand...
Click to collapse
If you've got a Linux machine somewhere, you can mount the backup image by gunzipping a copy to backup.img and using something like:
Code:
#!/bin/sh
losetup -D
mkdir -p backup
losetup --offset 16384 /dev/loop0 backup.img
losetup --offset 79691776 /dev/loop1 backup.img
losetup --offset 96468992 /dev/loop2 backup.img
losetup --offset 295714816 /dev/loop3 backup.img
losetup --offset 597704704 /dev/loop4 backup.img
losetup --offset 849362944 /dev/loop5 backup.img
losetup --offset 1101021184 /dev/loop6 backup.img
fsck -y /dev/loop5
fsck -y /dev/loop6
cd backup
umount *
mount -o ro -t vfat /dev/loop0 boot
mount -o ro -t vfat /dev/loop1 rom
mount -o ro -t ext2 /dev/loop2 factory
mount -o ro -t ext2 /dev/loop3 system
mount -o ro -t vfat /dev/loop4 sdcard
mount -o ro -t ext3 /dev/loop5 cache
mount -o ro -t ext3 /dev/loop6 data
I'm willing to do a full restore but only as a last resort. Please could someone tell me how to get back to a stock kernel?
Thank you.
Click to expand...
Click to collapse
NookManager only does a full restore. If you do that, the old stock kernel will be restored.

[HACK] Grow your data partition

>>> Please note that Vashiru reworked this guide for reliability and alternate values, so I recommend you check his various posts in this thread starting with this one. <<<
Click to expand...
Click to collapse
THE PROBLEM
As many of us have noticed, it is fairly easy to get an "Out of space" message when installing apps on our phones because, for some weird reason, Oppo decided that the storage part of the device should linger in the dark ages, when /userdata and /sdcard were separate partitions and you only had 2GB of data storage, even if your phone was a 32GB model.
Now, imagine that you are running KitKat and would like to try ART. This may be a bad idea as, if your data partition is more than 30% full, you will find that while converting your apps to this new format, Android will run out of space.
At OppoForums, a few bright people started looking into the issue and, of course, there is a way to improve the situation.
WARNING!
If you follow the steps below correctly, you should not run in any trouble. If you do not, however, you may end up spending much more time fixing your phone.
FIRST, THE THANKS SECTION
Anders tinkered with his device’s partition table until he got to where he had grown the /userdata partition to something useable. Yes, it’s some people’s definition of “play”
Jousa11 is the first person trying to put a guide together explaining the steps to reproduce Anders’ work. WARNING: I did no get to see said guide as Jousa quickly deleted it due to the risks involved. So, take that in account!
Rockman for providing the last resort rescue tools in case you brick your phone
Lucky for providing the WiFi fix
Please let me know if you are not on this list and I forgot to give you credit!
YOU WILL NEED
The hardware:
An Oppo Find5 phone(!)
A computer (Windows/Linux/Mac) with adb installed and working
A USB cable
On your computer:
adb
[Optional] fastboot
On your phone (SDCard):
parted + mke2fs + tune2fs
mmcblk0p21_persist_ext4.img
openrecovery-twrp-2.6.3.0-find5-TP-patch.img
[Optional] gdisk
You will use parted to work on your partition table; mke2fs and tune2fs to create ext4 filesystems on some of these partitions (parted does not know how to create ext4 partitions)
mmcblk0p21_persist_ext4.img is an image that you need to restore your /persist partition and avoid issues such as non-working WiFi.
openrecovery-twrp-2.6.3.0-find5-TP-patch.img is a patched recovery image. I know: you already have a recovery image if you are going through these steps. However, we are going to wipe it so you want to install this guy before rebooting. Note that if you forget, you can always flash it later using fastboot.
On your computer:
adb to access your phone recovery, push files to SDCard, reboot...
[Optional] fastboot. You will only need fastboot if you mess up your recovery partition.
WHAT IF SOMETHING GOES AWFULLY WRONG?
You may “brick” your phone. Apparently it’s near impossible to hard brick your Find5, though. See below.
First, Anders recommends making a backup of your partition table. I didn’t because I felt that if I messed something up, it would be a partitions’ content rather than the partition table but that’s not the wisest approach.
Furthermore, if you are really worried about what stilly error your fat fingers will cause (I know I should be!) you can also backup your partitions.
Backing up your partition table:
On your phone:
Code:
gdisk -b /sdcard/gpt.bin /dev/block/mmcblk0
Backing up a single partition:
On your phone:
Code:
dd if=/dev/block/mmcblk0p<partition id> of=/sdcard/backup-<partition id>.bin
On your computer:
Code:
adb pull /sdcard/gpt.bin
adb pull /sdcard/backup-<partition id>.bin
LAST RESORT
OK. So, you've bricked your phone. Now what?
First, you will need Windows. So if you're on a Mac or Linux and have no access to a Windows machine/VM, er..don't brick your phone.
- Download drivers and tools
- Download and follow the instructions
READY ? LET'S GET STARTED
>>>>>>>>>>>> First, Download The Files <<<<<<<<<<<<
Then...
On your computer:
UPDATE As dixxa pointed out, mke2fs and tune2fs may already be present on your device. It was not the case for me but you should check first; it seems like a good idea to use existing binaries.
Code:
adb reboot recovery
adb push parted /sbin
adb push mke2fs /sbin
adb push tune2fs /sbin
On your phone:
Code:
chmod 755 /sbin/parted /sbin/mke2fs /sbin/tune2fs
umount /cache
umount /sdcard
umount /emmc
umount /data
parted /dev/block/mmcblk0
You are now in the parted shell.
CAREFUL! Do not delete any partition below 20 or you will enter "Big Oops" territory. I recommend typing carefully and, yes, staying away from copy/paste operations that may swallow a character like, say, the '2' in '20'
Note that the size value I am using here is '4GB' for /userdata (rather than 2GB). I guess you could make /userdata bigger than 4GB, in which case you would have to recompute all the offsets in the commands below(!)
Code:
# rm sdcard
rm 29
# 28 thru 23 are reserved
rm 28
rm 27
rm 26
rm 25
# rm recovery
rm 24
# rm misc
rm 23
# rm cache
rm 22
# rm persist
rm 21
# rm data/emmc
rm 20
# now, re-create partitions but data is bigger
mkpart primary 1325 5421
name 20 userdata
mkpart primary 5421 5430
name 21 persist
mkpart primary 5430 5967
name 22 cache
mkpart primary 5967 5968
name 23 misc
mkpart primary 5968 5979
name 24 recovery
mkpart primary 5979 6012
name 25 reserve1
mkpart primary 6012 6019
name 26 reserve2
mkpart primary 6019 6028
name 27 reserve3
mkpart primary 6028 6062
name 28 reserve4
mkpart primary 6062MB 100%
name 29 sdcard
# exit parted shell
q
Let's create a file system on the partitions that require one. Note that I am formatting the SDCard using VFAT as, yes, EXT4 is a better FS, but it is also incompatible with Oppo's ROM and some apps may not require the proper permissions etc.
Code:
# Notes:
# -m 0: no reserved blocks
# -c 0: no max mount count
# -C -1: no mount count
# -i -1: max_int interval between checks
mke2fs -t ext4 -m 0 -L userdata /dev/block/mmcblk0p20
tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p20
mke2fs -t ext4 -m 0 -L persist /dev/block/mmcblk0p21
tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p21
mke2fs -t ext4 -m 0 -L cache /dev/block/mmcblk0p22
tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p22
# Hey look it’s an ext4 SDCard!
mke2fs -t ext4 -m 0 -L sdcard /dev/block/mmcblk0p29
tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p29
# Actually to avoid errors like unable to write to root of sdcard:
mkdosfs -n sdcard -F 32 /dev/block/mmcblk0p29
mount -t vfat /dev/block/mmcblk0p29 /sdcard
At this point, we have clobbered the /persist partition and this could cause issues as mentioned earlier. Let's restore it.
Code:
# Restore /persist partition
mount -t ext4 /dev/block/mmcblk0p29 /sdcard
# On computer
adb push mmcblk0p21_persist_ext4.img /sdcard/
# On phone
dd if=mmcblk0p21_persist_ext4.img of=/dev/block/mmcblk0p21
IMPORTANT! Flash your recovery partition now. If you wait until after rebooting, you will need to use fastboot instead.
Code:
# Recovery partition: on computer
adb push openrecovery-twrp-2.6.3.0-find5-TP-patch.img /sdcard/
# On phone
dd if=openrecovery-twrp-2.6.3.0-find5-TP-patch.img of=/dev/block/mmcblk0p24
Admire your work
Code:
parted /dev/block/mmcblk0 print
Reboot into your new recovery and install your favorite ROM
FAQ
Q: Is this dangerous?
A: Yes. Yes, it is.
Q: Any tip?
A: Yes. Follow these instructions carefully and if something wrong happens, unless you know what you are doing, leave your device alone and come here to ask for help.
Q: Can I hold you responsible for any damage to my phone/etc?
A: As usual, the answer is 'No'
Q: I found an error in your write-up!
A: Please let me know immediately.
-Chris.
You should probably use the latest TWRP 2.6.3.1 found here: http://techerrata.com/file/twrp2/find5/openrecovery-twrp-2.6.3.1-find5.img
Looks good to me. Just be very carefully doing this.
Sent from my Find 5 using xda app-developers app
gdisk -b /sdcard/gpt.bin /dev/block/mmcblk0
those commands need to be typed in recovery even that one ?
Yes although I imagine this particular command should also work when booting system.
Sent from my Find 5 using Tapatalk
This thread is fine the only problem here is with those 2 binaries: mke2fs and tune2fs
You don't need to push them or chmod them since they are already in the recovery
Except that that thread is perfect.
Since we're at toying with partition, can't we merge the partitions in some way ?
Just wondering is there any way to build a script to do this in an automated way thus avoiding user errors and typos?
There is a thread on the oppo forums
http://www.oppoforums.com/threads/guide-resizing-internal-storage-on-find-5-32gb.8361/
Hello everyone,
is the guide for the 32 or 16 gb model?
I have 16 gb Oppo find 5.
Thanks.
PS: what "on your phone" is supposed to mean"?
Click to expand...
Click to collapse
If you don't know what does that mean don't do it you'll screw your phone.
hi
Please would you make something like this for oppo find 7a x9006?
thanks
Anyone willing to recompute all the offsets dor just one 16gb partition?
Scribed henceforth from thy G pad.
Hi all, I am trying to do this mod and I am half way through it with a problem
I am stuck on the new file system, I cannot use mke2fs or tune2fs, i get
Code:
mke2fs: not found
like it doesn't even exist, but it does I can see it. I get the same error for tune2fs. but parted and gdisk work fine.
Yes I did push them and chmod 755 them.. and I have tried running it from the /sbin directory.
Help!
Hello!
I'm getting the same error over and over again creating /dev/block/mmcblk0p21 to /dev/block/mmcblk0p22:
tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p21
"Bad magic number in super-block while trying to open /dev/block/mmcblk0p21"
"Couldn't find valid filesystem superblock"
So i can't create a file system on the created partitions. I have been looking everywhere for an answer. Somebody have an idea?
U should just wait. Andrew dodd found a way to make find7a have unified partition and he claims he can make it work on find5 as well. Let's give him a bit to figure it out tho.
Scribed henceforth from thy G pad.
Gdisk not working...
Ok guys sort of a noob here... Firstly, totally appreciate what you guys are doing here... I wants it bad, thass why i'm here.
So far... I have i have done...
"adb reboot recovery"
"adb push gdisk /sbin"
I figured that's how you are supposed to install it ... hope i'm not wrong, but i guess it pushed through fine
But after rebooting to system in TWRP , i opened terminal emulator and when i use the command
"gdisk -b /sdcard/gpt.bin /dev/block/mmcblk0"
I get ...
"/system/bin/sh: gdisk: not found"
now i'm too scared to proceed without backing up the partition tables... so please help...
edit - FYI , i'm running the last build of Asylum Carbon... should i just go back to latest oopo stable stock rom and then root my device again and then try all this again... would that help... ???
Directly from Andrew Dodds g+ " IT HAS BEGUN.
The first phase of Find 7a/7s LVM testing is here.* See linked post for details.* (Sorry to disappoint, but the first phase is "make sure we don't break existing configurations")
Once this phase is complete, the remaining list is:
Fix up the remaining TWRP issues (make RECOVERY_SDCARD_ON_DATA runtime instead of compile-time)
Make user-friendly conversion processes
Once things are solid on Find 7, I'll work on Find 5 and N1."
Stay thirsty my friends. Good things ahead
Sent from my A0001 using Tapatalk
Does this work for the 16gb model?
Can someone help please?
I'm trying to do this, but after enter in parted [parted /dev/block/mmcblk0] when i try to do "rm 29", i get "can't remove 29: no such file or directory
I'm doing the "on your phone" commands in TWRP command line., is that correct?
I'm running stable colorOS 1.0.9i
Finally I finish the process.
My notes:
Goal:
Keep my current system intact (stable colorOS 1.0.9i , because i have no patience to format, install a new ROM and reinstall/recofigure everything
So I backup everything on phone with TWRP and I push sdcard content (wich include the system backup i made) with ADB
1 - If I push mke2fs and tune2fs IT WILL NOT WORK. I flash the last find 5 recovery (openrecovery-twrp-2.8.1.0-find5.img) and I dont push or chmod anyting, parted, mke2fs, tune2fs are all already in the recover and that's the only way I could run mke2fs and tune2fs
edit: 1.5 - The phone commands had to be enter via ADB shell. In TWRP command line, after you enter in parted it will not accept commands.
2 - To "rm 29", i had to "umount /dev/block/mmcblk0", otherwise "rm 29" fail due to partition in use
3 - after this instruction:
mount -t vfat /dev/block/mmcblk0p29 /sdcard
(the last one on the 4 block of code)
We have this:
# Restore /persist partition
mount -t ext4 /dev/block/mmcblk0p29 /sdcard
This instruction was the only one that give me a error, so I move to the next ones.
The error was that the partition was busy, what makes senses because in the last instruction we mount the same partition on the same folder but with different file system!!??
So I move to the next instruction. I have no idea if it's a instructions mistake but it looks like, because it says "# Restore /persist partition" but the command has nothing to do with /persist
4 - FINISH
5 - Reboot in recovery. Push sdcard backup to /sdcard. restore system backup with TWRP restore
Voila, my phone exactly as before but with 3,76GB for APPS. Finally!!! The "running out of space" message on a flagship quad-core 2GB RAM phone!!!!!!?????? Was driving me CRAZYYYYY
Thanks Fickx for the up to date information, I just did my re-partition successfully, here's what I did:
- Use Rashr update the recovery to twrp-2.8.1.0
- reboot into recovery
- connect to PC (Make sure adb works, "adb devices")
- on PC:
> adb shell
> umount /cache
> umount /sdcard
> umount /emmc
> umount /data
> umount /dev/block/mmcblk0p29
> parted /dev/block/mmcblk0
> rm 29
>...
> rm 20
> mkpart primary 1325 5421
> name 20 userdata
> ...
> name 29 sdcard
> q
> mke2fs ...
> ...
> mount -t -vfat /dev/block/mmcblk0p29 /sdcard
Open another PC command terminal
> adb push mmcblk0p21_persist_ext4.img /sdcard/
> adb push openrecovery-twrp-2.8.1.0-find5.img /sdcard/
Back to original terminal in "adb shell".
> dd if=/sdcard/mmcblk0p21_persist_ext4.img of=/dev/block/mmcblk0p21
> dd if=/sdcard/openrecovery-twrp-2.8.1.0-find5.img of=/dev/block/mmcblk0p24
> exit
> adb reboot recovery
Flash the rom.

Categories

Resources