[Q] "Lost" Internal Storage and ODIN after failed encryption on ICS (AOKP Build 39) - Samsung Epic 4G Touch

[Q] "Lost" Internal Storage and ODIN after failed encryption on ICS (AOKP Build 39)
I have kind of an odd one. I flashed AOKP Build 39 today (using ODIN to EL29 CWM then flash). That went fine. Then I tried to encrypt the phone, which failed and kicked me back out to reboot. It mentioned something about having to do a full factory reset. I think I saw the default recovery logo show for a second before the AOKP boot animation kicked in. Phone booted fine, then I noticed that I lost the Internal storage. My SD card is at /emmc, and it works fine. I tried to ODIN back to EL29 CWM to do a full reflash (using the 1 Click Restore in the Sticky section) and now ODIN keeps failing at "Setting up Connection"
I'm hoping you guys can give me some insight

I dont have much to say on whats going on or how to fix it but.... From what I've read from your post you said something about a "factory wipe" form the "stock recovery"!!! I know you said that you didn't do the wipe, the phone did when it reset itself... I know that is a big no no with this rom. And the mention of eMMC... Sounds like the eMMC hardbrick bug.
On a side: This has got to be at least the 3rd or 4th post I've read today with the words "AOKP Build 39", "eMMC" and "factory reset" in them. And not one of them has turned out good.
Sent From My Galaxy Class StarFighter

I don't think it is the eMMC hardbrick bug. From what I have read of that, it completely hoses the phone. Also Build 39 has CWM 5.5 (which I heard is a bad build), so I didn't see it boot into Recovery.
I looked into it more and I keep seeing things in logcat about bad partitions. I would try an reformat it, 'cept I don't know how (safely at least). Maybe flashing Caulkin's Format All? I've pasted in the logcat info for anyone that wants to look
Code:
D/VoldCmdListener( 1745): volume mount /mnt/sdcard
D/DirectVolume( 1745): Checking for bad partition major number
D/DirectVolume( 1745): Found bad partition
E/DirectVolume( 1745): Fixing major number from 179 to 259 for partition 11
I/Vold ( 1745): /dev/block/vold/259:3 being considered for volume internal
D/Vold ( 1745): Volume internal state changing 1 (Idle-Unmounted) -> 3 (Checking)
D/MountService( 1865): volume state changed for /mnt/sdcard (unmounted -> checking)
I/StorageNotification( 1955): Media {/mnt/sdcard} state changed from {unmounted} -> {checking}
D/MountService( 1865): sendStorageIntent Intent { act=android.intent.action.MEDIA_CHECKING dat=file:///mnt/sdcard (has e
xtras) }
I//system/bin/fsck_msdos( 1745): ** /dev/block/vold/259:3
I//system/bin/fsck_msdos( 1745): Invalid signature in boot block: f616
I/logwrapper( 1745): /system/bin/fsck_msdos terminated by exit(2)
E/Vold ( 1745): Filesystem check failed (not a FAT filesystem)
W/Vold ( 1745): /dev/block/vold/259:3 does not contain a FAT filesystem
E/Vold ( 1745): /dev/block/vold/259:3 failed to mount via NTFS (No such device)
E/Vold ( 1745): Volume internal found no suitable devices for mounting :(
D/Vold ( 1745): Volume internal state changing 3 (Checking) -> 1 (Idle-Unmounted)
I/PackageManager( 1865): Updating external media status from unmounted to unmounted
D/MountService( 1865): volume state changed for /mnt/sdcard (checking -> unmounted)
D/MountService( 1865): sendStorageIntent Intent { act=android.intent.action.MEDIA_UNMOUNTED dat=file:///mnt/sdcard (has
extras) }
D/MediaScannerReceiver( 2029): action: android.intent.action.MEDIA_UNMOUNTED path: /mnt/sdcard
I/MemorySettings( 4775): Received storage state changed notification that /mnt/sdcard changed state from unmounted to ch
ecking
I/MemorySettings( 4775): Received storage state changed notification that /mnt/sdcard changed state from checking to unm
ounted
I/StorageNotification( 1955): Media {/mnt/sdcard} state changed from {checking} -> {unmounted}
D/VoldCmdListener( 1745): volume shared /mnt/sdcard ums
D/VoldCmdListener( 1745): volume shared /mnt/emmc ums

So I managed to fix the issue myself. I'll put the instructions down here in case anyone needs them
I tried "normal" Odin and that let me flash the EL29 CWM. From there I just flashed Caulkin's Format All (several times) and then reflashed my ROM.

"normal" odin as opposed to ? mobile odin ? I never mobile odin .. I personally do not trust it .. I have always and will always "normal" odin

i think people should just stop flashing those aokp
i try to time and it fail on my phone
better safe than sorry

yoo0angg said:
"normal" odin as opposed to ? mobile odin ? I never mobile odin .. I personally do not trust it .. I have always and will always "normal" odin
Click to expand...
Click to collapse
As opposed to the EL29 Restore executable, ie this http://forum.xda-developers.com/showthread.php?t=1433101

Kyral Retsam said:
So I managed to fix the issue myself. I'll put the instructions down here in case anyone needs them
I tried "normal" Odin and that let me flash the EL29 CWM. From there I just flashed Caulkin's Format All (several times) and then reflashed my ROM.
Click to expand...
Click to collapse
Awesome m8!!!
Glad it wasn't as bad...
mrej201 said:
i think people should just stop flashing those aokp
i try to time and it fail on my phone
better safe than sorry
Click to expand...
Click to collapse
That's what I'm saying...
Sent From My Galaxy10.1 Class Starship...

Related

[Q] odd issue with i927r baseband and IMEI

hi everyone
at first I must say sorry for my bad english writing
well I've a galaxy glide i927r and I was using it with a none contracted sim card
it was unlocked already,suddenly it asked me to insert network unlock key and I inserted that so many times that there was no attempts left
so I took the phone to a repair store (unofficial) and it seems they flashed it with a 4.0.4 at&t rom without backing /efs folder up
so when I took it back I had no baseband,no imei and of course no signal !
I tried so many methods and still the problem is going on,BUT now when I go to /efs with root explorer and refresh that some time, at fisrt the folder is completely empty except a file named "essiv" and aftresh some refresh try, the nv_data and ... begin being created
so my base band comes back,my IMEI goes to 0049 ... (at first it is null/null) and the signal appears
but after the reboot, I had to repeat the steps (going to root explorer,/efs folder and refresh) to get every thing back
I just want to have the /efs data permanent even with 0049 serial number
P.S ; I have a stock 2.3.5 rom
P.S2: after flashing stock rom with odin and in CWM mount and storage menu, it says failed to mount /efs ( invalid argument)
up ..........
eefe said:
up ..........
Click to expand...
Click to collapse
Can you past your "mount" terminal command?
I think you rom couldnt mount /efs thats why its empty, its on ramfs.
Go to custom recovery, try mount efs, I suggest to backup EFS's block device, you may try to recovery files from the dump, then format /efs.
You can mount efs with one click in TWRP.
Run mount in adb shell should contain:
/dev/block/mmcblk0p1 on /efs type ext4 (rw,seclabel,relatime,user_xattr,acl,barrier=1,data=ordered)
You can make dump:
dd if=/dev/block/mmcblk0p1 of=/sdcard/backup.bin
you can format with ( only if you sure)
mkfs.ext2 /dev/block/mmcblk0p1
You can find many extfs recovery program, maybe you will be lucky.

[Tools/Recovery] TWRP for LG Optimus F3Q

TWRP Recovery for the LG F3Q (codenames: fx3q, d520)
Background story (who ever wants to know):
As I'm currently testing around with flashing etc I hated it to re-flash the stock ROM again and again. It is sooo time consuming..
In that kind of ROM compiling learning process I also was able to build a working TWRP recovery for the LG F3Q so that was such a good feeling But as said the caveat was that because of the locked bootloader we can reach TWRP (or CWM) only when executing "adb reboot recovery" from the running system. That was not really satisfying me though..
Some day I've done a factory reset and well I saw that this is starting my TWRP recovery when executing it! Well it isn't such a surprise as TWRP sits on the recovery partition and will be triggered by the factory reset script but... well do you think what I think? When it would be possible to start TWRP fully and not that factory reset part of TWRP than we would have a workaround to reach the recovery mode without booting the system (which is in fact not possible anymore when flashing of system.img/boot.img fails)
That said.. I was in touch with the TWRP developers bigbiff and Dees_Troy and many thanks for the hint they gave me! I have build a new TWRP version based on that information I got and well the idea of that is:
Vol Down + Power -> LG Factory Reset screen appears
Confirming with power 2 times as asked
Voila: No factory reset anymore but TWRP is here!
Well that will have a caveat - READ CAREFULLY:
As you may think of the factory reset in the boot-up process and within the ROM will not working anymore until you flash another recovery!
But if you know that it is not such a caveat because you can choose the wipe options within TWRP to do a "manual" factory reset.
v2.8.1.0 build 5
USE THAT ON YOUR OWN RISK! BACKUP BEFORE!
Working (quickly tested):
Install (to flash a custom Kernel)
Mounting partitions
Reboot Recovery | System
adb shell (also see known issues)
Backup (compressed | uncompressed | encrypted (!) | unencrypted)
Restore (unencrypted | encypted (!) | compressed | uncompressed)
Internal storage /data/media
MTP which mounts the external storage!
File Manager
Terminal Command
Power charging while in TWRP
Displaying CPU temp
Totally untested:
WIPE (should work)
decrypting /data (but should work as it do so for encrypted backups already)
Every option which is not stated as "Known issue" or "Working"
Known issues (with workarounds):
ADB works only when screen "timed out" (manual locking does not help it must time out) therefore ADB can take up to 1 minute after boot until it becomes available (because screen need to be timed out first)
Workaround: set the time limit in the screen menu to e.g. 10 sec (that is the default value for now)
Timezone is not set correctly (that seems to be a well known bug in several devices using TWRP.... )
Workaround: set a timezone which displays the most accurate timezone
Known issues (without workarounds):
When you use the "Power Off" option in the "Reboot" menu the device will reboot instead of powering off
Wiping /data not possible after "factory reset buttons" used. You need to choose "wipe" and then "format data" manually (or use mke2fs on CLI).
Vibration is not working (I will not fix that atm because I like it that way)
Hardware keys at bottom doesn't work
If you use the factory reset button /data partition will be inaccessible and need to be re-flashed (means you will LOOSE your app and system configs when you use factore reset)
Download:
Attached you will find the TWRP v2.8.1.0 version ready to use even with locked bootloader:
BACKUP EVERYTHING BEFORE USING THIS. USE AT YOUR OWN RISK!
DD Image file:twrp_v2.8.1.0_build5_fx3q_FR-OFF.img.zip = FactoryReset is disabled / TWRP will be loaded instead (also see known issues)
Read the Installation & Usage instructions in this thread on how to install that file.
Installation & Usage instructions
Pre-Requirements
Read the FAQ
YOU NEED ROOT! (check FAQ)
YOU SHOULD do a NANDroid BACKUP! (check FAQ)
You need to boot up, enable USB debugging and then connect USB cable.(check FAQ get ROOT - the link contains a guide on that)
You better doing a NANDroid backup right? (I mentioned that before - but DO it! NOW!)
For the best usage experience install the sediKERNEL or use joel's debloated stock ROM which includes it already
Bulletproof Method 1: "the average user"
Use this guide if you simply want to install & use TWRP like it should be. If you're unsure use this guide!
Install:
Download the TWRP recovery file and unzip it
copy it to your device (e.g. adb push or simply copy & paste by your file browser)
Download the loki_tool (https://github.com/djrbliss/loki/raw/master/bin/loki_tool)
copy loki_tool to your device (e.g. adb push or simply copy & paste by your file browser)
execute:
adb shell
su (you may need to grant permission)
mount -oremount,rw /system
cp /PATH-WHERE-YOU-COPIED/loki_tool /system/bin/ && chmod 755 /system/bin/loki_tool
loki_tool flash recovery /PATH-WHERE-YOU-COPIED/twrp_X.X.X.X_recovery_FRoff/off.img
reboot recovery --> you should see the TWRP screen
Usage (sediKERNEL v2.0 or higher installed):
Power on the device
when you see the LG logo the first time do NOTHING!!
When the screen goes black THEN press Volume UP + Volume DOWN. Both the same time and hold them pressed.
Release the buttons when the screen goes black again
Wait. You will see the LG logo a third time and then you will see the recovery screen!
If you see a kernel crash then you have pressed the magic keys too early! Read and follow the above steps carefully and you should be fine.
Usage (without sediKERNEL v2.0 or higher):
boot into your ROM
execute "adb reboot recovery" from your PC or open a Terminal on your device and execute "su" then "reboot recovery"
Bulletproof Method 2: "developers only"
This is the developers preferred way of installing TWRP. It ensures that even when your ROM or Kernel gets damaged that you still be able to boot into recovery. This is to the developers or heavy testers who are knowing what they do ONLY!
But even when you think this is for you: Read the important hint at the end before deciding if you want to choose this method.
Install:
flash recovery image to your RECOVERY partition:
adb shell su -c dd if=/storage/external_SD/twrp_vXXXXX_fx3q_FR-OFF.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
adb reboot recovery
A user reports the the by-name does not worked for him but this one:
adb shell su -c dd if=/storage/external_SD/twrp_vXXXXX_fx3q_FR-OFF.img of=/dev/block/mmcblk0p17
-> If you can see TWRP now everything is fine - Otherwise DO NOT continue!
BACKUP YOUR WHOLE DEVICE NOW! I highly recommend to backup everything except /data from within TWRP because it is easy and works (from TWRP v2.8build5 or higher)
BACKUP /data is recommended to be done NOW and this way:
adb shell su -c dd if=/dev/block/platform/msm_sdcc.1/by-name/userdata of=/external_sd/userdata_backup_stock.img
--> This can take a long while but it contains also the backup for the internal storage not only /data and that internal part is not backupable over TWRP
while in TWRP flash the same recovery image to your BOOT partition now (do not think that this is dangerous. The boot partition is not a magic thing or so it is only the partition which will be started from the bootloader thats all about it. So yes you can install a recovery image on the boot partition without any harm.):
adb shell su -c dd if=/external_sd/twrp_vXXXXX_fx3q_FR-OFF.img.loki of=/dev/block/platform/msm_sdcc.1/by-name/boot
watch carefully that the process ended without errors and that the size is exactly the same as it should be (about 1,3GB)
adb shell sync
power off the device by taken out the battery (do not use reboot or something we want to be sure that the next step is absolutely really the normal boot up)
Boot up normally --> you should see TWRP !! You're NOT in recovery mode you're booting the normal boot mode!
Go on with flashing the sediKERNEL into your RECOVERY partition:
Download the sediKERNEL from here (the stock one could work, too but never tested ...)
push it to your device with adb or MTP (since v2.8build5)
Flash the sediKERNEL to your RECOVERY partition:
adb shell su -c dd if=/external_sd/sediKERNEL_JB-vXXXX.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
Reboot into Recovery by using TWRP GUI or by executing "adb reboot recovery"
Your ROM will boot.
Usage:
From now on every time your device booting up you will see the TWRP screen and need to choose Reboot-->Recovery to boot your ROM.
This is the absolute best way to use TWRP if you want to be sure that you will reach the recovery even when your ROM gets damaged and is confirmed to work very well (as always guarantees are not available )
Important hint:
Be sure that you keep in mind that from now on your recovery and boot partition are not the same anymore (you can always revert back to the normal behaviour, of course!). So if you want to flash a kernel image you need to ensure that it goes to the RECOVERY partition instead of the normal BOOT partition (because on boot partition is TWRP now).
If I got my ROM working I will definitively add an option to the installer where this will be ensured and I asked @joel.maxuel for his stock ROM to add that, too. As for now we are the only ones who are developing for the F3Q so you should be save enough atm but you will need to keep that always in mind when you want to replace the kernel and/or ROM.
What would happen if you forget about that? Well nothing really bad because when you install a kernel or ROM the boot image partition simply gets overwritten and that means only that your TWRP is not there anymore but the system will boot (if the new kernel/ROM is not buggy or damaged). You then could install TWRP by method 1 or using method 2 by using the boot image/Kernel you want to install.
Damage your device - booting (NOT RECOMMENDED will loose /data ):
You probably NEVER want to use this method. It is here for reference only.
I highly recommend to choose one of the above bulletproof versions instead of this one because it WILL damage /data and you need to restore that whole partition afterwards.
All my tests has shown that this comes not from TWRP (in one of my tests I disabled everything in the sourcecode of TWRP which wipes /data) but coming from LG itself. The factory reset button/option do something with the /data partition sturucture and afterwards you cannot use that anymore. I also tried to restore the partition info by trying all backup superblocks but that doesn't worked. No backup superblock is accessible.
Restoring them by mke2fs and e2fsck does not work unfortunately.. (mke2fs -S /dev/block/platform/msm_sdcc.1/by-name/userdata && e2fsck -yf /dev/block/platform/msm_sdcc.1/by-name/userdata)
So if you have loosed your /data and/or internal storage you need to have a DD imaged backup near.
Install:
same as for "Bulletproof Method 1" above
Usage:
When you choosen FR-OFF then TWRP will be able to start without booting up the whole system (also see known issues):
Power Off the device (remove battery)
Vol Down + Power --> Then put the battery back --> LG Factory Reset screen appears
Confirming with power button 2 times as asked - if you downloaded and flashed the FRoff version of TWRP it will NOT open the normal reset procedure but /data and the internal storage are not accessible afterwards (read above about the details). That means your app configs and systems configs get lost that way. You have been warned!
Voila: No (full) factory reset anymore but TWRP is here when you have damaged your ROM or for some dev approach
If you want the factory reset back simply choose the file twrp_2.7.1.0_recovery_FRon.img.lok and follow the above instructions. Afterwards you will have TWRP but it will be reachable only when you execute "adb reboot recovery" from the running system.
XDA:DevDB Information
sediTWRP for LG Optimus F3Q, Tool/Utility for the General Discussion
Contributors
xdajog
Source Code: https://github.com/xdajog/bootable_recovery_twrp_fx3q
Version Information
Status: Stable
Current Stable Version: v2.8.1.0 build 5
Stable Release Date: 2014-11-18
Created 2015-05-19
Last Updated 2015-07-20
FAQ
Frequently Asked Questions (FAQ)
What is that "adb" thing?
adb stands for: Android Debug Bridge and can help a lot when it comes to work with your device. It is not for developers only but they use it a lot of course.
But a normal user can use this to exchange files without the need of mounting, backing up the device, reboot the device and use it as a very comfortable way of having a terminal emulator.
Normally adb itself is not available as a standalone application - it comes with the Android SDK which is very big and heavy if you want to use adb and/or fastboot (another great tool) only.
But we live in a great world with many people wanting to make things easy so here you go when you want/need only adb and fastboot:
download & install adb at lifehacker
(Direct link for Windows users: Go to easy ADB install thread)
How to get root for the F3Q?
Here is the tool and guide: Saferoot
[*]What is a "nandroid" backup?
nandroid means essentially: "a full image of all your partitions" so it is a full snapshot of your ROM including all your apps and contents.
The name NANDroid is a portmanteau of "NAND" (as in Flash memory - NAND flash) and "Android." (Source)
[*]How to create a "nandroid" backup?
(See above for the meaning of "nandroid backup")
You have several options on how to do that.
The normal and absolutely recommended way is to do that "offline" (from within recovery mode) but you can also do it "online" (while Android is running).
.
Offline nandroid backup by using TWRP recovery: Guide
If you have no custom recovery installed read on.
.
Online nandroid backup:
by using an app:
There is 1 (known to me) "online" nandroid backup tool available which will backup from within your running Android: PlayStore.
I tested it and still using it since a while and I really like it but I would not fully resist on it.
I had no problems backing up but sometimes an app is lost when restoring. This may have been fixed but well it is like imaging a running Windows or Linux system:
Do not do it online if you can - it may/will work but there could be problems/inconsistencies later!!
If you never made a nandroid before doing it online will not harm anything and should be your first start. So install the Online Nandroid backup tool and begin.
Check out this guide for some hints: Guide
(If you like the Android app do not hesitate to buy the unlock key to support the developer!)
by using commandline tools:
First of all you need "adb" installed (check out the FAQ answer number 1 above).
Then you need someone who is telling you the device partition table and you need a big sized SD card to hold the images.
The reason is that you will use a special command named "dd" which images the whole partition (not the content only!).
dd is a VERY dangerous tool because if you use it wrong your device may get bricked so it is essential that you are using the
correct command and check that twice!
Check out the next FAQ on how to do this for the F3Q.
[*]How to create a "nandroid" backup for the F3Q - WITHOUT having a custom recovery?
The whole process will take a big amount of time but it is worth to follow each step including the md5sum checks at the end.
Please read the previous FAQ first because there you will find more information about background and other options you may have.
Ensure you have a SD card inserted which is big enough and having enough free space available (4GB at least! I recommend at least 8 GB but this depends on the size of your current data partition. A completely stock ROM with nothing installed and unused will need 3 GB space).
.
Install "adb" on your pc (check out the FAQ #1 above).
root your device (check out FAQ #2 above)
connect with adb to your (running) F3Q:
adb shell
(you should see a prompt)
su
(you need to grant permission if you haven't yet)
Then backup your current ROM and data:
dd if=/dev/block/platform/msm_sdcc.1/by-name/system of=/storage/external_SD/system.2015-07-20.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/boot.2015-07-20.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/userdata of=/storage/external_SD/userdata.2015-07-20.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery of=/storage/external_SD/recovery.2015-07-20.img
# If you never backed up your EFS you really should do that once:
dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst1 of=/storage/external_SD/modemst1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst2 of=/storage/external_SD/modemst2.img
Click to expand...
Click to collapse
Just to be sure you can do an online backup now, too ( Guide ) Online Nandroid backup App
.
copy the backup(s) to your device (connect USB cable - open your external storage and drag&drop) <--- DO NOT SKIP THIS STEP!!!! It is absolutely essential!
Check your copy on your device:
md5sum /storage/external_SD/system.2015-07-20.img
md5sum /storage/external_SD/boot.2015-07-20.img
md5sum /storage/external_SD/userdata.2015-07-20.img
md5sum /storage/external_SD/recovery.2015-07-20.img
md5sum /storage/external_SD/modemst1.img
md5sum /storage/external_SD/modemst2.img
Click to expand...
Click to collapse
Download a md5sum checker like this one Windows MD5 and load each file you copied to it (on Linux the "md5sum" command can be used of course).
compare the md5sums from the above output and ensure that they are all matching.
[*]Why is factory reset not working when installing TWRP? (or: AAAAaaaah my /data is inaccessible after doing a factory reset!!!!)
All my tests has shown that this comes not from TWRP (in one of my tests I disabled everything in the sourcecode of TWRP which wipes /data) but coming from LG itself. The factory reset button/option do something with the /data partition sturucture and afterwards you cannot use that anymore. I also tried to restore the partition info by trying all backup superblocks but that doesn't worked. No backup superblock is accessible.
Restoring them by mke2fs and e2fsck does not work unfortunately.. (mke2fs -S /dev/block/platform/msm_sdcc.1/by-name/userdata && e2fsck -yf /dev/block/platform/msm_sdcc.1/by-name/userdata)
So if you have loosed your /data and/or internal storage you need to have a DD imaged backup near. Sorry but you have been warned (known issues) before.
.
if you want the factory reset back simply choose the file twrp_2.7.1.0_recovery_FRon.img.lok and follow the above instructions. Afterwards you will have TWRP but it will be reachable only when you execute "adb reboot recovery" from the running system. v2.7. is not recommended to use but atm the only option if you really want that. Instead I would better try the wipe options from within TWRP and re-installing your ROM of choice or simply using the official LG flashing tool to get your F3Q fully reset.
.
History / Changelog
Previous development (v2.7.1.0)
I HIGHLY RECOMMEND USING v2.8 instead of this version!
You have been warned.. If you still want that buggy version go on here:
USE THAT ON YOUR OWN RISK! I STRONGLY RECOMMEND TO BACKUP EVERYTHING BEFORE PROCEEDING.
Working:
Install (to flash a custom Kernel)
Mounting partitions (see known issues for the internal one)
Reboot Recovery | System
adb shell
File Manager
Terminal Command
Totally untested:
WIPE (may work)
Known issues:
If the device becomes locked and then unlocked by the user adb will restart on the device (or crash and start again. haven't had looked into that yet)
When you use the "Power Off" option in the "Reboot" menu the device will reboot instead of powering off
RESTORE (will NOT work!)
BACKUP (will NOT work!)
You cannot mount the external sd via USB or MTP
Vibration is not working (I will not fix that atm because I like it that way)
Timezone is not set correctly (that seems to be a well known bug in several devices using TWRP....
Internal storage is missing (/data/media)
Hardware keys at bottom doesn't work
If you use the factory reset button /data partition will be inaccessible and need to be re-flashed (means you will LOOSE your app and system configs when you use factore reset)
Download:
Attached you will find the loki'ed TWRP version (v2.7.1.0):
AGAIN: THIS IS A PROOF-OF-CONCEPT only. It definitively WILL have bugs and problems! I want to proof that it will be possible to have TWRP on this device and also have a way to boot up into TWRP without booting the whole system.
twrp_2.7.1.0_recovery_FRoff.img.lok = FactoryReset is disabled / TWRP will be loaded instead
twrp_2.7.1.0_recovery_FRon.img.lok = FactoryReset is enabled / TWRP can be reached with "adb reboot recovery" only
Read the Installation & Usage instructions in the OP on how to install that file.
Awesome work! Saves having to risk modifying the bootloader (for now). :laugh: :highfive: Thanks!
xdajog said:
TWRP Recovery for the LG F3Q / D520
...
Click to expand...
Click to collapse
I'm unable to get logs from TWRP, it does crash reliably when messing about in settings and such.
Timezone fix is needed. (Devices time is set to the correct local time, but TWRPs timezones arent correct.)
Device does not show internal storage.
Wipe menu does not differentiate from internal storage and /data
there's no /mnt, /storage or /sdcard present while in TWRP.
Uhm, I'm sure there's some more I've missed, but that's all I've got for now.
eriklion said:
I'm unable to get logs from TWRP, it does crash reliably when messing about in settings and such.
Click to expand...
Click to collapse
Uhm what do you mean? adb shell and then open /tmp/recovery.log? Clicking on the small mini icon at middle bottom of the screen? Both working for me. Have you tested the above attached version or the one I gave you at dropbox? The above is a more current one!
Timezone fix is needed. (Devices time is set to the correct local time, but TWRPs timezones arent correct.)
Click to expand...
Click to collapse
hm I will look into that
Device does not show internal storage.
Click to expand...
Click to collapse
yeah forgot to mention that. Is that shown in CWM btw?
Wipe menu does not differentiate from internal storage and /data
Click to expand...
Click to collapse
Could you explain what does that means?
there's no /mnt, /storage or /sdcard present while in TWRP.
Click to expand...
Click to collapse
/mnt and /storage are not needed or am I wrong? /sdcard would point to the internal storage I think but I decided to use /external_sd instead which is accessible in the latest version.
Finally got around to test. Looks great, I love having TWRP over CWM!
Unfortunately the backup function is not working. TWRP errors out and reloads itself. I have a pastebin, sorry it's so long but I wanted to try a couple different backup options before I gave up and produced a log file:
http://pastebin.com/QUfNw6Rk
The portions of interest are:
Code:
Backing up Cache...
I:Creating backup...
I:Creating tar file '/external_sd/TWRP/BACKUPS/1db9cba/1970-01-24--22-43-59 JZO54K//cache.ext4.win'
I:addFile '/cache/recovery' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/cache/recovery/log' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
...
Code:
Backing up Data...
I:Creating backup...
I:Creating tar file '/external_sd/TWRP/BACKUPS/1db9cba/1970-01-24--22-43-59 JZO54K//data.ext4.win'
I:addFile '/data/dontpanic' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg0' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/next_count' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg1' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg2' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg3' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg4' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg5' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg6' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
I:addFile '/data/dontpanic/last_kmsg7' including root: 0
Failed to get selinux context: Operation not supported on transport endpoint
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Starting TWRP 2.7.1.0 on Sun Jan 25 03:44:01 1970
I:Single storage only.
I:No internal storage defined.
I:No storage defined, defaulting to /sdcard.
I:Lun file '/sys/devices/platform/usb_mass_storage/lun0/file' does not exist, USB storage mode disabled
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 255
Starting the UI...Pixel format: 480x800 @ 32bpp
Pixel format: RGBX_8888
Not using qualcomm overlay, 'msmfb43_80201'
framebuffer: fd 4 (480 x 800)
=> Linking mtab
=> Processing recovery.fstab
I:Processing '/boot'
I:Processing '/cache'
I:Processing '/data'
I:Processing '/misc'
I:Processing '/recovery'
I:Processing '/external_sd'
I:Processing '/system'
I:Creating Android Secure: /external_sd/.android_secure
I:Backup folder set to '/external_sd/TWRP/BACKUPS/1db9cba'
I:Settings storage is '/external_sd'
Updating partition details...
I:Unmounting main partitions...
E:Unable to unmount '/data'
I have a stock based ROM to test, and I want to make sure I can enter recovery through the bootloader should things go sour. If TWRP can backup and restore, that allows me to go back to my true stock after the test. Any ideas?
joel.maxuel said:
Finally got around to test. Looks great, I love having TWRP over CWM!
Unfortunately the backup function is not working. TWRP errors out and reloads itself. [.....] Any ideas?
Click to expand...
Click to collapse
Yes.
There are several things coming in place when it comes to backing up out of TWRP atm...
You hopefully have read the big fat red warning ? What I mean is the part regarding /data gets lost when you do a factory-reset
That said if you have entered TWRP by pressing the physical keys your /data partition will be wiped (really bad thing but that it is made for and I haven't had the time to look into that further)
The result is a cleaned /data which is not mountable until you format it with mke2fs.
(e.g.: "adb shell mke2fs -T ext4 /dev/block/mmcblk0p15")
If you do not do that what MAY happens is that TWRP failing because of missing /data (and if not then you should ensure that /data was really backed up)
But as your log told me it seems to be not the problem here 'cause the /data partition is detected by TWRP. so it could be 2)
Mounting points.
As stated the mount points are not fully working in TWRP atm. That means when it comes to /sdcard which is the internal device storage it will fail, too because it cannot be found. The reason for this is that LG mounts /sdcard by the sdcard service but that is somehow tricky thats why it is not working atm.
And on top: the internal storage normally needs to be mounted to "/data/media" especially when we want to use MultiROM later.
So +1 for /sdcard or/and internal storage related
background info: http://teamw.in/DataMedia
The last one I could imagine is "something else" which could be catched by "/proc/last_kmsg"
The important thing is that this file gets written only after a crash and when the battery was not removed. So if the device reboots to TWRP again try to adb shell to the device and then paste the last_kmsg again. Maybe we can find something here.
When I will continue on TWRP I think of upgrading to v2.8 because they enable MTP here which could be good for copying data between device and pc..
BTW:
I have no idea what CWM port which is also be available would do in case of starting a backup especially what will REALLY gets backed up!!!!
IMHO the best way on doing a nandroid backup atm is "adb shell dd ...." Takes a long time but then you can be sure. I can give you all the mountpoints if you need them.
As I currently have not such much success with porting the ROM I will now come back here to TWRP and will finish it to have a hopefully fully working recovery. I cannot say the timeline for this but it will definitively be the next what I want to do because when this is done I can better match the rest for the ROM.
xdajog said:
<SNIP>
IMHO the best way on doing a nandroid backup atm is "adb shell dd ...." Takes a long time but then you can be sure. I can give you all the mountpoints if you need them.
As I currently have not such much success with porting the ROM I will now come back here to TWRP and will finish it to have a hopefully fully working recovery. I cannot say the timeline for this but it will definitively be the next what I want to do because when this is done I can better match the rest for the ROM.
Click to expand...
Click to collapse
This should work (I've done it before for eriklion):
Code:
adb shell
dd if=/dev/block/platform/msm_sdcc.1/by-name/system of=/storage/external_SD/system.2014-11-12.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/boot.2014-11-12.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/cache of=/storage/external_SD/cache.2014-11-12.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/userdata of=/storage/external_SD/userdata.2014-11-12.img
Now, is there a recommended adb command to wipe data and cache, since factory reset function is not the best choice? I see a few with the following process...
Code:
adb shell
su
format DATA
format CACHE
...but not much commentary on it.
I appreciate the second (third, whatever you are on) crack at TWRP. Hopefully the next version will squash the bugs. Btw, I will see if I can provide a /proc/last_kmsg tonight have posted a last_kmsg here.
joel.maxuel said:
This should work (I've done it before for eriklion):
Code:
adb shell
dd /dev/block/platform/msm_sdcc.1/by-name/system /storage/external_SD/system.2014-11-12.img
dd /dev/block/platform/msm_sdcc.1/by-name/boot /storage/external_SD/boot.2014-11-12.img
dd /dev/block/platform/msm_sdcc.1/by-name/cache /storage/external_SD/cache.2014-11-12.img
dd /dev/block/platform/msm_sdcc.1/by-name/userdata /storage/external_SD/userdata.2014-11-12.img
Click to expand...
Click to collapse
yes thats all you need to backup & restore
joel.maxuel said:
Now, is there a recommended adb command to wipe data and cache, since factory reset function is not the best choice? I see a few with the following process...
Code:
adb shell
su
format DATA
format CACHE
...but not much commentary on it.
I appreciate the second (third, whatever you are on) crack at TWRP. Hopefully the next version will squash the bugs. Btw, I will see if I can provide a /proc/last_kmsg tonight.
Click to expand...
Click to collapse
I always do it that way:
Code:
Starting TWRP
adb shell
("su" in TWRP not needed normally)
mke2fs -T ext4 /dev/block/mmcblk0p15 (for userdata)
mke2fs -T ext4 /dev/block/mmcblk0p14 (for cache)
Then you can be sure it is clean and well formatted. ext4 is for both cache and userdata and works fine for me.
twrp v2.8 with many enhancements and fixes is on its way
Stay tuned ....
if you get bored in the meanwhile ... click thanks
Is someone here with running the stock ROM (or absolutely not modified means formatted! /data partition) who is willing to give me a quick help? It must be stock or placed back to stock by using a backuped image dump if you have one.
The following need to be done in recovery so you need to have CWM or TWRP installed. Boot into recovery (adb reboot recovery) and then use "adb shell" to connect.
I need your output of this command:
Code:
mke2fs -n /dev/block/platform/msm_sdcc.1/by-name/userdata
This will not do/destroy/modify anything.
It should display some information about that partition. Read the details here http://linux.die.net/man/8/mke2fs
The reason is that LG factory reset seems to wipe superblocks (wanted by LG or not - fact is that they are thrown) and THEN forwarding to the recovery tool like TWRP but to be sure I need the above output from 1 or 2 people to be sure enough on how to proceed.
Thanks in advance
As Joel investigated that may destroy /data cause of a buggy version of mke2fs!! Oh man..
-----
Sent from my SGH-I927 using XDA Android mobile app
Ok thx to joel I'm able to investigate the LG facotry reset further.
In parallel I will try another way which will be (if I get it working) absolutely smooth and will not have such workaround character like the current idea (hijacking factory reset).
Give me some time but if that works it would be a great solution for accessing recovery..
Stay tuned some good things may happen...
-----
Sent from my SGH-I927 using XDA Android mobile app
Finally v2.8 for F3Q has arrived !!! I think a very good approach now!
Have fun and as usual any thx click.... and so on
Check out the OP for Download and details:
http://forum.xda-developers.com/showpost.php?p=55239027&postcount=1
UPDATE:
I have completely reworked the "Installation & Usage instructions" section in the OP. PLEASE READ and be happy
xdajog said:
Finally v2.8 for F3Q has arrived !!! I think a very good approach now!
Have fun and as usual any thx click.... and so on
Check out the OP for Download and details:
http://forum.xda-developers.com/showpost.php?p=55239027&postcount=1
UPDATE:
I have completely reworked the "Installation & Usage instructions" section in the OP. PLEASE READ and be happy
Click to expand...
Click to collapse
Great work.
Am looking at method two. If I was to install a ROM, wouldn't the boot partition (thus my new recovery) be overwritten by the ROM package's boot.img? And when I was cooking with the Kitchen, the ROM required a specific mount point for the boot partition. If it is supposed to point to recovery, seems to me that neither would boot (overwritten recovery, ROM pointing in the wrong location).
So, what is this solution getting around? So we have an option to load TWRP before a system we don't necessarily trust will boot? Thus avoiding the bootloader fallback even more? Or is it a broken boot.img breaks TWRP as well so even if we try to go in through the bootloader, TWRP fails to load as well?
Sorry for my confusion, still trying to grasp all this new information.
joel.maxuel said:
Great work.
Click to expand...
Click to collapse
Thanks
Am looking at method two. If I was to install a ROM, wouldn't the boot partition (thus my new recovery) be overwritten by the ROM package's boot.img?
Click to expand...
Click to collapse
Method 2 will suggest that if you install a custom ROM that you are be able to use/choose the boot.img partition (I hoped that the "hint" at the was clear enough but better to ask of course!)
And when I was cooking with the Kitchen, the ROM required a specific mount point for the boot partition. If it is supposed to point to recovery, seems to me that neither would boot (overwritten recovery, ROM pointing in the wrong location).
Click to expand...
Click to collapse
Well yes you either need to point to the recovery partition or (and that would be what I recommend) you let the user choose what he wanted to do.
So, what is this solution getting around?
Click to expand...
Click to collapse
The best we can do here (and that is what I will do for my custom ROM if I get it done some day) to use AROMA installer and ask the user if he has a recovery installed in the boot partition or not. Then you can choose what to do in the updater script.
I uploaded an example of my AROMA installation setup for the "sediROM for Samsung Captivate Glide" in this post. This one is VERY complex but you will get the idea and many input on how to do things.
So we have an option to load TWRP before a system we don't necessarily trust will boot? Thus avoiding the bootloader fallback even more?
Click to expand...
Click to collapse
Yes using method 2 we have always coming TWRP up when powering on the device. We then can choose to do things in there or to boot to "recovery" which will be the ROM. What do you meant with "bootloader fallback"?
Or is it a broken boot.img breaks TWRP as well so even if we try to go in through the bootloader, TWRP fails to load as well?
Click to expand...
Click to collapse
Not sure If I got you. When the boot partition gets overwritten TWRP and any possibility to get into TWRP will be lost because it sits only in the boot partition when using method 2. If you choose to do a factory reset when powering on the device or from within the ROM I have no idea what happens then unfortunately. That is untested but if you willing to test..
Sorry for my confusion, still trying to grasp all this new information.
Click to expand...
Click to collapse
No worry about that happy if that is useful for someone
xdajog said:
I uploaded an example of my AROMA installation setup for the "sediROM for Samsung Captivate Glide" in this post. This one is VERY complex but you will get the idea and many input on how to do things.
Click to expand...
Click to collapse
Thanks! I will take a look at this in the next few days.
xdajog said:
Yes using method 2 we have always coming TWRP up when powering on the device. We then can choose to do things in there or to boot to "recovery" which will be the ROM. What do you meant with "bootloader fallback"?
Click to expand...
Click to collapse
Bootloader fallback as in having to access TWRP via the bootloader. Our regular method is to access form the ROM, but if the ROM is bricked for whatever reason, the fallback is through the bootloader.
xdajog said:
Not sure If I got you. When the boot partition gets overwritten TWRP and any possibility to get into TWRP will be lost because it sits only in the boot partition when using method 2. If you choose to do a factory reset when powering on the device or from within the ROM I have no idea what happens then unfortunately. That is untested but if you willing to test..
Click to expand...
Click to collapse
I was alluding to the scenario if one was to choose method one, installed a ROM, and things got busted badly... Would you even be able to access TWRP with a bad boot partition? I think so, because recovery partition should be self sufficient (I think you proved it by swapping their places by way of method two), it is just getting into recovery by way of bootloader) I don't particularly like.
Had to face that fear last night, and ultimately, TWRP started up fast enough from the bootloader that it seemed like nothing happened, but when i went to dump the log, it could not recognize the sdcard. DD'ing my userdata partition back fixed that issue.
joel.maxuel said:
Bootloader fallback as in having to access TWRP via the bootloader. Our regular method is to access form the ROM, but if the ROM is bricked for whatever reason, the fallback is through the bootloader.
Click to expand...
Click to collapse
You mean "factory-reset" right? By either pressing the factory reset buttons (or by choosing from within the ROM) correct?
I was alluding to the scenario if one was to choose method one, installed a ROM, and things got busted badly... Would you even be able to access TWRP with a bad boot partition? I think so, because recovery partition should be self sufficient (I think you proved it by swapping their places by way of method two), it is just getting into recovery by way of bootloader) I don't particularly like.
Click to expand...
Click to collapse
If you install TWRP with method 1 and your boot partition gets corrupt you still be able to reach TWRP by using the factory-reset buttons. But you will loose /data then.
If you install TWRP with method 2 and your boot partition has gone you can not start TWRP anymore because it sits on there.
So you're more bulletproof by choosing method 1 because you would reach TWRP even when the boot partition gets damaged but you will loose /data then! Mentioned in the known issues in the OP.
Had to face that fear last night, and ultimately, TWRP started up fast enough from the bootloader that it seemed like nothing happened, but when i went to dump the log, it could not recognize the sdcard. DD'ing my userdata partition back fixed that issue.
Click to expand...
Click to collapse
When you have TWRP installed with method 1 you will reach TWRP by factory reset buttons and it will DO NOTHING ! Really! It simply starts TWRP because I patched TWRP that way that it will not wipe anything when triggered by the factory-reset command / button!
I can say that for double sure since today because:
1) In one of my tests I had disabled REALLY EVERY wipe option within TWRP - compiled it - installed it and even then /data gets lost!
2) I have installed the BOOT image means KERNEL on the RECOVERY partition today again and then used the factory-reset buttons again (after I restored /data of course)... and /data gets lost AGAIN--?!!
That means even when there is absolutely no custom recovery in place (like TWRP) which would normally handle wiping /data then nevertheless /data gets corrupted! I have tested that twice so I can say now for sure that this has nothing to do with TWRP but it comes from the LG bootloader instead! That bootloader is CRAP. sorry.
I had tested one approach which is build in boot image RAM disk which catches the keys which are pressed and then reboot into recovery. That would work but only as long as you have a working boot image partition. So that is the same good/bad as having TWRP sitting within the boot partition which is much easier to do so I decided to go this way for now.
One last word about the crappy factory-reset by LG: I have tried a lot to find out what really happens to the partition or partition table of /data when those keys are pressed but the only thing I can say is that the superblocks are inaccessible and the same for the backup superblocks. doing a "mke2fs -S" does not work (and wouldn't fix the root cause of the issue) and I have no idea what LG do here. Therefore cannot fix that ..
so I believe we will need to live with one of the 3 methods described in the OP....
Hope that answered some of your questions...
Bad news..
The Desire Z of my wife is completely broken now.
That means I cannot develop anymore..
- I ported and released the latest TWRP version to the F3Q
- I'm able to build AOSP JellyBean (not booting yet though),
- I compiled and released a custom AOSP Kernel (named sediKERNEL)
.... and a lot more..
I have everything I need to continue here in place...
I have the will and the ability to continue...
But no device anymore..
If someone has a F3Q to give away.. then I will continue but I'm not willing to buy a F3Q for developing only. So if you have an idea how we could continue let me know.
Update:
Check out the following link if you want to help http://forum.xda-developers.com/showthread.php?t=2952919
Otherwise that will end here for me unfortunately...
Hopefully not.
Yours
Xdajog.
-----
Sent from my SGH-I927 using XDA Android mobile app
I will update the installation instructions soon!
Because of the new sediKERNEL v2.0 the instructions will be made bullet proof only .. and i try to do it more detailed @Kediil
-----
Sent from my SGH-I927 using XDA Android mobile app

[GUIDE][XS/XSL]One time re-partitioning for Marshmelow ROM flashing

A Marshmellow based AOSP ROM was recently released by billchen1997. To flash it, re-partitioning of the partition table is required.To do so, following procedure can be used.
Note: This procedure doesn't work with nAOSP 6.0 ROM released by mickybart now, please find the appropriate instructions in ROM thread.
Do make a note of few things though:
Internal storage which can be accessed via PC by selecting "File transfer"option manually after connecting.
Recovery for Me was retained since I had flashed it in fota partition, hence I would recommend flashing recovery in fota partition before hand.
Performing them on PC would be convenient as some calculations are required.
Wiping all partitions before hand is recommended.
Text formatting conventions are used in the code sections to depict different meanings:
Bold : States the commands to be entered on adb.
Italic : States what values, usually which varies user to user, has to be entered at the place.
Underlined : States output shown by a certain command preceding it.
Repeated x/y/z are variables.
As pointed out by @GjorgiDxc, the phone is not directly encrypted. We need to encrypt it manually. To do so, flash only the ROM, without gapps or root, boot into ROM and encrypt the phone. More details can be found here. Encrypting data would make data partition inaccessible in TWRP.
Procedure:
Take backup of Your apps as well as the data from the internal storage (Photos, Music, Video etc) as it will all be wiped.
Boot into TWRP.
Goto mount option and untick all partitions.
On PC, using adb, type out the following commands,
Print the current partition table. Note down the starting cylinder of partition 14, It will be needed further.
Code:
[B]adb shell
fdisk /dev/block/mmcblk0
p[/B]
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now delete the sdcard(15) and data(14) partition.
Code:
[B]d
15
d
14[/B]
Create new data partition which uses remaining space.
Code:
[B]n[/B]
[U]First cylinder (xxx-yyyyyy, default xxx): [/U] [I]You have to enter the start cylinder of partition 14 as read in partition table earlier.[/I]
[U]Last cylinder or +size or +sizeM or +sizeK (zzzzz-yyyyyy, default yyyyyy):[/U] [I]Enter the yyyyyy value.[/I]
Print and write the modified partition table. Note down the "Blocks" value of partition 14 here.
Code:
[B]p
w[/B]
Code:
[U]Command (m for help): [/U][B]t[/B]
[U]Partition number (1-14): [/U][B]14[/B]
[U]Hex code (type L to list codes):[/U][B] 83[/B]
One of the two paths can be followed here now. It depends on which filesystem is required for data partition, ext4 or f2fs. For ext4, follow the first subsection and for f2fs, second one.
Now the calculation needs to be done for ext4 file system. From the "Blocks" value of partition 14, subtract 16, since we have to leave 16384 bytes and each block equals 1024 bytes (16*1024=16384).
For Me, the "Blocks" value of partition 14 was 29161464. Hence, my final value was 29161464-16=29161448. Now divide the solution by 4.
Therefore, 29145080/4=7290362. Consider it as final_size. This many blocks will be allocated for the data partition. This needs to be done since the partition needs to be made using blocks size.
Now we format the data partition such that it acquires the space and as well as leaves the trailing 16384 bytes. This creates a data partition with ext4 type, allocation unit as 4096 and size in blocks as final_size.
Code:
[B]mke2fs -t ext4 -b 4096 /dev/block/mmcblk0p14[/B] [I]final_size[/I]
For f2fs file system, simply run the following command, no need of any calculation:
Code:
[B]mkfs.f2fs -r 16384 /dev/block/mmcblk0p14[/B]
Code:
[B]exit
adb push -p pure_aosp_marshmallow_r1.zip /tmp/[/B]
Now on phone, in TWRP, Flash the ROM via install option, and done!
Notes:
First Reboot is long.
If after boot it says encryption failed, let it reset the phone. Then it will work properly.
For root, flashing Update zip of SuperSU from here works.
Wiping data via TWRP menu will allocate the trailing 16384 bytes to it too, so it is not to be done.
For gapps, flash Pico gapps from here. Then after reboot and login, go to Settings, Apps>Settings icon at top right> App permissions. Now in each permission, open the permission, select show system from options and enable the permission for all system apps.
If You get error like "Error retrieving information from sever.[RPC:C:S-7:AEC-7 CDY7-E3OJ-V2TKC]" in Google Play Store and are not able to install any app, then log out and log in again into Your google account via settings.
If You copy a file and want to access it via TWRP, mount data partition and go to /data/media. Although data won't mount if You encrypt Your phone.
Credits to @SystemR89 for his tutorial as base and billchen1997, @mickybart for his instructions and TWRP.
Calculations are not needed now since micybart has modified the TWRP to leave trailing 16384 bytes at end. The TWRP can be found here.
Thanks for your guide friend. What is difference between this method and your previous method http://forum.xda-developers.com/showthread.php?p=64433804 ? I think your previous method is easier and it's not confusing.
BTW I wiped /data in twrp and I don't have any problem
@Mirhawk so what are you saying Friend? What will be the difference we get than your instruction.will it solve my battery not charching problem.?actually I used mickybarts recovery last time.so was that OK or I have to flash the official twrp to do the job
pejman97 said:
Thanks for your guide friend. What is difference between this method and your previous method http://forum.xda-developers.com/showthread.php?p=64433804 ? I think your previous method is easier and it's not confusing.
BTW I wiped /data in twrp and I don't have any problem
Click to expand...
Click to collapse
The earlier one allocated less space for user. Yeah, I agree, this one is a bit more complicated than previous one, but it is as per some of the instructions provided by billchen1997. Wiping /data with previous process works, but as it wouldn't with this process. I will have to test that if it will work.
nageswarswain said:
@Mirhawk so what are you saying Friend? What will be the difference we get than your instruction.will it solve my battery not charching problem.?actually I used mickybarts recovery last time.so was that OK or I have to flash the official twrp to do the job
Click to expand...
Click to collapse
As said above, it will allocate more usable space for user. Well, modifying of partition should not affect Your offline charging. I used the TWRP by SdtBarbarossa, if it makes any difference.
Why were you saying storage is not accessable via PC? Internal storage shows up fine for me via PC. The only issue I have is with recovery, but there should be a fix to the recovery by mickybart (he is maintaining TWRP) to recognize the new repartitioning, so I can live with that.
GjorgiDxc said:
Why were you saying storage is not accessable via PC? Internal storage shows up fine for me via PC. The only issue I have is with recovery, but there should be a fix to the recovery by mickybart (he is maintaining TWRP) to recognize the new repartitioning, so I can live with that.
Click to expand...
Click to collapse
You are able to save in internal storage using PC? And if You save a file, does it show up in /storage/emulated/0?
All I get is blank window when I open "Xperia S" icon in windows explorer.
Never mind, forgot to select the option for file transfer. Will update that now.
Mirhawk said:
You are able to save in internal storage using PC? And if You save a file, does it show up in /storage/emulated/0?
All I get is blank window when I open "Xperia S" icon in windows explorer.
Click to expand...
Click to collapse
Yes I can. I think after creating partiton14 you should type
t
14
c
I think I did that, but anyway yes i can see the whole 27GB of storage on the computer, and thats how i flash gapps. I flash rom via /tmp and gapps after it boots up. Also maybe you've missed this, but you have to toggle "File tranfer" in the notification shade, the default is "Charging cable" and it doesn't display the internal storage. Pull down notifications, tap on the one bellow USB debugging and select the second option. I'll post some screenshots maybe later, I'm doing some battery testing atm.
GjorgiDxc said:
Yes I can. I think after creating partiton14 you should type
t
14
c
I think I did that, but anyway yes i can see the whole 27GB of storage on the computer, and thats how i flash gapps. I flash rom via /tmp and gapps after it boots up. Also maybe you've missed this, but you have to toggle "File tranfer" in the notification shade, the default is "Charging cable" and it doesn't display the internal storage. Pull down notifications, tap on the one bellow USB debugging and select the second option. I'll post some screenshots maybe later, I'm doing some battery testing atm.
Click to expand...
Click to collapse
Yeah, thanks, the notification doesn't show up on lock screen.
I don't think there is any need to type "c" after creating partition, since it converts the partition to fat32 and it is not needed here.
Mirhawk said:
Yeah, thanks, the notification doesn't show up on lock screen.
I don't think there is any need to type "c" after creating partition, since it converts the partition to fat32 and it is not needed here.
Click to expand...
Click to collapse
I never knew that, still no issues with doing that
So you've missed the notification? You're able to see storage now right?
@Mirhawk try this if it works.connect device to PC.then select file transfer.then goto settings developer option and turn off the USB debugging.it worked for me
Mirhawk said:
You are able to save in internal storage using PC? And if You save a file, does it show up in /storage/emulated/0?
All I get is blank window when I open "Xperia S" icon in windows explorer.
Never mind, forgot to select the option for file transfer. Will update that now.
Click to expand...
Click to collapse
I'm able to access all 27GB in my device and PC. I did everything exactly like you instruction http://forum.xda-developers.com/showpost.php?p=64433804&postcount=1487 till item 4, then I went to wipe menu in twrp and ticked /data partition then pressed on "Repair or change file system" then pressed on resize, then it changed and shows all 27GB then I choose EXT4 then wiped all partitions on my device by twrp, then I did rest of your instruction
Screenshots
 @Mirhawk
GjorgiDxc said:
I never knew that, still no issues with doing that
So you've missed the notification? You're able to see storage now right?
Click to expand...
Click to collapse
nageswarswain said:
@Mirhawk try this if it works.connect device to PC.then select file transfer.then goto settings developer option and turn off the USB debugging.it worked for me
Click to expand...
Click to collapse
Yup, it works for Me, just had to unlock the screen to get notification.
pejman97 said:
I'm able to access all 27GB in my device and PC. I did everything exactly like you instruction http://forum.xda-developers.com/showpost.php?p=64433804&postcount=1487 till item 4, then I went to wipe menu in twrp and ticked /data partition then pressed on "Repair or change file system" then pressed on resize, then it changed and shows all 27GB then I choose EXT4 then wiped all partitions on my device by twrp, then I did rest of your instruction
Click to expand...
Click to collapse
Yeah, it would work that way since the 16384 bytes are left outside the data partition end border in the older procedure. Here, we leave the 16384 bytes inside the end boundary of the data partition. My screenshots after following this procedure with size are attached.
Mirhawk said:
Yup, it works for Me, just had to unlock the screen to get notification.
Yeah, it would work that way since the 16384 bytes are left outside the data partition end border in the older procedure. Here, we leave the 16384 bytes inside the end boundary of the data partition. My screenshots after following this procedure with size are attached.
Click to expand...
Click to collapse
We both did the same but why I lost about 1GB rather than you?
pejman97 said:
We both did the same but why I lost about 1GB rather than you?
Click to expand...
Click to collapse
In the previous method, more than 16384 bytes are left out. There 16384 cylinders*bytes_per_cylinder are left out. Hence there is a difference in size.
Mirhawk said:
In the previous method, more than 16384 bytes are left out. There 16384 cylinders*bytes_per_cylinder are left out. Hence there is a difference in size.
Click to expand...
Click to collapse
Thanks for your instructions it's clear at the the beginning. Now there is no way to use old p15 in this rom until doing like this to use all storage size. That's clear now. So, can I leave about 1G as mmcblk0p15 with vfat system just to flash an update and gapps in the future? Cause all data partition will be wiped if we reset the device.
Can anyone help me? When I try adb in PC, i receive this message: device not found.
I have the phone with TWRP and connected by Usb to the PC.
In the past, i increased the partition for lollipop without problems.
What am i doing bad??
Update:
If I connect the phone with lollipop instead TWRP i can access to the phone without problems. Adb found my de vice attached.
hi, thanks for the detailed instructions. is there any way (command) fo format as f2fs instead of ext4?
jgilalonso666 said:
Can anyone help me? When I try adb in PC, i receive this message: device not found.
I have the phone with TWRP and connected by Usb to the PC.
In the past, i increased the partition for lollipop without problems.
What am i doing bad??
Click to expand...
Click to collapse
Just connect your device to PC and open command. Write (adb devices) if the device doesn't detect while youre device is connected to PC go to advance menu in twrp and open side load and swipe then press cancel then your device should be detected by this command (adb devices)
Ok. I'm gonna try. Thanks

TOLTESPR / SM-N910P hard brick trials and solution (mmc_read failed)

Greets all,
Apologies in advance for the longer post.
TLDR: Writing the debrick-n910p.img image to SDcard using Windows (10 x86_64) for me caused my hard bricked SM-N910P / Sprint Samsung Galaxy Note 4 to endlessly boot-loop (displaying BOOT RECOVERY MODE / CHECK BOOT PARTITIONS.. / COPY FROM T-FLASH.. / BOOT RECOVERY / WRITE 188416 sectors / REBOOT). I found my solution for this issue to be that as long as I wrote the debrick-n910p.img image in Windows (10 x86_64), then booted into Linux and wiped the GPT data structures on the SDcard only to convert the SDcard to basic MBR (+DOS compatible flag), then created & formatted a single 32GB partition as FAT32, then and only then, write the debrick-n910p.img image file to the SDcard in this way, I was able to save my hard-bricked phone flawlessly!
I ran into the "mmc_read failed" issue that many posters to this site have experienced. I wanted to add the solution that worked for me along with the issues I ran into, as a reference for myself if I ever need it again in the future, and to pass on the information in the event others may find it helpful.
In all my trials and research I never found a point-by-point / exact instructions for the SM-N910P / Sprint Samsung Galaxy Note 4, nor anyone running into the same issue(s) that I did. that's what this post is => links to others solutions, my experience, and my solution for a hard-bricked SM-N910P / Sprint Samsung Galaxy Note 4.
SCENARIO: After ~6months of owning my phone I bought from craigslist it started experiencing random lagging, then random reboots, and ultimately the phone failed to boot into the OS one day. So I booted up TWRP, did a full-wipe and fresh OS load. after the OS flash (like I've done a million times, nothing different/strange) the device was set to reboot, then the screen went dark, and never came back on. just poof. it would flat-out not boot again; no LED during charging, nothing would happen when attempting to power on the phone, or any attempt to try booting recovery (Home+Vol-Up+Power) or to Odin/Kies download-mode (Home+Vol-Down+Power). To me the phone was dead, I considered it the "true brick". Yet, I wondered at the most curious thing that would happen when I connected the phone to my computer via the microUSB cable without the battery; I would hear the "new device attached" Windows chime, and Device Manager would list a new "Qualcomm HS-USB QDLoader 9008" device. otherwise, the phone remained dark, and completely void of any life.
At this point I started researching to purchase a replacement cellphone when a website caught my eye with the title "Qualcomm Snapdragon Unbrick Guide, Snapdragon’s are UNBRICKABLE".
I skimmed over the text, and began thinking it possible to revive my (broken?) phone - I just desired a straight-forward HOWTO describing the procedure how I could resurrect my phone, and I figured I would be on my way.
In the end, I found some promising posts, and the very SM-N910P debrick image itself (see below for links), but never found a step-by-step for my exact model of phone.
N910P Debrick Image + Useful Links
Mega Link to the N910P debrick image (128MB)
Samsung N910P Galaxy Note 4 Sprint USA Repair Firmware (N910PVPU4COG5_SPT4COG5_Sprint_USA_v5.1.1_Repair_Firmware.zip)
Win32DiskImager (Project Homepage) (v0.9 binary)
dd for windows
Galaxy Note 4 Unbrick/Debrick.img for N910G/F/T/W8 [unbrick] [unbrick image]
[*]- Inside, a reference For N910P refer this thread​
Galaxy Note 4 N910T FIXED HARD BRICKED
SM-N910P (US-Sprint) debrick.img
All instructions seemed to state I needed a 16GB or larger SDcard, so I went out and purchased a brand new 128GB MicroSDXC card, specifically Samsung MicroSDXC EVO Memory Card w/ Adapter 128GB (2017 Model) - Model: MB-MP128G / Model Code: MB-MP128GA/AM
The gist of all the reports on how to fix my issue was to write the N910P debrick image to a micro SDcard and magically the phone would come back to life. And so, I did just that. In my case using Windows 10 x86_64 - using the suggested applications to write the image to the SDcard: Win32DiskImager and/or dd for windows, then popping the SDcard into the "dead" phone, attaching the battery to the phone and pushing power - or one of the 3 finger salutes (recovery/download-mode) - then the magic would happen, the screen would show the following text:
Code:
BOOT RECOVERY MODE
CHECK BOOT PARTITIONS..
COPY FROM T-FLASH..
BOOT RECOVERY
WRITE 188416 sectors
REBOOT
But, unfortunately for me, that is all it would do, I would keep seeing that text over and over... If I let the "COPY FROM T-FLASH.." appear then press one of the 3 finger salutes (recovery -or- download-mode), the phone would just reboot before it displayed the rest, and continue back in it's loop:
Code:
BOOT RECOVERY MODE
CHECK BOOT PARTITIONS..
COPY FROM T-FLASH..
BOOT RECOVERY
WRITE 188416 sectors
REBOOT
This just kept occurring over, and over with infinite reboots. Yet, ALL the documentation said it would ultimately boot into download-mode, I just had to "put it in the freezer to let the phone cool" (never mind that the phone wasn't hot AT ALL) for an hour or something similar?? All my searching found nobody else with this issue (at least no one reporting it). So I am reporting it and also reporting how I fixed my sorry state of affairs.
As I noted above, I was using Windows 10 x86_64 as the OS and Win32DiskImager, as well as dd for windows, to write the debrick image to the SDcard up to this point. This was my process:
:: Windows 10 ::
place SDCARD in drive
format the SDCARD (drive d:/f:, whichever) through Windows Explorer (explorer.exe) via RIGHT-CLICK on drive -> Format ...
capacity 119GB / Filesystem: exFAT / Allocation Size: drop-down = Default Allocatio-- n Size
CHECK Quick Format
click Start button
click OK
click OK when finished
click Close button
in Windows Explorer (explorer.exe), RIGHT-CLICK on SDCARD drive -> Eject
eject SDCARD from computer
- EITHER Win32DiskImager OR dd for windows, only do 1.
:: Win32DiskImager ::
run Win32DiskImager as Administrator
DEVICE = drive of the SDCARD (D:/F:, whichever)
IMAGE FILE = click FOLDER icon, select "debrick-n910p.img"
click WRITE button
click OK
at Write Successful = click OK
more then likely (win10) a ****-ton of Explorer screens pop up, with errors like "You need to format the disk in Drive ? before you can use it" pops up
IGNORE ALL THIS, ALT-F4 to close ALL the pop-ups and errors
OR just REBOOT, as at this point we are done
Shutdown Windows (10) -> REBOOT
:: dd for windows ::
open "cmd" as Administrator
dd --list
dd if=debrick-n910p.img of=\\.\Volume{3fde94fa-d22d-11e7-b791-806e6f6e6963} bs=1M
Once the debrick-n910p.img file is finished being written to the SDcard, 27 partitions (what appears to be mostly duplicate) will show up and all drive letters will get filled, being displayed as mostly unreadable, that is just the nature of what the debrick image is.
My Solution to this situation was as follows:
:: LINUX ::
boot linux from USB -or- CD (I booted a handy USB stick with Qubes OS v4-rc3, choose Troubleshooting -> Rescue a Qubes System)
upon boot, choose "3" to be dropped to shell
mount windows folder that holds the debrick N910P image = mount /dev/sda2 /mnt/sysimage
place SDCARD in drive
fdisk -l << make sure your SDcard shows up (/dev/mmcblk0) is there
cgdisk /dev/mmcblk0
delete ALL paritions (using "d" on each highlighted partition)
"New"
Fist sector = hit ENTER (choose default = 2048 for me)
Size in sectors = 32G
Hex code = 0700 (Microsoft basic data)
Partition name = hit ENTER
"Write"
type "yes"
"Quit"
gdisk /dev/mmcblk0
should display = "Found valid GPT with protective MBR; using GPT"
"x" (extra functionality (experts only))
"z" (zap (destroy) GPT data structures and exit)
"Y" (Yes to continue)
"N" (blank out MBR)
fdisk /dev/mmcblk0
"p" (print parition table)
"c" (toggle dos compatibility flag)
should show DOS COMPATABILITY FLAG SET (DEPRICATED)
"d" (delete partition)
MAKE SURE NO PARTITIONS EXIST!
"n" (new partition)
"p" (primary)
hit ENTER (default = "1")
hit ENTER (first sector, my default was 63)
"+32G" (last sector, this creates 32GB partition)
"a" (toggle bootable flag, should show "the bootable flag on partition 1 is enabled now")
"t" (partition type)
"c" (W95 FAT32 (LBA))
"w" (write table to disk and exit)
Format the new partition, FAT32
mkfs.fat -F 32 /dev/mmcblk0p1
Goto the folder containing the debrick N910P image
cd /mnt/sysimage/Users/$USER/Downloads/SM-N910P-trltespr
dd if=debrick-n910p.img of=/dev/mmcblk0 bs=1M
sync
Eject sdcard and place in your Note 4 phone
This time, when I put the battery in the phone, I got the same text as before:
Code:
BOOT RECOVERY MODE
CHECK BOOT PARTITIONS..
COPY FROM T-FLASH..
BOOT RECOVERY
WRITE 188416 sectors
REBOOT
And then, it did a REAL reboot, and went directly to download-mode!
I tested this multiple times - as long as I wrote the debrick image in Win10, and then erased the SDcard and formatted it as Fat32 without using GPT just a basic MBR, and wrote the debrick image that way in linux it worked flawlessly!
let it boot, then do it's reboot
should be able to go into RECOVERY = Home+Vol-Down+Power !!!
:: Boot Windows ::
unzip "N910PVPU4COG5_SPT4COG5_Sprint_USA_v5.1.1_Repair_Firmware.zip"
run Odin3 3.09
click PIT button -> select "TRLTE_USA_SPR.pit" -> click OPEN
click AP button -> select "ALL_SPT_N910PVPU4COG5_N910PSPT4COG5_CL5303209_QB5691107_REV00_user_low_ship_MULTI_CERT.tar.md5" -> click OPEN
phone should be in DOWNLOAD mode (home+vol-down+power -> UP to continue) and connected via microUSB, Odin3 should be detecting it with a BLUE ID:COM lit up on top-left
click START button in Odin3
when finished it will reboot, and all should be well
- One last note, about the "mmc read fail" error, I took this gentleman's advice:
As a side note....
IF YOU HAVE THE MMC READ FAIL MESSAGE!!!
Which consists of Random Reboots, Heating Issues when theirs hardly no apps on, or even Lag or Glitchyness.
The Temp FiX that I've been using everyday and haven't had these issues since was downloading this app
WakeLock Manager and setting to PARTIAL LOCK! on Level 4.
Click to expand...
Click to collapse
And am currently running Wake Lock - PowerManager from Google Play as suggested, just to be safe - and so far, I have not YET had to deal with that horrid business again (so far, fingers crossed).
And there ye have it, that is my story, my tribulations, and my fix. Thank you to all who came before me, and for everyone's good advice = Good luck to all, and have a great rest of 2017.
XORr0 said:
[*]mount windows folder that holds the debrick N910P image = mount /dev/sda2 /mnt/sysimage
Click to expand...
Click to collapse
Hi man, thank you for the post, but can´t mount the sysimage
Help me please!!!
Mega Link a la imagen de debrick N910P ( 128MB )
the files are not there if it is not too much trouble to provide me with the: confusing files: confusing

[GUIDE/TUTORIAL/HOWTO] Sony Xperia S stock to Android 8.1 Oreo

[GUIDE/TUTORIAL/HOWTO] Sony Xperia S stock to Android 8.1 Oreo
[GUIDE/TUTORIAL/HOWTO] Upgrade Sony Xperia S (Model LT26i codename nozomi) from Android 2.3.7 to Android 8.1 Oreo / nAOSP Rom
This detailed step-by-step guide helps you transform your Sony Xperia S to a much fresher one with Android 8.1 Oreo.
To make sure you are with a compatible Xperia S:
On the smartphone, go to Settings > About phone. Check that "Model number" is correct: LT26i.
### We need to make sure Bootloader can be unlocked before going further.
Open dialer, enter code
Code:
*#*#7378423#*#*
In the follow menu, go to Service info > Configuration > Rooting status.
Bootloader unlock allowed: Yes
If it is set on No, you cannot update your device. You can quit this tutorial and cry, you will never unlock it.
### You must be logged as a Microsoft Windows administrator to run console commands below.
CHANGELOG
v4. Moved to Bitgapps to solve infinite GApps "searching for updates", TWRP 3.5.2_9-0
v3. Android 7.1 if needed, hints to solve problems (error 7, fdisk -l)
v2. Slight tutorial improvements
v1. Initial release
1) DOWNLOAD FILES
- djibe Xperia S pack: https://bit.ly/djibe-xperias-pack
(contains FlashTool Xperia Driver Pack 1.8 for USB drivers + fastboot/adb + recovery TWRP 3.5.2_9-0)
+ ROM nearAOSP 8.1 build 11: https://forum.xda-developers.com/t/rom-8-1-naosprom-for-xperia-s-acro-s.3853082/
Download latest build (2020/03 or newer): https://androidfilehost.com/?w=files&flid=240525&sort_by=date&sort_dir=DESC
+ BitGApps Package ARM 8.1: https://github.com/BiTGApps/BiTGApps-Release/releases
+ You find Android 8.1 laggy ? Android 7.1.2/nAOSP is suitable https://androidfilehost.com/?fid=890129502657590583
Download according BitGApps.
+ Charge phone to 100%.
NB. Use a USB2 port to connect tablet to PC.
2) INSTALL USB DRIVERS
Commands below are for Windows 10 installation of unsigned drivers.
### For other Windows versions, Google "windows X install unsigned driver".
On the keyboard of PC, use "Windows key + R" combo.
In the command prompt that opens, type:
Code:
shutdown -r -t 0 -o
This opens a Windows menu:
Go to Troubleshooting > Advanced Options > Settings > Restart
Upon restart, press on keyboard : key 7 - Disables drivers signature verification
After boot,
Start Flashtool Xperia Driver Pack 1.8,
check the Flashmode Drivers, Fastboot drivers, Common drivers Fuji board (both lines) and Xperia S driver for ICS.
Start the installation and confirm the forcing the driver installation.
It ends by saying that everything was installed.
Restart Windows.
3) BACKUP ALL YOUR DATA
Backup every SMS, photo, app login or sync everything in the cloud.
You will lose everything, including what is contained in the microSD card during bootloader unlock.
So backup everything and transfer every file to your computer.
### Do it now or you will regret it.
4) IMEI NUMBER AND UPDATES
On phone, go to Settings > About phone > Status > IMEI
Note the IMEI (15 digits). Store it.
5) MAKE SURE PHONE IS NOT SIMLOCKED
We need to check phone is not SIMlocked.
Open dialer, enter code again
Code:
*#*#7378423#*#*
Go to Service info > SIM lock. If everything is blank/unchecked ( [] ), phone is Desimlocked.
If not, you must contact your network provider for an unlock code.
### Don't move further until phone is simlocked. You cannot debrand/desimlock it using a custom ROM.
6) GENERATE BOOTLOADER UNLOCK CODE
From your PC, go to https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/
At the bottom of the page, in "Select your device:" menu: select Xperia S.
Enter your IMEI, check first 2 checkboxes "I acknowledge that", click Submit and complete the captcha to generate unlock key.
Note the unlock code (beginning and end of page paragraph C.)
7) CONNECT PHONE IN FASTBOOT MODE
Phone powered off, hold "Volume up" while you plug phone in USB.
The blue light appears at the front bottom edge, the drivers install in Windows.
8) UNLOCK BOOTLOADER
In Windows, copy the path to the "flash" folder you unziped earlier.
Open a Windows command prompt : Start menu > Command prompt > Start as administrator
Then type
Code:
cd /d thePathToFlashFolder
(ex: E:\root\djibe Sony Xperia S\djibe\flash)
Type:
Code:
fastboot devices
If "PSDN:..." is returned, drivers are correctly installed.
Create this text: fastboot -i 0x0fce oem unlock 0xAPPENDYOURUNLOCKCODEAFTER0x
Paste the previous line in windows command:
Code:
fastboot -i 0x0fce oem unlock 0xAPPENDYOURUNLOCKCODEAFTER0x
confirm with Enter.
After 5 seconds, it is displayed Finished. Total time: ...
Bootloader is unlocked !
9) FLASH TWRP RECOVERY 3.5
Still in fastboot, type in console :
Code:
fastboot flash boot twrp-3.5.2_9-0-nozomi.img
. Confirm with Enter.
Wait, then once the confirmed success,
type :
Code:
fastboot reboot
(confirm with Enter).
Be fast to disconnect phone AND while it restarts, repeatedly click Volume+ AND Volume- buttons to access the recovery (can take a while).
Reconnect phone to PC once recovery has started.
10) BACKUP ORIGINAL ROM AND USE TWRP RECOVERY
You are now in TWRP recovery,
check Never show this screen during boot again and Swipe to Allow modifications.
Go to Backup, select all partitions.
Confirm with OK.
Then swipe to start backup.
Click the TWRP icon to return to home.
Go to Mount. Select Data partition and make sure bottom right button is dsiplaying Disable MTP text.
Phone must be connected to computer.
In Windows Explorer, open Xperia S device > Internal Storage.
Copy whole TWRP folder and save it somewhere safe on your PC.
In the opposite way, copy twrp.img and paste it in the same phone's folder you grabbed TWRP folder (SDcard root folder).
11) FLASH A PERMANENT TWRP RECOVERY
The TWRP recovery you are using is temporary.
We need to flash it on a partition.
Back to TWRP Home screen > Install > Install Image button > twrp.img > Select boot partition > Swipe to flash.
12) REPARTITION INTERNAL MEMORY
Newer Android versions changed the partition layout. We have to do so.
Back to TWRP Home screen > Mount.
Deselect ALL partitions.
You can copy-paste commands with right click in the Windows command.
From Windows command, type following commands:
Code:
adb devices
Command returns: List of devices attached
CB511Z8FWJ recovery
Code:
adb shell
Code:
fdisk -l /dev/block/mmcblk0
### fdisk -l (this is letter L, not number 1)
Command returns
Code:
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 954240 27064320 c Win95 FAT32 (LBA)
~ #
### Copy all the text of the partition layout to be able to reformat in case of a crash.
### Paste this text in a file somewhere safe on your PC.
We are interested by line /dev/block/mmcblk0p14, Start sector: 42945 in my case,
And /dev/block/mmcblk0p15 End sector: 954240 for me.
### These values may differ for you. USE YOUR OWN VALUES.
Now type
Code:
fdisk /dev/block/mmcblk0
Commands returns: Command (m for help):
Enter
Code:
p
Commands returns: Command (m for help):
Enter
Code:
d
Command returns: Partition number (1-15):
Enter
Code:
15
Commands returns Command (m for help):
Enter
Code:
d
Command returns: Partition number (1-15):
Enter
Code:
14
Commands returns: Command (m for help):
Enter
Code:
n
Command returns: First cylinder (769-954240, default 769):
Enter
Code:
42945
(Your /dev/block/mmcblk0p14 Start sector)
Command returns: Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
If "default 954240" is the same as your /dev/block/mmcblk0p15 End sector, just press Enter.
Commands returns: Command (m for help):
Enter
Code:
t
Command returns: Partition number (1-14):
Enter
Code:
14
Command returns: Hex code (type L to list codes):
Enter
Code:
83
Commands returns: Command (m for help):
Enter
Code:
w
And let command return to its waiting state: ~ #
We must restart phone now, unplug USB and from TWRP go to Reboot > Recovery for a refresh of partition table.
### Your TWRP recovery is not compatible with new partition layout.
13) FORMAT PARTITIONS TO F2FS
nAOSP Rom doesn't support EXT4 filesystem. We need to repartition to F2FS, easily with TWRP.
### If you experience errors while flashing like "Unable to mount storage", use TWRP 3.2.3 instead: https://androidfilehost.com/?fid=1322778262904003720
Check Never show this screen during boot again and Swipe to Allow modifications.
Back to TWRP Home menu.
Go to Wipe > Wipe Advanced > Select Data > Repair or Change File System > Change File System > F2FS.
Repeat same procedure for Cache partition.
We must restart phone now, go to Reboot > Recovery for a refresh of partition table.
### If you don't, you won't be able to flash zipfiles.
After reboot, Swipe to Allow modifications.
### If you still see 0MB or a wrong size for data after the reboot, try to format data (Wipe/Format Data).
### In the worst case, convert data to ext4 and convert back to f2fs will do the job.
### You get ERROR 7, Failed to mount '/system' etc.), try this fix: https://bit.ly/3BvcYvM
### Failed to mount '/system' error: https://bit.ly/3yF2jwX
14) PUSH ROM AND GOOGLE APPS
Go to Mount > make sure nothing is mounted.
Connect phone to PC with USB.
Copy downloaded ROM and Google Apps to your /flash folder (along adb.exe and twrp.img).
Rename bitgapps*.zip to gapps.zip
Make sure adb is still running with 'adb devices' command.
Now push the ROM to the phone with
Code:
adb push nAOSProm-8.1.0-b11-nozomi.zip /sideload
Then
Code:
adb push gapps.zip /sideload
15) INSTALL ROM AND GOOGLE APPS
Go back to TWRP Home menu.
Go to Install > You are in /sdcard empty folder.
Tap on (Up a level) > sideload.
Select nAOSProm > Swipe to flash.
Wait during "Install Zip".
Then Reboot > Recovery
Go back to Install > select bitgapps*.zip > Swipe to flash.
## Problems flashing? Use TWRP 3.2.3-0: https://eu.dl.twrp.me/nozomi/twrp-3.2.3-0-nozomi.img.html
At the end, tap on Wipe Cache/Dalvik and Swipe to wipe.
Then tap on Reboot system.
Wait during long first boot.
Enjoy your new phone.
16) BETTER PERFORMANCES
Go to Settings > About phone.
Tap 7 times on Build number.
Go to Settings > System > Developer options.
Set Windows animation scale, Transition animation scale and Animator duration scale to 0.25x.
Right below, you may try to switch Force GPU rendering On (default is off but feels slower, isn't it ?)
17) ROOT
nAOSProm has a built-in root.
No extra Root manipulation needed.
### DO NOT TRY MAGISK, you will have problems.
### If you run in troubles with Magisk, see the end of this tutorial.
Configure Android as you like.
For faster GPS fix, use GPS Status and Toolbox and download A-GPS data.
You may try Greenify app to improve battery.
Your phone is up to date, enjoy ;-)
Thanks: @millosr, @mickybart, @AdrianDC, TWRP team, OpenGApps team, Flashtool Xperia Driver pack team
-----------------------------------------------------------------------
### Android doesn't see Wifi channel 14 (or 13),
Your phone doesn't see your local Wifi network?
You are probably european and your wifi is set to channel >= 11.
Reboot to TWRP recovery.
Go to Mount > check System partition.
Open a Windows command like before:
Code:
adb pull /system/build.prop
Edit file with Notepad++ freeware.
Locate line: ro.wifi.channels=
Change it to: ro.wifi.channels=14
Add this line just below: ro.boot.wificountrycode=EU
Save file.
Send modified file to phone:
Code:
adb push build.prop /system/
Disconnect phone, go to Reboot > System.
-------------------------------------------------------------------------
### Tried Magisk and it doesn't work ? (we know it doesn't)
You can't access recovery because phone restarts as soon as it reboots.
Let battery drain by bootloop.
When it is exhausted, hold Volume+ and connect phone tu USB, blue light will appear (fastboot mode).
Unzip boot.img from nAOSProm-8.1.0-b11-nozomi.zip to /flash folder (along fastboot.exe).
Make sure fastboot is OK with
Code:
fastboot devices
Then
Code:
fastboot flash boot boot.img
And restart with
Code:
fastboot reboot
Phone is op.
Enjoy
Thank you very much for this detailed guide. I have two questions:
1) Why do you recommend to flash version 2.3.7 of Android before beginning this procedure?
2) Everytime I have Flashed nAOSProm-8.1.0-b11-nozomi.zip on my phone (folllowing the original guide), I've had a very annoying bug, which is that it's really difficult to answer a phone call (I have to swipe the phone icon up several times until it finally rsponds). Of course I have always made a totally clean flash of the rom. Do you know what the reason for this can be?
TXUTXI72 said:
Thank you very much for this detailed guide. I have two questions:
1) Why do you recommend to flash version 2.3.7 of Android before beginning this procedure?
2) Everytime I have Flashed nAOSProm-8.1.0-b11-nozomi.zip on my phone (folllowing the original guide), I've had a very annoying bug, which is that it's really difficult to answer a phone call (I have to swipe the phone icon up several times until it finally rsponds). Of course I have always made a totally clean flash of the rom. Do you know what the reason for this can be?
Click to expand...
Click to collapse
Hi,
1) By precaution. For some phones you have to flash latest firmwares which upgrade bootloaders. We never know and there is no information about this. Just precaution.
2) I will test it.
Have you tried another call app ? That's the benefit of Android.
djibe89 said:
Hi,
1) By precaution. For some phones you have to flash latest firmwares which upgrade bootloaders. We never know and there is no information about this. Just precaution.
2) I will test it.
Have you tried another call app ? That's the benefit of Android.
Click to expand...
Click to collapse
Hi again! Thanks for answering.
First of all, 2.3.7 was not the last firmware for Sony xperia s, but the first one. The last one was Jelly Bean (4.1.2, or something like that, as far as I remember). So I am confused by your answer.
Secondly, yesterday I flashed again nAOSProm-8.1.0-b11-nozomi.zip, and this time I didn't get that annoying bug related to the phone app. Why? Well, there are two possible reasons:
1) This time I Flashed TWRP the way you tell in your guide. I used to do it via Flashtool.
2) I have used Nano Gapps instead of Pico Gapps.
Another thing I would like to tell you, is that yesterday it was impossible for me to flash the rom with the official TWRP (the one you recommend). I had to use TWRP 3.2.3, the version the developer of this rom recommends. It is something I don't understand: Why does the official TWRP work for you, while it doesn't for me?
Thank you very much again for all your help. I am pretty much interested in bringing to life again this old phone. What I really like about Xperia S is its small size
Now I am going to try to flash the rom again, because, although it works correctly, I cannot reboot into recovery
Cheers!
TXUTXI72 said:
Hi again! Thanks for answering.
First of all, 2.3.7 was not the last firmware for Sony xperia s, but the first one. The last one was Jelly Bean (4.1.2, or something like that, as far as I remember). So I am confused by your answer.
Secondly, yesterday I flashed again nAOSProm-8.1.0-b11-nozomi.zip, and this time I didn't get that annoying bug related to the phone app. Why? Well, there are two possible reasons:
1) This time I Flashed TWRP the way you tell in your guide. I used to do it via Flashtool.
2) I have used Nano Gapps instead Pico Gapps.
Another thing I would like to tell you, is that yesterday it was impossible for me to flash the rom with the official TWRP (the one you recommend). I had to use TWRP 3.2.3, the version the developer of this rom recommends. It is something I don't understand: Why does the official TWRP work for you, while it doesn't for me?
Thank you very much again for all your help. I am pretty much interested in bringing to life again this old phone. What I really like about Xperia S is its small size
Now I am going to try to flash the rom again, because, although it works correctly, I cannot reboot into recovery
Cheers!
Click to expand...
Click to collapse
Hi,
Sorry for my late replay.
Sorry for the 2.3.7 version. When i tried to force updates nothing came out so I thought it was the last one. I will remove comments on version.
For the Recovery, everything went fin with latest version. However, with 3.4+ TWRP, every time you wipe a partition you must reboot recovery before flashing.
I'll put a comment for those who have problems flashing.
And now I must add the Magisk tuto.
djibe89 said:
Hi,
Sorry for my late replay.
Sorry for the 2.3.7 version. When i tried to force updates nothing came out so I thought it was the last one. I will remove comments on version.
For the Recovery, everything went fin with latest version. However, with 3.4+ TWRP, every time you wipe a partition you must reboot recovery before flashing.
I'll put a comment for those who have problems flashing.
And now I must add the Magisk tuto.
Click to expand...
Click to collapse
Flashing Rom and Gapps over adb gives an insufficient space error. I first install Rom and then install Gapps.
Hi @haktug,
did you repartition correctly ? The partition should be ultra wide after repart
after writing the partition layout and formating /data and /cash the only i get whatever i try to do is "Unable to mount storage". SDCard partition is marked as no present and on "Select Storage" button the only i get is "SDCard (0MB)". and that lets me do NOTHING at all. i tryied everithing i cant get over it, dispite my every step in this guide were presice... please somebody help...
djibe89 said:
Hi @haktug,
did you repartition correctly ? The partition should be ultra wide after repart
Click to expand...
Click to collapse
yes ı did
bkokkinos said:
after writing the partition layout and formating /data and /cash the only i get whatever i try to do is "Unable to mount storage". SDCard partition is marked as no present and on "Select Storage" button the only i get is "SDCard (0MB)". and that lets me do NOTHING at all. i tryied everithing i cant get over it, dispite my every step in this guide were presice... please somebody help...
Click to expand...
Click to collapse
which version of twrp are you using?
haktug said:
which version of twrp are you using?
Click to expand...
Click to collapse
the one you provide ... 3.5.0.9.0 i think it is
i made the procedure multiple times and i formated many times both /data and /cashe and i return to my previous layout installed a random rom and tryied this repartition again with the same results....
unable to mount storage
SDCard (0MB)
on advanced wipe >SDCard >change file system > Present:No
@bkokkinos Can you send the log form the command
Code:
fdisk -l /dev/block/mmcblk0
bkokkinos said:
the one you provide ... 3.5.0.9.0 i think it is
i made the procedure multiple times and i formated many times both /data and /cashe and i return to my previous layout installed a random rom and tryied this repartition again with the same results....
unable to mount storage
SDCard (0MB)
on advanced wipe >SDCard >change file system > Present:No
Click to expand...
Click to collapse
you should use twrp 3.2.3 on this link.
Downloads for : Sony Xperia S | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
haktug said:
you should use twrp 3.2.3 on this link.
Downloads for : Sony Xperia S | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Click to expand...
Click to collapse
WWWOOOOOOOOOOOOOOOOOWWWWWWWWWWW!!!!!!!!!!!!!
What did you do......????????!!!!
i just flashed twpr 3.2.3 and everything worked perfectly....!!!! How could just different version make such differance???? OOOUUUFFFFFF i can't believe it... my two days headache is gone... THANK YOU Very Much!!!
Hi, I updated tutorial thanks to both of you.
Thanks t
djibe89 said:
Hi, I updated tutorial thanks to both of you.
Click to expand...
Click to collapse
Thanks to you!
Hello,
Good day! I was stuck at step 13) INSTALL ROM AND GOOGLE APPS
It says,
"Updater process ended with ERROR: 7 error installing zip file 'sideload/nAOSProm-81.0-b11-nozomi.zip'
Failed to mount '/system' ".
I used TWRP 3.2.3-0.
Thank you...
l3mu3l said:
Hello,
Good day! I was stuck at step 13) INSTALL ROM AND GOOGLE APPS
It says,
"Updater process ended with ERROR: 7 error installing zip file 'sideload/nAOSProm-81.0-b11-nozomi.zip'
Failed to mount '/system' ".
I used TWRP 3.2.3-0.
Thank you...
Click to expand...
Click to collapse
I don't know if I can really help you, but I would recommend you to use the links provided by the author of the rom himself. For instance, the author of this rom says clearly to use the following link in order to get the proper TWRP version: https://androidfilehost.com/?fid=1322778262904003720
Another important thing is in my opinion that the permanent twrp must be flashed into the fota partition, not in the boot partition. In my case, everytime I flashed it into the boot partition, the device always rebooted into system and not into twrp.
And very important as well is to check if the repartition has been made correctly. Check out that the sd has about 28 gigabytes free after doing the repartition.
l3mu3l said:
Hello,
Good day! I was stuck at step 13) INSTALL ROM AND GOOGLE APPS
It says,
"Updater process ended with ERROR: 7 error installing zip file 'sideload/nAOSProm-81.0-b11-nozomi.zip'
Failed to mount '/system' ".
I used TWRP 3.2.3-0.
Thank you...
Click to expand...
Click to collapse
By the way, I have just read someone who was getting error 7 while trying to install the rom, and he warns: MAKE SURE YOU DON'T CHANGE SYSTEM PARTITION INTO F2FS. Only Data and cache partitions must be changed into f2fs. Just in case it may help you...
TXUTXI72 said:
I don't know if I can really help you, but I would recommend you to use the links provided by the author of the rom himself. For instance, the author of this rom says clearly to use the following link in order to get the proper TWRP version: https://androidfilehost.com/?fid=1322778262904003720
Another important thing is in my opinion that the permanent twrp must be flashed into the fota partition, not in the boot partition. In my case, everytime I flashed it into the boot partition, the device always rebooted into system and not into twrp.
And very important as well is to check if the repartition has been made correctly. Check out that the sd has about 28 gigabytes free after doing the repartition.
Click to expand...
Click to collapse
ı agree. if it doesn't work, you're doing it wrong somewhere. You should do it again

Categories

Resources