Search This thread

SystemR89

Senior Member
Sep 4, 2006
149
171
<<Sydney>>
michele.porelli.eu
[size=+2]Are you annoyied to move your apps on SD?
Are you experiencing slow down on your phone 'cause too many apps out of internal memory?
That's the solution![/size]

Code:
#include <std_disclaimer.h> 
/*  
 * Your warranty is now void.  
 *  
 * I am not responsible for bricked devices, dead pets, thermonuclear  
 * war, or the current economic crisis caused by you following these  
 * directions. YOU are choosing to make these modificiations, and  
 * if you point your finger at me for messing up your device, We will  
 * laugh at you.  Loud and hard.
 */

YOU ARE GOING TO MODIFY PHONE'S PARTITION TABLE, A WRONG STEP COULD BRICK YOUR PHONE.

PREREQUISITES:
  • Linux computer with Android SDK installed or a mind in order to use these instructions in a different way (different OS, partial SDK installation, ecc...)
  • 30-60min
  • Backup of your apps, data and your internal memory, you have to re-flash your rom. If needed backup your "sdcard" partition (you are going to loose everything in, so also apps on sd card), maybe you could consider a nandroid backup for a disaster recovery and/or titanium backup (or equivalent) to restore your apps and settings.

INSTRUCTIONS:
  1. Install and boot TWRP
  2. Get a shell:
    Code:
    (PC) adb shell
  3. Umount sdcard
    Code:
    (ADB SHELL) umount /sdcard
  4. Open fdisk
    Code:
    (ADB SHELL) fdisk /dev/block/mmcblk0
  5. Print current partition table (and save the output somewhere)
    Code:
    (ADB SHELL/fdisk) p
  6. Remove sdcard and data partition:
    Code:
    (ADB SHELL/fdisk) d
    (ADB SHELL/fdisk) 15
    (ADB SHELL/fdisk) d
    (ADB SHELL/fdisk) 14
  7. Create new data partition
    Code:
    (ADB SHELL/fdisk) n
    	(First cylinder) -> you have to indicate the same start cylinder of partition 14 read in step 6
    	(Last cylinder) -> +8192M (this will create a 8gB partition)
  8. Check new partition table
    Code:
    (ADB SHELL/fdisk) p
  9. Create new sd partition
    Code:
    (ADB SHELL/fdisk) n
    	(First cylinder) -> you have to indicate the stop cylinder of partition 14 read in step 8 +1. If you read 292945 as stop cylinder you have to write 292946.
    	(Last cylinder) -> just press enter
    (ADB SHELL/fdisk) t
    (ADB SHELL/fdisk) 15
    (ADB SHELL/fdisk) c
  10. Write changes to partition table
    Code:
    (ADB SHELL/fdisk) w
  11. "wipe" data and sdcard to format your new partitions
  12. Push your ROM and gapps
    Code:
    (PC) adb push myrom.zip /sdcard/
    (PC) adb push gapps.zip /sdcard/
  13. Flash ROM and gapps
  14. Reboot
    ...if everything was going successfully...
  15. Eventually restore sdcard data

Done!
Enjoy your new big data partiton :)

 
Last edited:

Felimenta97

Senior Member
Aug 5, 2011
7,870
2,308
24
Ribeirão Preto
Nice tutorial! Nice to see some active development/tutoring here, even after over 2 years :)

Few questions: This, if done wrong, can completely brick the device, right? If yes, I highly suggest you to include that information in OP in big red bold text, so people don't come here complaining to you. Also, can I do this from Ubuntu, for example, running from a CD or even from Windows, with the proper SDK stuff installed? I know you mentioned it, but I always had one issue or another with adb on windows, so yeah...
 
  • Like
Reactions: Envious_Data

zuifon

Senior Member
Aug 20, 2008
91
10
Thanks for this tutorial !

Are steps correct for (First Cylinder) ? Isn't step 5 for step 7 and step 8 for step 9 ?

Should I delete something in .zip ROM to avoid it resize partition ?

Is it possible to use an official ROM if I don't flash partition-image.sin with FlashTool ?
 
Last edited:

heavens dragon

Senior Member
Nov 4, 2010
295
95
Nice tutorial! Nice to see some active development/tutoring here, even after over 2 years :)

Few questions: This, if done wrong, can completely brick the device, right? If yes, I highly suggest you to include that information in OP in big red bold text, so people don't come here complaining to you. Also, can I do this from Ubuntu, for example, running from a CD or even from Windows, with the proper SDK stuff installed? I know you mentioned it, but I always had one issue or another with adb on windows, so yeah...

i think u can do it from live cd/usb i have done some partitions of hdd in past with livecd/usb a livecd/usb is almost complete working version OS at least of ubuntu it is
 

SystemR89

Senior Member
Sep 4, 2006
149
171
<<Sydney>>
michele.porelli.eu
Nice tutorial! Nice to see some active development/tutoring here, even after over 2 years :)

Few questions: This, if done wrong, can completely brick the device, right? If yes, I highly suggest you to include that information in OP in big red bold text, so people don't come here complaining to you.

It could brick your device, anyway a flash from bootloader should recover your phone.
I'll add a notice!

Also, can I do this from Ubuntu, for example, running from a CD or even from Windows, with the proper SDK stuff installed? I know you mentioned it, but I always had one issue or another with adb on windows, so yeah...

Sure, you simply need an adb shell and you have to push your rom back at the end.

Thanks for this tutorial !

Are steps correct for (First Cylinder) ? Isn't step 5 for step 7 and step 8 for step 9 ?

You are absolutely right, fixed!
thanks!

Should I delete something in .zip ROM to avoid it resize partition ?

Custom ROMs usually doesn't overwrite partition table so you can flash without problem almost any ROM

Is it possible to use an official ROM if I don't flash partition-image.sin with FlashTool ?

I think that's possible, anyway I haven't tested it
 

SystemR89

Senior Member
Sep 4, 2006
149
171
<<Sydney>>
michele.porelli.eu
Great :)

I think the partition size is one of the biggest show-stopper for android L (Art-Runtime needs more space).

Is it possible to backup the files using cwm or twrp before and restore after the repartition job?

BIG THX

Technically yes, I tried backup-restore system from TWRP but it has failed during restore.
You could tar your data partition, pull the archive, resize partitions, push archive back then restore data.
 

zahid5h

Senior Member
Jan 31, 2013
258
380
Khartoum
guys plz help i got stouk in to this what iam doing wrong:confused::confused::confused::confused::crying::crying:

~ # ←[6n(ADB SHELL) umount /sdcard
(ADB SHELL) umount /sdcard
/sbin/sh: syntax error: unexpected word


what dose this mean

The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
~ # ←[6n
 
Last edited:

airwolf1544

Senior Member
guys plz help i got stouk in to this what iam doing wrong:confused::confused::confused::confused::crying::crying:

~ # ←[6n(ADB SHELL) umount /sdcard
(ADB SHELL) umount /sdcard
/sbin/sh: syntax error: unexpected word


what dose this mean

The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
~ # ←[6n

Please tell what you exactly have done!
You connected the phone via "adb shell"? And then on ADB Promt you typed "umount /sdcard"?
 

zahid5h

Senior Member
Jan 31, 2013
258
380
Khartoum
Please tell what you exactly have done!
You connected the phone via "adb shell"? And then on ADB Promt you typed "umount /sdcard"?



my bad i have done it every thing now is okey i have new 7g internal memory


big thanks to the OP you are purely genius................ marvalles work.....keep on ....this is main blowwwing
 
Last edited:

zuifon

Senior Member
Aug 20, 2008
91
10
How do you do step 13.Flash ROM and gapps ?

I can't install any .zip with the recovery because resizing the partitions broke a file needed by the recovery to install .zip
 

Top Liked Posts

  • There are no posts matching your filters.
  • 74
    [size=+2]Are you annoyied to move your apps on SD?
    Are you experiencing slow down on your phone 'cause too many apps out of internal memory?
    That's the solution![/size]

    Code:
    #include <std_disclaimer.h> 
    /*  
     * Your warranty is now void.  
     *  
     * I am not responsible for bricked devices, dead pets, thermonuclear  
     * war, or the current economic crisis caused by you following these  
     * directions. YOU are choosing to make these modificiations, and  
     * if you point your finger at me for messing up your device, We will  
     * laugh at you.  Loud and hard.
     */

    YOU ARE GOING TO MODIFY PHONE'S PARTITION TABLE, A WRONG STEP COULD BRICK YOUR PHONE.

    PREREQUISITES:
    • Linux computer with Android SDK installed or a mind in order to use these instructions in a different way (different OS, partial SDK installation, ecc...)
    • 30-60min
    • Backup of your apps, data and your internal memory, you have to re-flash your rom. If needed backup your "sdcard" partition (you are going to loose everything in, so also apps on sd card), maybe you could consider a nandroid backup for a disaster recovery and/or titanium backup (or equivalent) to restore your apps and settings.

    INSTRUCTIONS:
    1. Install and boot TWRP
    2. Get a shell:
      Code:
      (PC) adb shell
    3. Umount sdcard
      Code:
      (ADB SHELL) umount /sdcard
    4. Open fdisk
      Code:
      (ADB SHELL) fdisk /dev/block/mmcblk0
    5. Print current partition table (and save the output somewhere)
      Code:
      (ADB SHELL/fdisk) p
    6. Remove sdcard and data partition:
      Code:
      (ADB SHELL/fdisk) d
      (ADB SHELL/fdisk) 15
      (ADB SHELL/fdisk) d
      (ADB SHELL/fdisk) 14
    7. Create new data partition
      Code:
      (ADB SHELL/fdisk) n
      	(First cylinder) -> you have to indicate the same start cylinder of partition 14 read in step 6
      	(Last cylinder) -> +8192M (this will create a 8gB partition)
    8. Check new partition table
      Code:
      (ADB SHELL/fdisk) p
    9. Create new sd partition
      Code:
      (ADB SHELL/fdisk) n
      	(First cylinder) -> you have to indicate the stop cylinder of partition 14 read in step 8 +1. If you read 292945 as stop cylinder you have to write 292946.
      	(Last cylinder) -> just press enter
      (ADB SHELL/fdisk) t
      (ADB SHELL/fdisk) 15
      (ADB SHELL/fdisk) c
    10. Write changes to partition table
      Code:
      (ADB SHELL/fdisk) w
    11. "wipe" data and sdcard to format your new partitions
    12. Push your ROM and gapps
      Code:
      (PC) adb push myrom.zip /sdcard/
      (PC) adb push gapps.zip /sdcard/
    13. Flash ROM and gapps
    14. Reboot
      ...if everything was going successfully...
    15. Eventually restore sdcard data

    Done!
    Enjoy your new big data partiton :)

    7
    Any solutions? Maybe someone that had successfully partitioned their phone share their nandroid backup (of course, without personal data)
    You said that nothing shows up in device manager when you connect it in recovery right? You can try this. It might help.

    1. Download the zips attached (32 bit or 64 bit whichever your pc is).
    2. Run USBDeview as administrator. It will list all the devices installed on usb ports. Uninstall every device with xperia s on it. Even usb composite device.
    3. Now connect the device in recovery and open device manager. Xperia S should show up now. Right click on it and select update driver manually and then select Sony sa0103 (this should be there if you have already installed the drivers present in flashtool folder)
    4. Now type adb devices in command prompt window. Your device should show up now in recovery.
    6
    Repartition phone without ADB

    So here we are!
    After almost a year with broken USB i back upped everything via AirDroid and I proceeded to increase data partition.

    Just to be sure, first of all I copied the zip of a rom in /tmp folder with built-in file manager (you never know how far you can mess up things)
    Then I went on.

    Unmount every partition from mount menu.
    Next open terminal command
    Code:
    echo p | fdisk /dev/block/mmcblk0
    This will print your actual partition table.

    Take note of the start sector of partition 14
    Let's call that XXXXX, and the amount of megabytes you want to assign to data partition YYYY
    Code:
    echo -e "d\n15\nd\n14\nn\n[I]XXXXX[/I]\n+[I]YYYY[/I]M\np\nq" | fdisk /dev/block/mmcblk0
    Now take note of the end sector of partition 14.
    Done? Increase that number by 1 and let's call it ZZZZZZ
    Code:
    echo -e "d\n15\nd\n14\nn\n[I]XXXXX[/I]\n+[I]YYYY[/I]M\nn\n[I]ZZZZZZ[/I]\n\nt\n15\nc\nw" | fdisk /dev/block/mmcblk0

    Enjoy!
    System partition is not touched at all, and if you feel bold you can flash aforementioned rom in /tmp straightaway
    EDIT: feel free to check the follow up!
    Random stuff:
    Remember that > at the end of a command is going to redirect CLI output to a file, for example /sdcard/fdisk.txt
    cat is a kind of text viewer from terminal

    and really thanks to superuser.com guys
    6
    Nope

    Gesendet von meinem Xperia S mit Tapatalk


    I DID AND ITS WORKINGGGGGGGGGGGGGGGGG FLAWLESSLY :highfive::highfive:



    EDIT I USE WINDOWS...........

    GIVE ME THANKS IF I HELP YOU
    4
    please make a video of doing these steps..i'm totally confused..please:(

    Hi friend, Follow this link, there you can find a detailed ( with screen Shot) tutorial for do this, if you follow estep by estep this tutorial you don't have any problems the only problem with this link is that this tutorial is in spanish and you need use an translator

    https://www.facebook.com/notes/xper...cion-de-datos-lollipop-kitkat/947809471897721
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