[TOOL][7870] Universal repartition script for vendor support

Search This thread

Firngrod

Member
Jan 31, 2023
25
9
Deleting worked, and shrinking too, thanks. Here the script I used first (and later one with smaller sizes for shrinking). Yeah, nice!!
Ah, you beat me to it. Through the magic of visiting grandmothers and a wife home early from work, I have just made a patched version and came in here to upload it. Well, yours is here now for others to download and use as they see fit. I am very happy that I could help you get your phone fixed!

By the way, if it's not too much to ask, could you tell me if the disc code (6th column of the sgdisk --print output) is the same for boot and for system, and if not what is the code for system? I'm asking because in my adventures getting my phone fixed, at one point I ended up entirely without a system partition, and I just wildly guessed at those two having the same code. My phone works and I have not observed any issues, but still, just for peace of mind. :)
 

Hanululu

Member
Sep 2, 2019
17
1
could you tell me if the disc code (6th column of the sgdisk --print output) is the same for boot and for system, and if not what is the code for system?
Bash:
a3y17lte:/ # sgdisk --print --pretend /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 30777344 sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 52444E41-494F-2044-4D4D-43204449534B
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30777310
Partitions will be aligned on 1024-sector boundaries
Total free space is 8158 sectors (4.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            8192           16383   4.0 MiB     0700  BOTA0
   2           16384           24575   4.0 MiB     0700  BOTA1
   3           24576           65535   20.0 MiB    0700  EFS
   4           65536           81919   8.0 MiB     0700  CPEFS
   5           81920           90111   4.0 MiB     0700  m9kefs1
   6           90112           98303   4.0 MiB     0700  m9kefs2
   7           98304          106495   4.0 MiB     0700  m9kefs3
   8          106496          108543   1024.0 KiB  0700  CARRIER
   9          108544          124927   8.0 MiB     0700  PARAM
  10          124928          190463   32.0 MiB    0700  BOOT
  11          190464          268287   38.0 MiB    0700  RECOVERY
  12          268288          284671   8.0 MiB     0700  OTA
  13          284672          376831   45.0 MiB    0700  RADIO
  14          376832          378879   1024.0 KiB  0700  TOMBSTONES
  15          378880          380927   1024.0 KiB  0700  DNT
  16          380928          381951   512.0 KiB   0700  PERSISTENT
  17          381952          383999   1024.0 KiB  0700  STEADY
  18          384000          393215   4.5 MiB     0700  RESERVED2
  19          393216         5513215   2.4 GiB     0700  SYSTEM
  20         5513216         5840895   160.0 MiB   0700  VENDOR
  21         5840896         5906431   32.0 MiB    0700  CACHE
  22         5906432         5916671   5.0 MiB     0700  CP_DEBUG
  23         5916672         5918719   1024.0 KiB  0700  NAD_REFER
  24         5918720        30777310   11.9 GiB    0700  USERDATA

seems like I need a different command to answer that
 
  • Like
Reactions: Firngrod

Firngrod

Member
Jan 31, 2023
25
9
Bash:
a3y17lte:/ # sgdisk --print --pretend /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 30777344 sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 52444E41-494F-2044-4D4D-43204449534B
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30777310
Partitions will be aligned on 1024-sector boundaries
Total free space is 8158 sectors (4.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            8192           16383   4.0 MiB     0700  BOTA0
   2           16384           24575   4.0 MiB     0700  BOTA1
   3           24576           65535   20.0 MiB    0700  EFS
   4           65536           81919   8.0 MiB     0700  CPEFS
   5           81920           90111   4.0 MiB     0700  m9kefs1
   6           90112           98303   4.0 MiB     0700  m9kefs2
   7           98304          106495   4.0 MiB     0700  m9kefs3
   8          106496          108543   1024.0 KiB  0700  CARRIER
   9          108544          124927   8.0 MiB     0700  PARAM
  10          124928          190463   32.0 MiB    0700  BOOT
  11          190464          268287   38.0 MiB    0700  RECOVERY
  12          268288          284671   8.0 MiB     0700  OTA
  13          284672          376831   45.0 MiB    0700  RADIO
  14          376832          378879   1024.0 KiB  0700  TOMBSTONES
  15          378880          380927   1024.0 KiB  0700  DNT
  16          380928          381951   512.0 KiB   0700  PERSISTENT
  17          381952          383999   1024.0 KiB  0700  STEADY
  18          384000          393215   4.5 MiB     0700  RESERVED2
  19          393216         5513215   2.4 GiB     0700  SYSTEM
  20         5513216         5840895   160.0 MiB   0700  VENDOR
  21         5840896         5906431   32.0 MiB    0700  CACHE
  22         5906432         5916671   5.0 MiB     0700  CP_DEBUG
  23         5916672         5918719   1024.0 KiB  0700  NAD_REFER
  24         5918720        30777310   11.9 GiB    0700  USERDATA

seems like I need a different command to answer that
No, it's 0700 for all of them. Perfect, now I know that they are the same. I got the "6th column" from the script, but I guess that treats the space in the size as a column separator. :)
 

Tahir Jamil

Member
May 8, 2021
41
6
Please be clear about what you mean by "doesn't work" - it should not work as the main post says: "Supported devices" - your device is not included. Add screenshots and error messages. Do you have a custom recovery installed? If not, start with that and check the forum for your device: https://forum.xda-developers.com/c/samsung-galaxy-m20.8714/
My Device Model Is Samsung Galaxy M20 (m20lte), i know my device is not supported by this zip, i am finding a way to increase my system size to 4 gb for like 2 month's but i didn't find anything useful, only i saw one way that's called "parted" but it's way risky and i dont want to hard brick, can't install any of my favorite gsi cause there all more than 3.50 gb, while my system less than 3.40 gb, if you can help me please than help, i already installed a custom rom called lineage 20 with custom recovery called orangefox r11.1
 

Attachments

  • PXL_20230608_144218548.MP.jpg
    PXL_20230608_144218548.MP.jpg
    1.4 MB · Views: 16

Hanululu

Member
Sep 2, 2019
17
1
I don't get, why you want to use a GSI while having a fully supported model with LineageOS 20 running. The info you are providing are way to few and this is the wrong thread for it. Maybe flashing stock will reset the partition sizes, but please ask for example here https://forum.xda-developers.com/t/guide-a-b-q-m205x-how-to-install-gsis-on-galaxy-m20.4126069/ or anywhere else in the forum for your device. Running some random zip file is the best way to get your device bricked. Please don't answer, just make a new thread for this in m20 forum.
 

vzinn-rom

Member
May 6, 2023
6
0
Hello everyone, I used this rom normally without this file, this file basically increases the system memory but if I flash it I lose more internal storage or is it normally like the default device?


My device is a J6 2018 I would be happy if someone answers me here 🙂
 
Hello everyone, I used this rom normally without this file, this file basically increases the system memory but if I flash it I lose more internal storage or is it normally like the default device?


My device is a J6 2018 I would be happy if someone answers me here 🙂
This script is for increasing system space so you can use heavy roms that need more than default system space, and added vendor partition if it didn't exist, but it will wipe system, data,internal storage, cache, vendor.
And yes, the extended space is taken from internal storage.
If you don't need it, don't use it.
 
  • Like
Reactions: vzinn-rom

vzinn-rom

Member
May 6, 2023
6
0
This script is for increasing system space so you can use heavy roms that need more than default system space, and added vendor partition if it didn't exist, but it will wipe system, data,internal storage, cache, vendor.
And yes, the extended space is taken from internal storage.
If you don't need it, don't use it.
I did root with the magisk canary and appeared a participation called SYSTEM that takes up more than 2g of storage on that partition could you tell me what that? If you can and of course
 

Attachments

  • Screenshot_20230813-113140_DiskInfo.jpg
    Screenshot_20230813-113140_DiskInfo.jpg
    122.1 KB · Views: 7

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    UNIVERSAL REPARTITION SCRIPT FOR THE 7870

    DISCLAIMER
    • I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if you have any concerns about features included in this ROM before flashing it! YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
    • Flashing this script will delete system, vendor, cache and data partitions (including internal storage) so make a good backup first!

    FEATURES
    • Supported devices: A3 2017, A6 2018, J6 2018, J5 2017, J7 2016, J7 2017, J7 Nxt and J7 Prime
    • It can be flashed being in stock or modded partitions
    • It will set 4096Mb for SYSTEM, 512Mb for VENDOR, 64Mb for CACHE and 128Mb for ODM in devices that support it. You can mod these values in repartition.sh script, and set the values you want.
    • CAUTION: FLASHING IT WILL DELETE SYSTEM, VENDOR, CACHE AND ALSO DATA PARTITION, so internal storage will be wiped too!
    • To revert, best way is to flash your device PIT file in ODIN
    • Remember: FLASH AT YOUR OWN RISK!

    INSTRUCTIONS
    • Remember, your internal storage will be wiped flashing this!
    • Highly recommended to use an updated recovery
    • Flash the attached zip file. The script itself will reboot the phone in recovery once done
    • Now in recovery again, wipe system, cache and vendor and format data
    • That's all!

    SUPPORT

    CREDITS
    18
    How to set different partition sizes?

    Open universal7870_repartitioner_V1.0.zip, and extract repartition.sh file. Then open it with a text editor and locate these lines:

    SYSTEMSIZE=4096
    VENDORSIZE=512
    CACHESIZE=64

    If you wan to change, for example, SYSTEM partition size, then mod SYSTEMSIZE and set a value in Mb. If you want 2gb, then put SYSTEMSIZE=2048

    Once modded, add again repartition.sh to universal7870_repartitioner_V1.0.zip and flash it in recovery. Remember that every time you flash it, your internal stogare will be deleted.
    6
    I am seeing butter s20 experience now!!!!!!!

    UNIVERSAL REPARTITION SCRIPT FOR THE 7870

    DISCLAIMER
    • I am not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed. Please do some research if you have any concerns about features included in this ROM before flashing it! YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you.
    • Flashing this script will delete system, vendor, cache and partitions (including internal storage) so make a good backup first!

    FEATURES
    • Supported devices: A3 2017, A6 2018, J6 2018, J5 2017, J7 2016, J7 2017, J7 Nxt and J7 Prime
    • It can be flashed being in stock or modded partitions
    • It will set 4096Mb for SYSTEM, 512Mb for VENDOR, 64Mb for CACHE and 128Mb for ODM in devices that support it. You can mod these values in repartition.sh script, and set the values you want.
    • CAUTION: FLASHING IT WILL DELETE SYSTEM, VENDOR, CACHE AND ALSO DATA PARTITION, so internal storage will be wiped too!
    • To revert, best way is to flash your device PIT file in ODIN
    • Remember: FLASH AT YOUR OWN RISK!

    INSTRUCTIONS
    • Remember, your internal storage will be wiped flashing this!
    • Highly recommended to use an updated recovery
    • Flash the attached zip file. The script itself will reboot the phone in recovery once done
    • Now in recovery again, wipe system, cache and vendor and format data
    • That's all!

    SUPPORT

    CREDITS
    • @Davinash97 for ideas and tips




    KEEP IT SAR, YOU'RE THE GUARDIAN ANGEL OF EXYNOS 7870:cool:
    3
    Hi, and thanks for this script, it's helped me a lot with my phone! However, I do have a suggestion:
    At some point in time, probably when first vendorizing my phone, I have run another vendorizer partitioning script. For whatever reason, I have run it multiple times, and since that script didn't check for existing vendor partition, I have ended up with multiple vendor partitions.
    This script does check for existing vendor partition, but only for ONE partition. WIth multiple vendor partitions, it bugs out and does not delete the existing partitions, just adds another one. So I would like to suggest the following changes to the repartition.sh script:
    Diff:
    36c36
    < VENDOR=`$SGDISK --print $DISK | grep VENDOR | awk '{printf $1}'`
    ---
    > VENDOR=`$SGDISK --print $DISK | grep VENDOR | head -1 | awk '{printf $1}'`
    53,54c55,56
    <     if [ ! -z $VENDOR ]; then   
    <         VENDORPART=`$SGDISK --print $DISK | grep VENDOR | awk '{printf $1}'`
    ---
    >     while [ ! -z $VENDOR ]; do   
    >         VENDORPART=`$SGDISK --print $DISK | grep VENDOR | head -1 | awk '{printf $1}'`
    56c58,59
    <     fi
    ---
    >     VENDOR=`$SGDISK --print $DISK | grep VENDOR | head -1 | awk '{printf $1}'`
    >     done
    2
    can i use this on samsung j7 pro j730GM variant ? plz reply