FORUMS
Remove All Ads from XDA

[TUTORIAL] Increase data partition

149 posts
Thanks Meter: 170
 
By SystemR89, Senior Member on 19th July 2014, 11:30 AM
Post Reply Email Thread
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!


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

The Following 73 Users Say Thank You to SystemR89 For This Useful Post: [ View ] Gift SystemR89 Ad-Free
 
 
20th July 2014, 05:35 AM |#2  
Felimenta97's Avatar
Senior Member
Flag Ribeirão Preto
Thanks Meter: 2,335
 
More
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...
The Following User Says Thank You to Felimenta97 For This Useful Post: [ View ] Gift Felimenta97 Ad-Free
20th July 2014, 04:00 PM |#3  
Member
Thanks Meter: 7
 
More
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 ?
20th July 2014, 04:01 PM |#4  
heavens dragon's Avatar
Senior Member
Thanks Meter: 95
 
More
Quote:
Originally Posted by Felimenta97

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
21st July 2014, 09:28 AM |#5  
OP Senior Member
Flag <<Sydney>>
Thanks Meter: 170
 
Donate to Me
More
Quote:
Originally Posted by Felimenta97

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!

Quote:
Originally Posted by Felimenta97

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.

Quote:
Originally Posted by zuifon

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!

Quote:
Originally Posted by zuifon

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

Quote:
Originally Posted by zuifon

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
The Following 2 Users Say Thank You to SystemR89 For This Useful Post: [ View ] Gift SystemR89 Ad-Free
21st July 2014, 10:17 AM |#6  
airwolf1544's Avatar
Senior Member
Flag Rosenheim
Thanks Meter: 88
 
More
Thumbs up
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
21st July 2014, 10:52 AM |#7  
OP Senior Member
Flag <<Sydney>>
Thanks Meter: 170
 
Donate to Me
More
Quote:
Originally Posted by airwolf1544

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.
The Following 2 Users Say Thank You to SystemR89 For This Useful Post: [ View ] Gift SystemR89 Ad-Free
21st July 2014, 09:19 PM |#8  
zahid5h's Avatar
Senior Member
Flag Khartoum
Thanks Meter: 384
 
Donate to Me
More
guys plz help i got stouk in to this what iam doing wrong:cryi ng:

~ # ←[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
22nd July 2014, 05:19 AM |#9  
airwolf1544's Avatar
Senior Member
Flag Rosenheim
Thanks Meter: 88
 
More
Quote:
Originally Posted by zahid5h

guys plz help i got stouk in to this what iam doing wrong:cryi ng:

~ # ←[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"?
22nd July 2014, 06:37 AM |#10  
zahid5h's Avatar
Senior Member
Flag Khartoum
Thanks Meter: 384
 
Donate to Me
More
Quote:
Originally Posted by airwolf1544

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
25th July 2014, 09:37 AM |#11  
not anonymous's Avatar
Member
Thanks Meter: 5
 
More
Sorry for asking.Do we really have to use linux os instead of windows?
Post Reply Subscribe to Thread

Tags
data, fdisk, partitions, partitions custom, partitions resize

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes