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

Search This thread

hedgehog24

New member
Mar 5, 2021
3
0
SD card (0 mb) and In Windows Explorer Xperia S device folder is empty! İ couldn't have moved TWRP 3.2.3 img into the folder. What should i do?

Thanks in advance
 

haktug

Member
Mar 29, 2020
18
2
SD card (0 mb) and In Windows Explorer Xperia S device folder is empty! İ couldn't have moved TWRP 3.2.3 img into the folder. What should i do?

Thanks in advance

After defragmenting the SD card and system memory, format it in the "system, cache and data" f2fs file format. You won't get a 0MB error again.

Ok, i have done with " adb push twrp-3.2.3-nozomi.img /sdcard/ " command line.
You can also simply install Twrp via Flashtool.
 

TopkillLTU

New member
Dec 28, 2017
2
0
Hello, so I tried to revive my SONY Xperia S for a new life, but like almost everyone I ran into the unable to mount storage problem but the TWRP 3.2.3 link seems to be looking for mirror forever and so I am unable to flash the recovery.

EDIT: The androidfilehost had a bit of a blackout now everything is fine
 
Last edited:
Hi.
After a while i managed to do unlock fastboot and have twrp on the phone.
At first my data partition was unreadable by TWRP so i formatted it in exFat then again in Fat. I dont know if this was a problem

Then at point 10 when i mounted data partition it wasnt on my pc file manager. The sd partition, if mounted, showed instead the twrp folder. so i used it instead of data partition

then at point 12, where im now struck, i type in the cmd all the commands and everyhing works fine until i write "fdisk -l /dev/block/mmcblk0".

Instead of returning "4 heads, 16 sectors/track, 973824 cylinders (etc)" it says:
fdisk: invalid option -- 1 BusyBox v1.22.1 bionic (2020-12-29 13:07 +0000) multi-call binary. Usage: fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK Change partition table -u Start and End are in sectors (instead of cylinders) -l Show partition table for each DISK, then exit -b 2048 (for certain MO disks) use 2048-byte sectors -C CYLINDERS Set number of cylinders/heads/sectors -H HEADS -S SECTORS ~ #

What am I doing wrong here?
 

djibe89

Senior Member
May 24, 2014
637
378
Google Nexus 4
Hi.
After a while i managed to do unlock fastboot and have twrp on the phone.
At first my data partition was unreadable by TWRP so i formatted it in exFat then again in Fat. I dont know if this was a problem

Then at point 10 when i mounted data partition it wasnt on my pc file manager. The sd partition, if mounted, showed instead the twrp folder. so i used it instead of data partition

then at point 12, where im now struck, i type in the cmd all the commands and everyhing works fine until i write "fdisk -l /dev/block/mmcblk0".

Instead of returning "4 heads, 16 sectors/track, 973824 cylinders (etc)" it says:
fdisk: invalid option -- 1 BusyBox v1.22.1 bionic (2020-12-29 13:07 +0000) multi-call binary. Usage: fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK Change partition table -u Start and End are in sectors (instead of cylinders) -l Show partition table for each DISK, then exit -b 2048 (for certain MO disks) use 2048-byte sectors -C CYLINDERS Set number of cylinders/heads/sectors -H HEADS -S SECTORS ~ #

What am I doing wrong here?
Hi, are you running commands with ADB from Windows ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Glad you did it ! From 2.3.7 to 8.1 is a big jump !
  • 2
    [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

    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.0_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

    + OpenGApps ARM 8.1 Pico (Micro or Nano are OK): https://opengapps.org/?arch=arm&api=8.1&variant=pico

    + Charge phone to 100 %.

    NB. Use a USB2 port to connect tablet to PC.


    2) INSTALL 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.0_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

    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.


    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 open_gapps-arm-8.1-*.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 gapps > 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
    2
    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
    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.
    2
    Hi, I updated tutorial thanks to both of you.
    1
    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!

    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.
    1
    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!!!
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone