Hey guys, I have got a technique to Backup, format and restore your whole sdext2 / Sd-ext partition through Recovery in case you were unable to find a recovery to backup and restore this partition; and as far as I know there is no single recovery out there till date that can directly Backup and restore this partition on Grand. So if you need this please ask here and I will help you out.
Need help.
Gautam Gundap said:
Hey guys, I have got a technique to Backup, format and restore your whole sdext2 / Sd-ext partition through Recovery in case you were unable to find a recovery to backup and restore this partition; and as far as I know there is no single recovery out there till date that can directly Backup and restore this partition on Grand. So if you need this please ask here and I will help you out.
Click to expand...
Click to collapse
Can your method be used to backup sdext2 on other mobiles? I have got Micromax Canvas Power A 96 and Lenovo A 7000. Please provide me the necessary steps and information, so that I will give it a try and see if it is successful.
Thank you
Yes you can. This method is only for the android smartphones where the recovery does not support sd-ext/sdext2 backup, format and restore. If your device has an official or unofficial recovery on xda forum that supports sdext2/sd-ext then it can be done directly from the recovery menu options and this method is not required. If not follow the below steps
1. Find a recovery on the web/xda for your specific device that supports any file manager directly through recovery which has an option for terminal/bash command inputs and execution. Even if the recovery does not have a file manager support but has the terminal/bash command facility then that will do. Philz touch/non touch recovery for your specific device should support this. It has aroma file manager with terminal/bash commands support. I hope you know how to install a recovery img/partition on your device
2. Depending upon which app you are using for sdext2/sd-ext partition to handle, you will find a file under init.d directory for mounting this partition. This file contains script commands for mounting this partition. You need to edit this file and find the script command. For example if you are using link2sd on galaxy grand then the script command is mount -t ext4(your partition type) -o rw(permissions set) /dev/block/vold/179.10(this is the allocated partition address for your sdext2/sd-ext partition specific to your device and will be different for different devices) /data/sdext2.
3. If you want to do a full backup then reboot into recovery go to file manager and command prompt and type the mount script for sdext2/sd-ext and press enter.
4. Exit file manager/terminal and from recovery select full backup( boot, recovery, system, data ). This will backup your full device. You can backup .android_secure, data/media and extsdcard depending on your choice but mind it the backup file size will be large and you should have enough space on your extsdcard for it. If .android_secure is empty/not used you need not backup this ( if you don't have apps on extsdcard this will be empty) .
While performing the backup your recovery will display sd-ext partition not found. Could not backup sd-ext. Don't panic when you see this and just ignore it. Your sdext2/sd-ext partition will be backed up.
5. To format and then restore, boot into recovery and go to file manager/terminal and execute the above mount script and go back to recovery. Then format all above mentioned partitions that you have backed up and reboot from recovery back into recovery. You will be prompted for keep/apply root 1. Yes 2. No. Select yes.
6. Once you have rebooted back into recovery, again go to file manager/terminal and execute the above mount script and go back to recovery.
7. Now select full restore and select your backed up file and your device will be restored to exact state at the time you created your backup.
Note: You can also do customized/selected partitions backup and this also applies for format and restore too through philz cwm touch recovery.
I hope I have made this as simple as possible to understand and implement the procedure. If you have any doubts/queries you can get back.
Happy to know that it is possible.
Gautam Gundap said:
Yes you can. This method is only for the android smartphones where the recovery does not support sd-ext/sdext2 backup, format and restore. If your device has an official or unofficial recovery on xda forum that supports sdext2/sd-ext then it can be done directly from the recovery menu options and this method is not required. If not follow the below steps
1. Find a recovery on the web/xda for your specific device that supports any file manager directly through recovery which has an option for terminal/bash command inputs and execution. Even if the recovery does not have a file manager support but has the terminal/bash command facility then that will do. Philz touch/non touch recovery for your specific device should support this. It has aroma file manager with terminal/bash commands support. I hope you know how to install a recovery img/partition on your device
2. Depending upon which app you are using for sdext2/sd-ext partition to handle, you will find a file under init.d directory for mounting this partition. This file contains script commands for mounting this partition. You need to edit this file and find the script command. For example if you are using link2sd on galaxy grand then the script command is mount -t ext4(your partition type) -o rw(permissions set) /dev/block/vold/179.10(this is the allocated partition address for your sdext2/sd-ext partition specific to your device and will be different for different devices) /data/sdext2.
3. If you want to do a full backup then reboot into recovery go to file manager and command prompt and type the mount script for sdext2/sd-ext and press enter.
4. Exit file manager/terminal and from recovery select full backup( boot, recovery, system, data ). This will backup your full device. You can backup .android_secure, data/media and extsdcard depending on your choice but mind it the backup file size will be large and you should have enough space on your extsdcard for it. If .android_secure is empty/not used you need not backup this ( if you don't have apps on extsdcard this will be empty) .
While performing the backup your recovery will display sd-ext partition not found. Could not backup sd-ext. Don't panic when you see this and just ignore it. Your sdext2/sd-ext partition will be backed up.
5. To format and then restore, boot into recovery and go to file manager/terminal and execute the above mount script and go back to recovery. Then format all above mentioned partitions that you have backed up and reboot from recovery back into recovery. You will be prompted for keep/apply root 1. Yes 2. No. Select yes.
6. Once you have rebooted back into recovery, again go to file manager/terminal and execute the above mount script and go back to recovery.
7. Now select full restore and select your backed up file and your device will be restored to exact state at the time you created your backup.
Note: You can also do customized/selected partitions backup and this also applies for format and restore too through philz cwm touch recovery.
I hope I have made this as simple as possible to understand and implement the procedure. If you have any doubts/queries you can get back.
Click to expand...
Click to collapse
I am happy to know that it is possible. I will give it atry this evening, when I return home from work. I will let u know. Thank for your reply.
Gautam Gundap said:
Yes you can. This method is only for the android smartphones where the recovery does not support sd-ext/sdext2 backup, format and restore. If your device has an official or unofficial recovery on xda forum that supports sdext2/sd-ext then it can be done directly from the recovery menu options and this method is not required. If not follow the below steps
1. Find a recovery on the web/xda for your specific device that supports any file manager directly through recovery which has an option for terminal/bash command inputs and execution. Even if the recovery does not have a file manager support but has the terminal/bash command facility then that will do. Philz touch/non touch recovery for your specific device should support this. It has aroma file manager with terminal/bash commands support. I hope you know how to install a recovery img/partition on your device
2. Depending upon which app you are using for sdext2/sd-ext partition to handle, you will find a file under init.d directory for mounting this partition. This file contains script commands for mounting this partition. You need to edit this file and find the script command. For example if you are using link2sd on galaxy grand then the script command is mount -t ext4(your partition type) -o rw(permissions set) /dev/block/vold/179.10(this is the allocated partition address for your sdext2/sd-ext partition specific to your device and will be different for different devices) /data/sdext2.
3. If you want to do a full backup then reboot into recovery go to file manager and command prompt and type the mount script for sdext2/sd-ext and press enter.
4. Exit file manager/terminal and from recovery select full backup( boot, recovery, system, data ). This will backup your full device. You can backup .android_secure, data/media and extsdcard depending on your choice but mind it the backup file size will be large and you should have enough space on your extsdcard for it. If .android_secure is empty/not used you need not backup this ( if you don't have apps on extsdcard this will be empty) .
While performing the backup your recovery will display sd-ext partition not found. Could not backup sd-ext. Don't panic when you see this and just ignore it. Your sdext2/sd-ext partition will be backed up.
5. To format and then restore, boot into recovery and go to file manager/terminal and execute the above mount script and go back to recovery. Then format all above mentioned partitions that you have backed up and reboot from recovery back into recovery. You will be prompted for keep/apply root 1. Yes 2. No. Select yes.
6. Once you have rebooted back into recovery, again go to file manager/terminal and execute the above mount script and go back to recovery.
7. Now select full restore and select your backed up file and your device will be restored to exact state at the time you created your backup.
Note: You can also do customized/selected partitions backup and this also applies for format and restore too through philz cwm touch recovery.
I hope I have made this as simple as possible to understand and implement the procedure. If you have any doubts/queries you can get back.
Click to expand...
Click to collapse
THANK YOU!!!!!!!!! I'm on an LG G3 and I was successful at mounting my sdext2 partition for Link2SD using this method. I had to change a few things, for example, I have no init.d folder, but had to search for "link2sd" and found the file "init-link2sd.sh", which contained two commands, and the one that worked was "mount -t ext2 -o rw /dev/block/mmcblk1p2 /data/sdext2". THANKS AGAIN!!!!!!!!
Glad to know that it worked for you. Hope others are able to use this guide too.
Related
Recovery Features:
Updated nandroid and recovery to support newer HTC devices using emmc instead of mtd.
Full support of Amend, Edify, & Busybox Mount Update(r) scripts
Correct auto detection of file system types on sd-ext, system, cache, and data.
Capacitive keys function. V3.0.3
Unlike clockwork you can wipe and not lose your file system type. On clockwork wiping resets your fs to ext3 on /system, /cache, and /data. This one will leave an ext4 file system intact after a wipe.
ADB as root user
USB-MS Toggle :mounts sdcard as mass storage
Backup/Restore:
Nand Backup : Select Items to backup with the [X]
Nand Restore : browse to and select nandroid backup to restore
Nand Restore Clockwork: browse to and restore cwm 3x, 4x, 5x backups
Flash Zip From Sdcard: Update.zip must be in root of sdcard or you can directory browse. Use the "../" to move back a directory
Toggle Signature Verify : Turn of signature checking on flashing zips
Wipe Menu:
Wipe data/factory reset: wipes all (minus full sdcard)
Wipe cache
Wipe Dalvik cache : Wipes Dalvik cache in all possible locations if moved by apps2sd
Wipe SD:ext : Wipes Apps2sd ext partition
Wipe Battery Stats
Wipe rotate settings
Wipe data only
Wipe Sdcard
Wipe .android secure : Wipes .android_secure on sdcard
Partition Sdcard:
Partition SD: Partition's sdcard for apps2sd (this formats card so all non backed-up data is lost)
Repair Sd:ext
SD:ext2 to ext3 : coverts apps2sd ext2 partition to ext3
SD:ext3 to ext4 : same as above but ext3 to ext4
Other:
Fix apk uid mismatches
Move recovery log to SD
Key Test : Output keycodes for debugging recovery
Check battery level
Ext3|4 menu: Formatting and reformating of partitons
Developer menu:
Make and flash boot from zimage : This makes a mkboot folder on sdcard and mounts sdcard as mass storage then you copy a zImage and kernel modules into this folder and it will create a new boot like anykernel and flash it.
Toggle full ext wipe: Toggles full or quick wipe of ext partitions
Install su & superuser: Installs or fixes su & superuser install (removes old if exists)
Install eng (unguarded) su: Installs engineering su that doesn't use superuser (removes old su & superuser if exists)
Reboot to bootloader: reboots to bootloader/hboot
Reboot recovery : reboots phone back into recovery
Trouble Shooting:
1. Use option under Other menu to move recovery log to sd. Mount your sdcard to pc and read that file called recovery.log. It should have detailed cause of error.
Navigation:
Vol-up & Vol-dn = move up & down
Power = select
POWER+VOLUP+VOLDN will auto reboot you out of recovery.
Back = backup or use the -Return menu item
Special Thanks:
Amon_RA for his source code Buy him a redbull
Team Unrevoked & AlphaRev for the s-off
Koush source code
worstenbrood source code for modded desire recovery
Teamwin recovery
jhansche for 3 button navigation on ra recovery.
Github Source
Developer's note: This can easily be ported to any other Emmc HTC's with minimal effort. For mecha, vision, lexikon etc. only change of kernel and default.prop is needed. Recovery binary and scripts will fully work. For devices like shooter the partitions in roots.c will need to be updated as well as fstab.
Changelog: 3.06
Clockwork restore option
Compiled for armv7a-neon so its faster
Added developer menu
Ext3|4 menu using C instead of script now.
Changelog : 3.0.3
Enabled capacitive keys and back now functions to backup one menu.
Re-added Mounts menu
Changelog : 3.04
Signature Checking is off by default
Fixed critcal error in nandroid that caused fail of boot.img restore
Changelog : 3.05
Added ability to restore CWM backups 3x-5x.
Cleaned up some code that could produce an error in the ext3 - ext4 upgrade/downgrade causing script to fail.
Download Section:
fastboot version :
Current recovery-ra-vivow-3.06-gnm.img
MD5= c2e2f9af9607e9334b5e268c7b23e050
old recovery-ra-vivow-3.03.img.zip
MD5 = 2f8ed4661c86f03b7e410c7b0511b2c4 recovery-ra-vivow-3.03.img.zip
old recovery-ra-vivow-3.02.img.zip
MD5 = 47efcf557dc8e233ab9213636f88426b recovery-ra-vivow-3.02.img.zip
Unzip and flash via fastboot with command
Code:
fastboot flash recovery NAMEOFRECOVERY.img
Hboot version : PG32IMG-ra-vivow-3.04.zip
MD5 = c8f95411729ef74fc03bcb679cab857d
old PG32IMG_recovery-ra-3.03.zip
MD5 = d174c23abdf85f99a0233d11c4beda27 PG32IMG_recovery-ra-3.03.zip
old PG32IMG_recovery-ra-vivow-3.02.zip
MD5 = 9f4792175d007bdf151bcce9b21e7f2b PG32IMG_recovery-ra-vivow-3.02.zip
rename above file to PG32IMG.zip and place on root of sdcard and boot to hboot to flash.
Havent tried it yet but flashed it. Would it be possible to make an easier way to go back? Instead of having to select the return or ../ option. Anyways thanks for this.
mbh87 said:
Havent tried it yet but flashed it. Would it be possible to make an easier way to go back? Instead of having to select the return or ../ option. Anyways thanks for this.
Click to expand...
Click to collapse
Not with only 3 mapable keys. If we had a 4th hardware key yes but we don't. Navigation is same as clockwork unfortunatly.
drellisdee said:
Not with only 3 mapable keys. If we had a 4th hardware key yes but we don't. Navigation is same as clockwork unfortunatly.
Click to expand...
Click to collapse
The soft keys work in clockwork though which is nice. Like the layout of this recovery better so I guess I just gotta pick which things bug me less lol.
mbh87 said:
Havent tried it yet but flashed it. Would it be possible to make an easier way to go back? Instead of having to select the return or ../ option. Anyways thanks for this.
Click to expand...
Click to collapse
mbh87 said:
The soft keys work in clockwork though which is nice. Like the layout of this recovery better so I guess I just gotta pick which things bug me less lol.
Click to expand...
Click to collapse
Good suggestion. I added it. Version 3.0.3 has the capacitive keys working and the option to use the menu item -Return or the capacitive back key to backup a menu.
drellisdee said:
Good suggestion. I added it. Version 3.0.3 has the capacitive keys working and the option to use the menu item -Return or the capacitive back key to backup a menu.
Click to expand...
Click to collapse
Awesome, thank you!
Sweet, Amon Ra works great on my old LG Ally.
Welcome to the Dinc2 club Drellisdee. I'm happy you're here.
^^^^^
x2, but used this recovery with my Droid Eris.
Good to see this recovery as another option vs. CWMR...
I LOVE IT!! Anyway to fix permissions ?
Sent from my ROOTED Incredible 2.
phillybizzle said:
I LOVE IT!! Anyway to fix permissions ?
Sent from my ROOTED Incredible 2.
Click to expand...
Click to collapse
Yep thats what this item does
Other:
Fix apk uid mismatches
one more ? how can I keep this as my permanent recovery? clockwork is sneaky and comes back
Sent from my ROOTED Incredible 2.
phillybizzle said:
one more ? how can I keep this as my permanent recovery? clockwork is sneaky and comes back
Sent from my ROOTED Incredible 2.
Click to expand...
Click to collapse
That shouldn't happen on this device. Check if you have a /etc/install-recovery.sh and if so delete it then reflash the recovery.
nope looked everywhere
Sent from my ROOTED Incredible 2.
only way clockwork should come back is if you flash it in ROM Manager or overwriting it elsewhere.
also to the OP, have you thought about porting the Team Win Recovery?
mbh87 said:
only way clockwork should come back is if you flash it in ROM Manager or overwriting it elsewhere.
also to the OP, have you thought about porting the Team Win Recovery?
Click to expand...
Click to collapse
TeamWin's official recovery currently doesn't support the ext3 filesystem, which we (the Inc2) use. Some of the unofficial ports for other devices do, but the ones that have added ext3 support (like the Tbolt port) seem to be dirty hacks at the moment. I was looking at porting it myself, but TeamWin said that they are adding support for a lot of additional devices, including the Inc2, so I'd be duplicating effort that's already ongoing
Will I be able to restore nands created by CWM recovery with this recovery?
Thanks.
slacka-vt said:
Will I be able to restore nands created by CWM recovery with this recovery?
Thanks.
Click to expand...
Click to collapse
no. Cwm and amon ra nandroids are not interchangeable. I'm not going to try to mess with team-win. I like ra recovery and thats what I use. IMO it is the best recovery option out there for all devices. FYI you can use manual flash override option in rom manager to make it not require flashing clockwork to use most of the features of it.
mbh87 said:
only way clockwork should come back is if you flash it in ROM Manager or overwriting it elsewhere.
also to the OP, have you thought about porting the Team Win Recovery?
Click to expand...
Click to collapse
so I.should flash any recovery in clockwork? anyway to flash this recoc
Sent from my ROOTED Incredible 2.
phillybizzle said:
so I.should flash any recovery in clockwork? anyway to flash this recoc
Sent from my ROOTED Incredible 2.
Click to expand...
Click to collapse
Preferred means of flashing are in 2nd post. Flash_image can also be used to flash from android or recovery but hboot zip and fastboot are easiest methods.
Ok, so I downloaded some files, and they ended up a bit corrupt, and not knowing this, I wiped data/cache + system and tried to flash them. Now, I have nothing but 3 corrupt ROMs (CM10.1 12-22-2012, WickedJB 5, and DarthStalker 6). I had some backups, some time ago, but thinking that I'd be able to backup as soon as I get to recovery, I didn't. So now, I have no backup and 3 corrupt files, but a functional Download and Recovery (TWRP 2.3.3.1). I tried to use the adb sideload function, but it doesn't work ("device not found"). And trying to flash cm10.1 gives me error status 7, and the other two don't give me errors but after flashing, they just stay stuck at the boot screen.
I tried Odin, but it becomes stuck at "aboot.mbn." It doesn't even give a pass/fail. It just says "aboot.mbn" and after 10 minutes, I raged and pulled the plug (and then it says failed).
So, now I have no idea what to do.
How to fix it?
Thanks
Hope this helps a little
I'd make sure that ur Downloaded Flash ROM's are not Bad files or incorrect... There is usually a MD5 file or long number with most downloads,
get a MD5 checker program and check the number of the file(s) you downloaded and see if they line up with OP's Site
At this point you know u have GREAT files (ROM's) to work with.
-Not sure what recovery you have, when you boot into recovery, what do u see...
-It is possible that you inject SuperSU or Superuser into your stock ROM and have ROOT access, but also still have STOCK RECOVERY!
-You will need any kind of RECOVERY other then stock, I suggest TWRP 2.3.3.1 (version 2.3.3.0 didn't show you your sdcard, don't use that version) v2.3.1.0 was fine to use in past.
How to add NON Stock Recovery (ROM has to be rooted)...
__________________________________________________________________________________________
***to add ROOT... Use ODIN to inject stock ROM with Root66's (Dark Chld) method... (at this point, you'll have rooted ROM with stock recovery)
1. Use "Terminal Emulator" app found on market (newest is v 1.0.50)
2. Download + Copy (TWRP v2.3.3.1) recovery .img file to sdcard (rename it to recovery.img)
*** you have to extract out xxx.img file out of .zip (.zip won't work...".img" file will work only)
3. Run Terminal Emulator 1.0.50 and type this code...
su
dd if=/sdcard/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
4. Done!
*** if all went well !, now Recovery is Changed ..reboot into recovery mode and check...
more info found here
At this point you will know you have rooted ROM and NON Stock recovery.
-With any non Stock recovery, you can flash any ROM. Read their Instructions and follow them to the letter.
-Be sure to wipe Cache's, System, (and most of the time DATA) and other stuff as instructions for that particular ROM says
-Eventually once you have any great (NON CURRUPT) ROM, make a backup, so you can always have a SAFE ROM to flash...
TWRP BACKUP's get saved to External SD Card in TWRP folder (but you have to Set them there when your creating NEW BACKUP)
*** Don't ever save files to INTERNAL SDCARD, incase you wipe internal DATA in future.
IMPORTANT : understand what you are doing as u do it...
TWRP Wipe Menu (options)
___________________________________________________________________________
Cache = always ok to WIPE (it will take longer to load after wiping on 1st boot only)
Dalvik Cache = always ok to WIPE (it will take longer to load after wiping on 1st boot only)
Factory Reset = wipes Cache(s), (Data - All settings + User Apps), (NOT data\media - Internal SDCARD), (NOT External Micro SDCARD)
System = just ROM Files (System Apps, System Files, NO settings at all)
Internal Storage = (data\media - Internal SDCARD), (NOT External Micro SDCARD))
Format Data = All settings + User Apps + (data\media - Internal SDCARD), (NOT External Micro SDCARD)
DISCLAIMER: <insert generic XDA disclaimer here>
Hey guys, first things first. I'm not a programmer/dev or even clever so bear this in mind when trying this.
I wanna share a Tasker with you all that when used in conjunction with PhilZ Touch 4.88.5 Touch Enhanced CWM 6.0.2.9 Recovery and anopen recovery script can allow your phone to perform a NAND backup while you sleep or whenever you want.
Philz has managed to get ors working in his recovery which means that the recovery with be able to perform custom backup jobs once you select them in recovery and run them. Now, READ this aboutopen recovery script to find out about ors because I'm not one for giving fish to men, rather teach them to fish! Read it? Good... moving on...
The ors support is great but having to select them and run them is not so great for me and that is where this trick comes in handy.
What this task does...
It copies an already created (user created) ors script to /cache/recovery, deletes the previously backed up backup folder (if any), reboots into recovery (provided you have 50% battery). Recovery then runs the script, backs up and reboots into the ROM. If at boot, the backup was made, a notification comes up telling you this and the time it was done at and also writes this to a log file in /mnt/sdcard0/clockworkmod.
I'll leave it up to you to figure the tasks out and how they work if you want a better understanding.
Quick tip:
The backup folder is set to clockworkmod>backup BUT the sdcard to which the backup is made is selectable in recovery under: Backup and restore>Misc Nandroid Settings>ORS Backup Target. So in other words you can't define /mnt/sdcard0/SILLY/NOOB as the backup folder, it can only be either /mnt/sdcard0/clockworkmod/backup/*my folder* or /mnt/extsdcard/clockworkmod/backup/*my folder*. This being said, all you need to do is define the *my folder* name under /mnt/*/clockworkmod/backup/*my folder* in the script which could just be /Tasker_Backup Capeesh?
Another thing that I must mention is my reason for creating a openrecoveryscript file and copying it to /cache/recovery rather than just writing a file directly into /cache/recovery is that it seems like either Tasker or Android doesn't like creating a file directly in /cache/recovery but doesn't seem to mind copying a file to the location.
Instructions:
1.You need to create a file on your sdcard called openrecoveryscript.txt in a place you will remember (I put mine in the mnt/sdcard0/clockworkmod)
2.Once you created the file, open it and enter your backup job, the order in which you enter your commands aren't important, any permutation will do (BDASC or ASDBC).
3.When you're done, save the file and REMOVE the ".txt" extension.
4.Import my Tasker profiles (NAND backup and NAND notify) into Tasker and open the task "NAND backup" and edit the path in the 9th and 11th action to the clockworkmod folder on either the local or external sdcard. (depending on the selection that you made under: Backup and restore>Misc Nandroid Settings>ORS Backup Target)
5.Set the time and date that you want the backup happen on.
6.Thats it!
Suggestions:
I would advise against setting the internal sdcard as the backup location because replacing an external sd is far easier than replacing an internal one when it burns out from large amounts of writes in addition to this, I would recommend backing up about once per week (depending on your addiction to flash) to reduce the strain on the sdcard. But this is only my suggestion.
Attached is a zip of the profiles and the ors that I use, just remember to remove the ".txt" from the "openrecoveryscrip.txt" before using it.
DON'T FLASH IT, IT IS NOT A CWM ZIP!!
This is by no means perfect but rather to provide a point of departure in helping others create similar tasks to automate their backups to their preference so please rename, delete and add as much as you like. Maybe post your findings too!
Remember, if you don't understand do the following (in order): search, read, think, SEARCH, READ, THINK, SEARCH!, READ!, THINK! ask.
Good luck
I would like to give credit to
Phil3759 for developing a great recovery that makes the whole party possible.
rootSU for his post which is far more thought out than mine but none the less got me'a thinkin.
Thank you for the guide (my 8 :good: are done today...)
I just add this so people do not browse much:
The file /cache/recovery/openrecoveryscript
Code:
backup SDCR123BAEOM foldername_not_full_path
S System partition
D Data partition
C Cache partition
R Recovery partition
1 Special partition 1
2 Special partition 2
3 Special partition 3
B Boot (kernel) partition
A .android_secure
E sd-ext partition
O Enable backup compression
M Do not create MD5sums
foldername Optional (if not specified, a folder with timestamp is created, so you do not have to delete previous folder)
Currently, 1, 2 and 3 are not supported. I could assign modem and efs to them later, but I do not think it is really useful
Migrate filesystem to F2FS
Prerequisite
This tutorial is based on TWRP 2.8.0.1
You need mkfs.f2fs support into TWRP 2.8.0.1
Your kernel needs to support f2fs
Your boot.img should have an fstab that permit to mount f2fs filesystem.
Important: contact the ROM maintainer if you are not sure about which partition you can format into f2fs
Download
for F2FS: mkfs.f2fs
You need to download mkfs.f2fs only if your TWRP doesn't include it. Simply push mkfs.f2fs into /sbin when you are on the recovery (eg: adb push mkfs.f2fs /sbin/).
Migrate /data
On this tutorial, we will show you how to migrate /data to f2fs without data lost (you need of course a valid backup).
Convert /data to F2FS :
Reboot into TWRP (push mkfs.f2fs if needed)
Backup the ROM
Go to Wipe/Advanced Wipe
Select Data
Select "Repair or Change File System"
Select "Change File System"
Select "F2FS" (Swipe to change will format the filesystem.)
Restore /data :
Go to Settings
Select "Use rm -rf instead of formatting"
Go to Restore
Select your backup and check ONLY "Data"
Swipe to restore
When the restore is done, go to Settings and uncheck "Use rm -rf instead of formatting"
(Use rm -rf instead of formatting) only necessary if you want to restore a filesystem backup done with another filesystem format. (eg: restore an ext4 backup to an f2fs target). If you don't check it, TWRP will revert the change and format the partition to the filesystem used during the backup of the filesystem.
Migrate /cache
Convert /cache to F2FS :
Reboot into TWRP (push mkfs.f2fs if needed)
Go to Wipe/Advanced Wipe
Select Cache
Select "Repair or Change File System"
Select "Change File System"
Select "F2FS" (Swipe to change will format the filesystem.)
Migrate /system
You need to follow the same procedure than "Migrate /data" but of course you need to format system and to restore system.
Migrate /sdcard
If you want to do a backup, run into recovery and from your computer run "adb pull -p /sdcard backup_folder/".
To restore just do adb push -p backup_folder/ /sdcard
Convert /sdcard to F2FS :
Reboot into TWRP (push mkfs.f2fs if needed)
Go to Wipe/Advanced Wipe
Select Internal SDCard
Select "Repair or Change File System"
Select "Change File System"
Select "F2FS" (Swipe to change will format the filesystem.)
Select terminal and run:
chown -R 1023.1023 /sdcard
chmod -R 770 /sdcard
Boot the ROM
Now it's time to reboot the ROM.
You can check that every partition migrate to f2fs are available by doing that during the "bootanimation" :
Connect with adb shell
Tape the command "mount" (You should see for example "/data f2fs" somewhere in the output)
You can have a long long long reboot if /cache is not available.
You can have a message relative to encrypt device if /data is corrupted or unavailable.
On both case, simply restart into the recovery and check the procedure again.
Rolback procedure
Just do the same migration procedure but of course reformat to ext4 (or what's you want that is supported by your ROM)
ROM known to be supported:
Pure AOSP lollipop (/data and /cache supported) - (mkfs.f2fs not available)
nAOSProm 5.0 (/data, /cache and /sdcard supported)
Any other ? Let me know and I will update the post
Thanks
Thanks to frantisekz and mirhl that permit me to improve the procedure
Many thanks man, it's freakin easy to do! I have some questions:
- I fell dizzy about it, I can't format /system partition to f2fs on nAOSP yet, am I right?
- formatting from ext4 have nothing to do with /data partition size change, yes? (and some off topic question: does increasing data partition size help on Lollipop? Is system feeling more responsive, faster?)
A6ekAK said:
Many thanks man, it's freakin easy to do! I have some questions:
- I fell dizzy about it, I can't format /system partition to f2fs on nAOSP yet, am I right?
- formatting from ext4 have nothing to do with /data partition size change, yes? (and some off topic question: does increasing data partition size help on Lollipop? Is system feeling more responsive, faster?)
Click to expand...
Click to collapse
no you can't format /system to f2fs on nAOSP. You can take a look on nAOSProm thread but there is no good reason to migrate it to f2fs. /system is mounted in read-only mode. But if I have few request to permit it I will integrate it (really easy to do) but I think that this is more trouble for the end user.
There is no link with /data partition size to migrate to f2fs. Increase /data can be necessary depending your own usage. You can take a look on the TUTORIAL to increase the data partition.
Thanks for clarification
Thanks for this tut. Put it in Sony Cross-Device General
Deleted
Sorry for the noob question but what's the benefit from doing this?
zaidx said:
Sorry for the noob question but what's the benefit from doing this?
Click to expand...
Click to collapse
f2fs is faster when you have to write on a SD card for example. This is a filesystem build for this kind of storage in mind.
https://en.wikipedia.org/wiki/F2FS
Hi,
What about to convert sdcard (Intenal Storage) to f2fs as well ?
Christophe
I'm not able to convert the partitions
For those who have tried: is there any improvement?
First i formatted my partitations with twrp to f2fs file system.And then i installed nAOSP rom to my device. Without any problem i'm using my phone but for others Do we need install rom first then backup data before converting partitations and restore data, after formatting f2fs?
zaidx said:
Sorry for the noob question but what's the benefit from doing this?
Click to expand...
Click to collapse
You can check this post for benefits :
http://forum.xda-developers.com/showthread.php?t=2697069
cge_95 said:
Hi,
What about to convert sdcard (Intenal Storage) to f2fs as well ?
Christophe
Click to expand...
Click to collapse
Yes it's possible. I will wrote the procedure when I will do the test on my side.
Does someone have another download link?
SwitzXXL said:
Does someone have another download link?
Click to expand...
Click to collapse
use this linkView attachment mkfs.f2fs.zip
mickybart said:
Restore /data :
Go to Settings
Select "Use rm -rf instead of formatting"
Go to Restore
Select your backup and check ONLY "Data"
Swipe to restore
When the restore is done, go to Settings and uncheck "Use rm -rf instead of formatting"
(Use rm -rf instead of formatting) only necessary if you want to restore a filesystem backup done with another filesystem format. (eg: restore an ext4 backup to an f2fs target). If you don't check it, TWRP will revert the change and format the partition to the filesystem used during the backup of the filesystem.
Click to expand...
Click to collapse
I'm now waiting since 10-20 minutes while "Removing all files under '/data' .... how long does it normally take?
Latest version of TWRP works again on Xperia S
The latest version of TWRP, version 2.8.4.1, works great on our Xperia S! Do not add mkfs.f2fs support to TWRP 2.8.4.1 since this comment applies only to version 2.8.0.1. TWRP 2.8.4.1. has build in mkfs.f2fs support.
Flash TWRP version 2.8.4.1 from the adb shell, or with the terminal app in TWRP by using this code:
Code:
dd if=/tmp/twrp-2.8.4.1-nozomi.img of=/dev/block/mmcblk0p11
Please dubble or triple check the correct spelling of "mmcblk0p11".
mgrinwis said:
However, do not add mkfs.f2fs support to TWRP 2.8.4.1 since this comment applies only to version 2.8.0.1. TWRP 2.8.4.1. has build in mkfs.f2fs support.
Click to expand...
Click to collapse
you're kinda wrong. the rom that you have (in your /system) must have mkfs.f2fs /sbin/ . current pure aosp rom doesnt have it, so you need to push the file manually. it doesnt matter what your twrp version. if there's no mkfs.f2fs in the rom, it cant change to f2fs.
if you have current naosp rom installed, you dont need to push mkfs.f2fs.
Latest test kernel has mkfs.f2fs included.
m1st3r1 said:
you're kinda wrong. the rom that you have (in your /system) must have mkfs.f2fs /sbin/ . current pure aosp rom doesnt have it, so you need to push the file manually. it doesnt matter what your twrp version. if there's no mkfs.f2fs in the rom, it cant change to f2fs.
if you have current naosp rom installed, you dont need to push mkfs.f2fs.
Click to expand...
Click to collapse
Thanks for your quick corrections/remarks! I figured it was related to the TWRP version because the f2fs option was availible after I installed version 2.8.4.1...
Thanks I will take a look on TWRP 2.8.4.1.
mkfs.f2fs need to be available on the recovery itself.
On the ROM you don't have mkfs.f2fs on nAOPSrom or Pure AOSP lollipop because the mkfs.f2fs is build statically and pushed into the boot.img only (ramdisk part). This is a pure choice and default rule for f2fs-tools (mkfs.f2fs) because format a filesystem from the ROM is not really common.
If TWRP 2.8.4.1 embedded mkfs.f2fs, you will have it out of the box. On nAOSProm and pure AOSP lollipop, the init process push the mkfs.f2fs into TWRP to add the feature (necessary for 2.8.0.1 support of mkfs.f2fs).
EDIT: for pure AOSP lollipop this is include with the last test kernel but not in test11. for nAOSProm you need b15 (or b14c boot.img)
Hi
Let's say we have tablet with allwinner a20 but there are two versions of MB(let's call it first MB and second MB). They use different firmware, when you flash wrong one device is booting but lcd is black(only backlight). I have access to stock firmware but only for first version of MB. So I tried to pull firmware from working device. What I did(in short):
1. Factory data reset.
2. Dump bootloader, boot, env, system, recovery partitions using dd if=nandX of=nanaX.img
3. Unpack stock firmware with imgRePacker.
4. Replace bootloader.fex, boot.fex, env.fex, system.fex, recovery.fex with files from step 2.
5. Mount bootloader partition and make copy of script.bin.
6. Update boot1 and boot2 files using update_boot0 and update_boot1 from SDK.
7. Second MB have one extra partition (called private) so I edited sys_partition.fex and generated sunxi_mbr.fex & dlinfo.fex files with update_mbr.
8. Pack modified firmware to img file.
Device booted successfully after flashing my firmware with phoenixsuit, everything worked, but when i restarted, tablet was stuck in bootloop. I tried to look at logcat output, it looks like it cannot create dalvik-cache directory on /data partition. Strange thing, because all required folders are created on /data partition at first boot, including dalvik-cache, they just dissappear after reboot. Wipe data from recovery doesn't help, I need to do reflash using phoenixsuit, but again, first boot OK and then device is bootlooping.
I also tried flashing my firmware on another tablet but I clicked No in "Does mandatory format?" window, tablet was stuck in bootloop with same errors about dalvik-cache directory.
When I try to make dalvik-cache directory manually using ADB it gives me some I/O error, but I can create folders with different names on /data partition without problems.
I don't have access to device right now, I will post logcat asap.
Another strange thing, on second MB with stock firmware there is 4,07GB of internal sd, but when I flash my firmware it grows to 4,56GB. It's almost 500MB Output of cat /proc/partitions is same(only size of last partition(internal sd) is different).
I will try to dump /data partition and add it to img file but it won't problably work. I'm also looking for a way do dump original MBR and boot0/boot1 from nand, in /dev/block I don't have device that represents full nand, only partitions(nanda, nandb, etc).
I have access to many tablets that I can play with, I bricked 2 so far
I don't know if it's right place to post such problems but I hope someone will be able to help