[Guide] Repartition internal storage to get more space on /data

Search This thread

harsh.

Senior Member
Jul 3, 2015
593
130
24
Mumbai-dombivli
Xiaomi Poco X3 NFC
@out386
I'm having few questions
Can I use 1gb of my user data partition as system partition??to increase system partition near to 1.8gb
Then with rest space (1gb)I'll use my SD card as internal storage!!!(32gb SD card)
But again
There is one question
In sprout4 we can install only apps in internal memory so, would I'll be able to use it to store other data like photos,etc.
I hope u got my question!
And the biggest question is can I convert (partition to f2fs) I want to use f2fs but haven't got any success!

Sent from my sprout4 using XDA
 
Last edited:

out386

Senior Member
Sep 2, 2014
106
96
First of all , thanks a lot for the reply.
Second , yes , I tried that from pc with windows 10 64-bit.
My steps:
1. From my phone I enabled debugging.

2. I downloaded "android-sdk_r24.4.1-windows.zip" from //developer.android.com/studio/index. After I launch SDK Manager I installed:
*Android SDK Tools
*Android SDK Platform-Tools
*Google USB Drive
At Environment Variables at Path I added ;C:\android-sdk\tools;C:\android-sdk\platform-tools
When I type "adb" in cmd a long list appears.

3. I downloaded some "ADB Drivers_Updated" and I go in that folder , Open new cmd+shfit and I type "adb shell" and the next text appears ( without lines )
---------------------shell@Allview_P4Life:/ $-----------------

BEFORE this you said that I must root in TWRP so I google it and I did the following steps :
1. Went in C:\android-sdk\platform-tools
2. Open new cmd+shift and I type "adb reboot recovery" the phone reboots and the next image appears:
//i.imgur.com/JLWdPXU.jpg

After this I'm lost because when I type abd shell in cmd it says "/no emulators found..."

I want to make a bigger partition for "system content apps" because even if I have ~5GB internal memory remaining I saw that there is a 1GB partition that when it's full (programs registry or I don't know what ) you can't install program anymore even if you have an empty SD card attached and the Default Write option in system is set to SD card.

Can you please help me ? This is my first time doing this and my phone is Allview P4 Life . I really like that cheap phone.
(1) You didn't need the Android SDK. The ADB link I'd given in the thread would've been enough.
(2) I see that you have the stock recovery. That's why it sais that no emulators thing. You need a custom recovery for this.
(3) You're using some kind of Chinese phone. I don't know of any custom recovery for that phone. Search around, you just might find one. Also try Yuweng's recovery thread. If it's an older MediaTek, that tool should work.

Once you have a custom recovery, follow this thread, but don't use any of the numerical values for the partition sizes/ offsets I used here, your values will be different.

(4) This method could be risky. Make sure that you can recover your phone somehow if it goes wrong. The 1st gen Android One devices I wrote this for can recover, but I don't know about your phone.
 
Last edited:

out386

Senior Member
Sep 2, 2014
106
96
@out386
I'm having few questions
Can I use 1gb of my user data partition as system partition??to increase system partition near to 1.8gb
Then with rest space (1gb)I'll use my SD card as internal storage!!!(32gb SD card)
But again
There is one question
In sprout4 we can install only apps in internal memory so, would I'll be able to use it to store other data like photos,etc.
I hope u got my question!
And the biggest question is can I convert (partition to f2fs) I want to use f2fs but haven't got any success!

Sent from my sprout4 using XDA
(1) Yeah, you can make system larger. But after you flash a ROM, it'll get smaller again. Go to TWRP - > Wipe - > Advanced. Select /system, and tap "resize". That'll make the partition large again.
(2) Yeah, you can use sdcard as internal on Marshmallow after making /system larger
(3) I'm not sure. You can store pictures, etc, but I think that I heard that changing roms sometimes makes that data unreadable or something - I never tried.
(4) If you can get a recovery and a kernel that supports F2FS, then yes. I think that all kernels and most TWRP build support it.

Sent from my YU5010 using Tapatalk
 

harsh.

Senior Member
Jul 3, 2015
593
130
24
Mumbai-dombivli
Xiaomi Poco X3 NFC
(3) I'm not sure. You can store pictures, etc, but I think that I heard that changing roms sometimes makes that data unreadable or something - I never tried. 1) Yeah, you can make system larger. But after you flash a ROM, it'll get smaller again. Go to TWRP - > Wipe - > Advanced. Select /system, and tap "resize". That'll make the partition large again.
What if I flash sprout8 built!??
With that I can store photos, and media in internal memory as well!
And for 1st ans, I again have an question!
If we can change size of system partition from twrp only then why should we use such a long process :rolleyes::confused:

Sent from my sprout4 using XDA Labs
 

out386

Senior Member
Sep 2, 2014
106
96
What if I flash sprout8 built!??
With that I can store photos, and media in internal memory as well!
And for 1st ans, I again have an question!
If we can change size of system partition from twrp only then why should we use such a long process :rolleyes::confused:

Sent from my sprout4 using XDA Labs
You can't change from TWRP unless you've already done this.

Sent from an Ewwphoria using Tatapalk
 

Holographic

New member
Jan 7, 2014
2
1
Warning! Warning! Warning!

**DISCLAIMER**
**I WILL NOT BE RESPONSIBLE IF YOUR PHONE DIES.**
**PROCEED AT YOUR OWN RISK**
**IF YOU MESS UP, USE SP FLASH TOOLS TO FLASH ROM IN THE FORMAT ALL+ DOWNLOAD MODE**

I fried two brand new 64 Gig Kingston sd cards.

I purchased a brand new Kingston 64 gig class 10 sd card and gave this procedure a shot. It work great at first. I followed the instructions and they were flawless. My fist install was on Android 6.

The phone worked as expected for about 24 hours and the the phone reported there was no SD card installed. I took the card out and could not get it to be recognized on any computer, Window, Linux or Android.

I took the SD card back to the computer store and they were kind enough to replace it after it was tested and confirmed failed.

My Galaxy S5 was now in limbo after loosing all the data stored on the internal memory section of the failed SD card. I thought great time to upgrade so I installed Android 7 and proceeded with the new SD card ( also Kingston 64 gig ).

I followed all the steps again to set up this procedure and again it was flawless. I thought to myself I just had bad luck with the other SD card.

30 Hours later!!! Android 7 was now reporting that there was no SD card installed. You got to be kidding me right!

Went through the procedure of checking the SD card with Gparted and other partition software. No system could even see the SD card. It was like it was not even there. Same as the last card.

I got the card replaced and reload my Galaxy S5 one more time. This time however I was not willing to try this procedure and just used the card as external storage.

About three weeks have passed now since the two Kingston card were corrupted and I install the third one as external storage only. I am happy to report that the third Kingston 64 gig card is doing well.

I am not saying this method does not work I am just sharing my experience of what happened when I used it.
As the Quote says:
**DISCLAIMER**
**I WILL NOT BE RESPONSIBLE IF YOUR PHONE DIES.**
**PROCEED AT YOUR OWN RISK**
**IF YOU MESS UP, USE SP FLASH TOOLS TO FLASH ROM IN THE FORMAT ALL+ DOWNLOAD MODE**

Phone: Galaxy S5

Update Friday, June 8 2018
I am still using the same Galaxy S5 phone and SD card. By not partitioning my 64 gig sd card it has not fail again. Strange that the partitioning failed on this phone in the way I mentioned above. Just wanted to give an update an let you all know the results.
 
Last edited:
  • Like
Reactions: mirfatif

VstrawbZ

New member
Nov 28, 2016
2
0
Can I rename /system2 to /system partition with this method?
I tried to dual boot my phone and now I have my system as named /system2.
I want to rename it back. I tried rename it using twrp recovery file manager but each time on boot it renames back to system2.
I can't flash any rom as any recovery is unable to mount /system.
Please, can I rename it using these steps. If there is any other way please guide.
Sorry for bad english.
 
S

System_Dilemma

Guest
Can I have some help here:

  1. 1. I have the ADB Drivers installed, I even installed the Android SDK just to use ADB Commands. I installed TWRP Materialized but the problem is that my PC doesn't detect my device when I boot it into recovery.

  • 2. I tried other recovery (TWRP 3.0.x.0) and my PC detected it flawlessly. I checked my device using adb devices and it was there. But when I enter the command through adb shell and then parted /dev/block/mmcblk0, it displays /system/bin/sh: parted: not found
I am trying to repartition my /system so that I can install either the Full or Mini GApps package for CM14 Unofficial.
 

out386

Senior Member
Sep 2, 2014
106
96
Can I have some help here:

  1. 1. I have the ADB Drivers installed, I even installed the Android SDK just to use ADB Commands. I installed TWRP Materialized but the problem is that my PC doesn't detect my device when I boot it into recovery.

  • 2. I tried other recovery (TWRP 3.0.x.0) and my PC detected it flawlessly. I checked my device using adb devices and it was there. But when I enter the command through adb shell and then parted /dev/block/mmcblk0, it displays /system/bin/sh: parted: not found
I am trying to repartition my /system so that I can install either the Full or Mini GApps package for CM14 Unofficial.
If you can't use the TWRP I mentioned, then you'll need a parted binary. Boot the twrp image I mentioned, and copy /sbin/parted. Boot to twrp 3.x, paste that binary to /sbin, and over adb, do:
"chmod +x /sbin/parted".

Then do the rest of the guide. I don't exactly remember, but if that binary is static, this will work.


As for increasing the size of the system partition for gapps, there is plenty of space in system already for most gapps. After flashing a ROM, go to:
TWRP - Wipe - Advanced - Select System - Resize

That should give enough space. If not, flash some minimal gapps, and download the missing apps from Play. Better avoid this long method if you just need gapps.

Sent from my YU5010 using Tapatalk
 

out386

Senior Member
Sep 2, 2014
106
96
I fried two brand new 64 Gig Kingston sd cards.

I purchased a brand new Kingston 64 gig class 10 sd card and gave this procedure a shot. It work great at first. I followed the instructions and they were flawless. My fist install was on Android 6.

The phone worked as expected for about 24 hours and the the phone reported there was no SD card installed. I took the card out and could not get it to be recognized on any computer, Window, Linux or Android.

I took the SD card back to the computer store and they were kind enough to replace it after it was tested and confirmed failed.

My Galaxy S5 was now in limbo after loosing all the data stored on the internal memory section of the failed SD card. I thought great time to upgrade so I installed Android 7 and proceeded with the new SD card ( also Kingston 64 gig ).

I followed all the steps again to set up this procedure and again it was flawless. I thought to myself I just had bad luck with the other SD card.

30 Hours later!!! Android 7 was now reporting that there was no SD card installed. You got to be kidding me right!

Went through the procedure of checking the SD card with Gparted and other partition software. No system could even see the SD card. It was like it was not even there. Same as the last card.

I got the card replaced and reload my Galaxy S5 one more time. This time however I was not willing to try this procedure and just used the card as external storage.

About three weeks have passed now since the two Kingston card were corrupted and I install the third one as external storage only. I am happy to report that the third Kingston 64 gig card is doing well.

I am not saying this method does not work I am just sharing my experience of what happened when I used it.
As the Quote says:


Phone: Galaxy S5
Whoa. Sorry to hear that. That's something that shouldn't happen, but Samsung, you know. All kinds of things can explode. :)

Sent from my YU5010 using Tapatalk
 

out386

Senior Member
Sep 2, 2014
106
96
Can I rename /system2 to /system partition with this method?
I tried to dual boot my phone and now I have my system as named /system2.
I want to rename it back. I tried rename it using twrp recovery file manager but each time on boot it renames back to system2.
I can't flash any rom as any recovery is unable to mount /system.
Please, can I rename it using these steps. If there is any other way please guide.
Sorry for bad english.
I have no idea how it could possibly have happened. No, I don't know if this will help you.

Sent from my YU5010 using Tapatalk
 
S

System_Dilemma

Guest
If you can't use the TWRP I mentioned, then you'll need a parted binary. Boot the twrp image I mentioned, and copy /sbin/parted. Boot to twrp 3.x, paste that binary to /sbin, and over adb, do:
"chmod +x /sbin/parted".

Then do the rest of the guide. I don't exactly remember, but if that binary is static, this will work.


As for increasing the size of the system partition for gapps, there is plenty of space in system already for most gapps. After flashing a ROM, go to:
TWRP - Wipe - Advanced - Select System - Resize

That should give enough space. If not, flash some minimal gapps, and download the missing apps from Play. Better avoid this long method if you just need gapps.

Sent from my YU5010 using Tapatalk

Thanks for the feedback. And yeah, I just need the GApps (I've literally tried everything from aroma to nano and it still gives me error 7). But I'll try it next time around. Just found out that the Unofficial CM14 is laggy af.
 

LehKeda

Senior Member
Jan 26, 2014
768
671
My little cave
@out386 hey ,
I want to repartition my phone (it's samsung galaxy star ) ... i want to repartition it to increase kernel and recovery partitions size but the problem there's not any partition to take space from it ... here's the problem
h5ua17q1sb7qics6g.jpg


I don't know why they partition it that way ... anyway I do wonder if i can rearrange partitions order (make boot , recovery and data partition next to each other ) and what would happen if I merged boot and recovery together ? also where is the boot loader partition ?
Thanks in advance ....
 
S

System_Dilemma

Guest
I've repartitioned my device succesfully. Flashing ROMs right now.
 
Last edited:

out386

Senior Member
Sep 2, 2014
106
96
@out386
I'm too lazy to all this things. any tym we will get flashable zip? I mean is it possible?
[emoji14]

Sent from my sprout4 using XDA Labs
It's possible. But it'll be riskier than doing it manually, given my limited shell knowledge. But I don't really have enough time to make a zip, so, no. I'll probably not make something to automate it.

Sent from my YU5010 using Tapatalk
 
  • Like
Reactions: harsh.

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    **DISCLAIMER**
    **I WILL NOT BE RESPONSIBLE IF YOUR PHONE DIES.**
    **PROCEED AT YOUR OWN RISK**
    **IF YOU MESS UP, USE SP FLASH TOOLS TO FLASH ROM IN THE FORMAT ALL+ DOWNLOAD MODE**

    A lot of space in the internal storage in sprout4 devices is wasted. This will give you a bit more space in userdata. I put this guide in Android One General, but this will apply to most devices. At least to those devices that use GPT partitions like the Sprouts do.
    Requirements:
    An Android device (duh)
    TWRP Materialized by musfiqus, from here: http://xdaforums.com/crossdevice-de...p-materialised-twrp-recovery-android-t3088715 It includes the Parted binary. Some other builds of TWRP don’t have that. You need it.
    Something resembling intelligence
    Patience
    A PC (Windows , Linux, Mac, whatever) is optional. The instructions here use a PC, but if you don’t have one, you can type commands in TWRP terminal).
    ADB drivers, if you’re using a PC.
    A hardware calculator. Using an on-screen calculator so many times is going to get you to go Hulk.

    Here’s how to do it.
    Reboot to TWRP recovery, and open a terminal / Command Prompt. Take a backup of IMEI.
    Type:
    adb shell
    You’ll get a screen like this:
    image.png

    Type :
    parted /dev/block/mmcblk0
    image.png


    By default, Parted uses MB as the storage unit. To prevent possible unused space after repartitioning, we’ll use sectors as a unit instead.
    Type
    unit s
    This’ll change to sectors.

    Type
    print

    It’ll give a warning, just type
    i
    Then:
    print free

    image.png


    At the top, you’ll see that the sector size is written. Write this number down somewhere. For my Android One 4GB, the sector size is 512 bytes.
    Now, you need to understand what the list means. Each horizontal row shows the details of a partition.
    The 1st column shows the partition number.
    The 2nd column shows the start offset of that partition. That means that the partition starts at the location mentioned.
    The 3rd column shows where the partition ends. Notice that each partition starts exactly 1 sector after the previous one ends.
    The 4th column is obviously the size of the partition.
    The 5th column is the file system used by the partition. If nothing is written in this column, that means that it’s a binary partition.
    The 6th column is the partition name.

    You’ll see that the sizes in that list are weird. They’re not in any standard unit you might know. That’s because we used sectors instead of megabytes. The ‘s’ after each number indicates that it’s in sectors. (You can use the default MB unit (1MB=1000 KB. 1KB=1000bytes), or the MiB unit (1MiB=1024 KiB), but that just might leave 1 or 2 MB of space unused. So, I’m using sectors).
    Remember that 1 sector = 512 bytes for my phone.

    There’s some free space at the top and bottom of the list. Leave that free space there. Do not make partitions using those.

    To convert sectors to MiB or KiB:
    1s = 512bytes (Use the sector size you wrote down previously for this step, it might not be 512 bytes for you)

    1024 bytes = 1 KiB
    1024 KiB = 1 MiB
    1024 MiB = 1GiB

    So, 4833280s = (4833280 x 512) B = 2474639360 B
    = (2474639360 / 1024) KiB = 2416640 KiB
    = (2416640 /1024) MiB = 2360 MiB
    = (2360 / 1024) GiB = 2.30 GiB

    We’ll use another terminal window with sizes in MiB now. So open another Parted prompt in a new terminal / command prompt window, but instead of
    unit s,
    this time, write
    unit MiB
    Type “print”, “i”, and “print free” again.

    image.png


    Look at my 11th partition. Its size is 8MiB. I know that this logo partition doesn’t need more than 2 MiB. So, I’ll make it smaller.
    When you make partitions smaller, all the data inside will be lost. So, we need to back up the partitions first.
    Open a 3rd terminal window. Type
    adb shell dd if=/dev/block/mmcblk0p11 of=/microSD/p11
    The “dd” command copies bytes from the “if=” location, to the “of=” location. The internal storage is /dev/block/mmcblk0. The “p11” after that refers to the partition we are backing up. Notice that in the Parted list, “logo” has a partition number of “11”. So the general command to back up partitions is
    adb shell dd if=/dev/block/mmcblk0p<partition_number> of=/microSD/p<partition_number>
    From recovery, unmount all partitions except microSD and oem. Then back up partitions 11, and 13 from PC. We will copy the files from OEM instead of using dd. So type
    adb shell mkdir /microSD/oem
    adb shell cp –a /oem/ /microSD/oem
    Go to /microSD/oem/oem/app with TWRP’s file manager, and delete everything there.

    Open the 1st terminal with sizes in sectors.
    Type
    rm 11
    This will delete the oem partition. Type
    print free

    image.png


    Partition 11 has been replaced with free space. Let’s make the Logo partition 2MiB. 2MiB = 4096s. The start sector is 113920, so the end sector needs to be (113920 + 4096 - 1) = 118015.
    The command to create partitions is:
    mkpart <name> <start_sector> <end_sector>
    name <partition_number> < name>
    So, type:
    mkpart logo 113920s 118015s
    name 11 logo

    image.png


    Some free space has appeared below logo. If you type “print free” on the 2nd terminal, with units set to MiB,

    image.png


    You’ll see that logo is now only 2 MiB, and an extra 6 MiB of free space is available. Also, oem takes 64 MiB. Open the 3rd terminal, from which you took backups, and type
    adb shell df /oem

    image.png


    Divide the number under “used” with 1024. That’ll tell you how much space is being used. My oem partition is 64 MiB, but it’s only using about 6MiB. Typical. Not all space in the partition is available for file storage, so I’ll make the oem partition 11 MiB.
    Unmount oem from recovery. Open the 1st terminal window, with sizes in sectors.
    Type
    rm 12
    print free

    image.png


    11MiB = 22528s. new End size will be (118016 + 22528 - 1)s = 140543s
    Type
    mkpart oem 118016s 140543s
    name 12 oem
    Look at the 1st partition listing in this post. Oem had a ext4 file system. Open the 3rd terminal window. Type:
    adb shell make_ext4fs /dev/block/mmcblk0p12
    This will make an ext4 file system. Type “print free” in the MiB terminal. Things look good. Copy back the contents of oem. Mount oem from recovery, and type:
    adb shell cp -a /microSD/oem/oem/* /oem/
    If you get out of space errors, delete oem, and make it a bit larger. Now type:
    adb shell chown root:root /oem/oem.prop
    adb shell chmod 644 /oem/oem.prop
    This will fix permissions of oem.prop.

    image.png


    I won’t change sizes of partition 13. So I’ll make it occupy 33536s from location 140544s. End sector will be (134400 + 33536 – 1)s = 174079s. So do it like the last two times. If you want to change the size of system, read my next post below first. I suggest that you keep the size of system intact. So, delete system, make it again just after expdb, and make an ext4 file system in it, like you did for oem.
    Cache is about 128MiB big, but you just need it to be 5MiB. Any more is a waste. Delete cache, make it again right below system, with a size of 5MiB, and make an ext4 file system in it. This is what my partition table looks like after doing that.

    image.png


    image.png


    So, after all that insanity, I just gained a tiny 182MiB of space. I’m not sure about the gen partition, and metadata is apparently used for encrypting data, so I’ll leave those two untouched. In my screenshots, userdata doesn’t have any file system, but that’s because I just unlocked my bootloader. Userdata is usually ext4. So, I’ll delete userdata,

    image.png


    and make userdata again. No need to calculate the end size again, as userdata will occupy all the free space, start sector will be 2232320s and end sector will be 7438335s. Then put an ext4 file system on userdata,

    image.png


    and done!
    Now restore the partition 11 and 13 backup. If partition 11 gives an error, just ignore it.
    dd if=/microSD/p11 of=/dev/block/mmcblk0p11
    dd if=/microSD/p13 of=/dev/block/mmcblk0p13
    Now reboot recovery, flash a new rom, restore IMEI, and reboot. Read the next post to get more space.
    2
    daemon started successfully P*
    error: device not found
    error: device not found
    Install adb drivers for your phone. You need both adb itself and the drivers. Get it here http://xdaforums.com/showthread.php?t=2588979
    1
    Nice thread dude, :) though awesome tutorial
    1
    Yes, many times.