[REPARTITION] Nexus 7 (2013) Repartition [FLO/DEB] [16GB/32GB] [UA TWRP]

Search This thread

Successful install on 32GB Flo with Kingston MMC (slightly smaller size than Hynix version) after a few PMs. Need to remember to format the changed partitions in TWRP after installation and reboot recovery. Installed UA Oreo and GAPPS stock just for fun... Just had to resize system with TWRP after ROM install to recover space... Waiting for Pie now that I have room for it... ;)

Thanks Clamor!
 

lollyjay

Senior Member
Jul 26, 2012
3,785
1,655
Fresno
I keep getting
dd: /dev/block/mmcblk0p2: Permission denied
after typing the first adb command
 
Last edited:

Clamor

Senior Member
Sep 4, 2013
384
685
Львів
Nvidia Tegra Note 7
@abhifx I didn't say that. This mod isn't supported officially by UA ROMs at least by now (except Asus Transformers on Tegra 3). UA uses standard partition layout same as all other flo/deb ROMs. But if this mod becomes popular enough with UA users or if system partition becomes extremely small even for clean system, than we may switch to new layout.
 
Last edited:

lollyjay

Senior Member
Jul 26, 2012
3,785
1,655
Fresno
@Clamor here is what I see in twrp now. I am unable to mount system or vendor or to flash any ROM
 

Attachments

  • Screenshot_2018-09-20-13-38-43.png
    Screenshot_2018-09-20-13-38-43.png
    77.8 KB · Views: 790

lollyjay

Senior Member
Jul 26, 2012
3,785
1,655
Fresno
Try again
Don't know why it won't upload
 

Attachments

  • TWRP.jpg
    TWRP.jpg
    183.3 KB · Views: 1,167
Last edited:

Clamor

Senior Member
Sep 4, 2013
384
685
Львів
Nvidia Tegra Note 7
For those who downloaded repartition pack before this message is published, please redownload pack since previous version might have a problems with repartition. If repartition was already made, don't worry everything should be fine. Just use up-to-date pack.
 
Last edited:

MikiGry

Senior Member
Oct 2, 2013
1,597
386
Nexus 7 (2013)
Samsung Gear S3
How do I resize in TWRP-UA ? Should I open TWRP and type "resize" ?

Is it mandatory or I can just live with a little bit too much of space taken by system partition ?

Can't install open gapps micro :/ Insufficient amount of storage available :/

Sent from my whyred using XDA Labs
 
Last edited:
  • Like
Reactions: taikichamonix

MikiGry

Senior Member
Oct 2, 2013
1,597
386
Nexus 7 (2013)
Samsung Gear S3
I've managed to install UA 8.1 after repartition process. I wasn't able to mount /system and /vendor after reparations process, but rewiping both of them fixed /system. Unfortunetely during UA installation I saw red lines "unable to mount /vendor". Wiped /system ,/cache ,/dalvik ,/data and installed UA again (this time without any errors). I I said I want able to install micro gapps (pico installed fine). Flo booted fine. After setting everything up I went to play store and installed disc info. And that's the output:

It it the app failing to calculate true capacity or repartitioning process go well ?

Sent from my whyred using XDA Labs
 

Attachments

  • IMG_20180921_224404.jpg
    IMG_20180921_224404.jpg
    215.5 KB · Views: 714
I've managed to install UA 8.1 after repartition process. I wasn't able to mount /system and /vendor after reparations process, but rewiping both of them fixed /system. Unfortunetely during UA installation I saw red lines "unable to mount /vendor". Wiped /system ,/cache ,/dalvik ,/data and installed UA again (this time without any errors). I I said I want able to install micro gapps (pico installed fine). Flo booted fine. After setting everything up I went to play store and installed disc info. And that's the output:

It it the app failing to calculate true capacity or repartitioning process go well ?

Sent from my whyred using XDA Labs

You have to resize the system partition (Wipe, Advanced Wipe, select System, Resize) to get back the space after flashing the ROM. I had to do it once (got errors), restart recovery and do it again for it to work. This is because the ROM is built for stock system size. Then you can install larger GAPPS from recovery.
 

lollyjay

Senior Member
Jul 26, 2012
3,785
1,655
Fresno
@L.F.B you gotta be kidding me this has been around since April?

Edit: And you just flashed it in TWRP? What about twrp being able to read the partitions?
 
Last edited:

Clamor

Senior Member
Sep 4, 2013
384
685
Львів
Nvidia Tegra Note 7
@L.F.B. that script is much simplier and offers less opportunities. For some device models (nexus 7 2013 for example) advanced solution is needed. Second is that I can't republish other devs work. Third is that repartition schemes are incompatible with each other and variety of them actually slows down further development. My current repartition for nexus 5 should have no problems.

@lollyjay UA TWRP is needed to support /vendor partition. Sizes aren't that important for recovery, like for system image, although sizes of partitions are published in my device trees and can be cherry-picked.
 
Last edited:
Flashable /system resize with addon.d support

Here is a flashable zip that will resize the filesystem on /system back to the full partition size after a ROM install. It also includes an addon.d script that will allow upgrades/dirty flashes with persistent GAPPS and Magisk for ROMs with addon.d support (not UA). The addon.d simply resizes the filesystem before the other persistence scripts run. Note that this zip does not change or otherwise mess with the actual partition size - that needs to be performed prior to ROM installation with Clamor's script or other method.

Simply flash after initial ROM installation. For ROMs without addon.d support (like UA), this script needs to be flashed every time before GAPPS reinstall. For ROMs with addon.d support, you only have to flash once. If you already have a ROM with addon.d support installed, flash this zip before the upgrade/dirty flash to add the addon.d script to /system.

Thanks to Clamor for support and building the flashable zip!

Tested on UA and AICP with multiple size GAPPS and Magisk but should work with any ROM...
 

Attachments

  • unified_partition_resize.zip
    5.9 KB · Views: 4,639
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 81
    Nexus 7 (2013) Repartition​

    No one is responsible for your actions except yourself. Everything written further may potentially brick your device, although risk is reduced to minimum.

    This repartition package offers 1.5G /system; a /vendor partition and it is fully backward compatible with any ROM (including stock system.img).

    Known-issues
    HTML:
    - If repartition pack says that device isn't correct,
    than, if partition table wasn't modified before,
    congrats! your device has different memory chip
    that those I worked with. No worry, PM me and
    I'll add support for it.

    DO THE BACKUPs. Repartition will erase all your data
    USB connection to PC is MANDATORY else you will not have opportunity to push ROM to your device


    Backup


    # Before processing further we highly recommend you backup persist and EFS using adb
    # Or you might lose your IMEI/WIFI + BT mac addresses

    Code:
    adb root
    adb shell
    dd if=/dev/block/mmcblk0p2 of=/sdcard/modemst1.img
    dd if=/dev/block/mmcblk0p3 of=/sdcard/modemst2.img
    dd if=/dev/block/mmcblk0p4 of=/sdcard/persist.img

    Now you can find 3 *.img files at path /sdcard. Copy them to your PC since internal memory will be erased.


    Installation
    HTML:
    # This mod is backwards compatible with any ROM so we highly recommend NOT to reverse it if repartition went well.
    # You should use ONLY recovery from this thread since other don't support all benefits of this mod.
    # When installing ROM just after you flashed zip and before installing GAPPs you MUST make a resize in TWRP since all roms are build for ~800M system.
    # Package is unified for flo and deb. To restore stock layout use same zip and steps as for repartition.
    
    1. Boot into recovery (You need to allow system partition modification to be able resize /system in recovery).
    2. Backup your data & Move your files from flash to your PC.
    3. Flash repartition pack zip.
    4. Do the actions asked by repartition pack (go to Terminal in ordinary recovery and input word that pack will tell you. Everything else will be done automatically).
    5. Phone will reboot into recovery.
    6. Install TWRP from below (it is build with support of new partitions layout and sizes. It can be differed from official TWRP by next format 3.x.x-1 UA).
    7. Format everything. (mount errors will not affect formatting!)
        - In TWRP: Wipe > Format data
        - Type yes
        - Once this completes go to: Wipe > Advanced Wipe
        - Tick all the boxes and wipe. There should be no further mount errors. (Thanks [user=7694808]@mr_rubbish[/user] for corrections in formatting).
    8. Install ROM which you like.
    9. Enjoy better flash partition layout.

    If something gone wrong - we recommend you NOT to do anything by yourself. Write here for help, else you may do only worse.

    Downloads:
    Repartitioning package
    : GitHub

    Credits:
    Special thanks to
    - Unlegacy-Android team;
    - Sudokamikaze;
    - rlw6534 for Kingston MMC layout;
    - surfrock66 for his gide for Nexus 5;

    As usual, feedback is appreciated :)

    XDA:DevDB Information
    Nexus 7 (2013) Repartition, Tool/Utility for the Nexus 7 (2013)

    Contributors
    Clamor
    Source Code: https://github.com/clamor95/android_device_unlegacy_recovery


    Version Information
    Status:
    Stable

    Created 2018-09-19
    Last Updated 2019-01-18
    17
    Common issues and F. A. Q.

    Repartition pack should be safe for most devices. Common mistakes, issues and their solution will be published here.

    1. You shouldn't flash any internal parts of repartition pack (*.sh files) only flash whole zip using TWRP. You may use my scripts for personal use or projects but authorship should to be kept.

    2. If something isn't mounting after repartition try to format partitions that don't mount using Wipe -> Advanced Wipe in TWPR. Ideally you should format in that way all partitions in Advanced Wipe menu (see 5-th step of installation guide).

    3. If you want to be sure that repartition went well I enclose loging zip. Flash it after repartition (when device reboots into TWRP). It won't modify anything only generates a partition.log in root of internal storage and outputs your current partition layout to screen. You should check if your layout is same as those fragments I provide under spoiler (file systems doesn't matter). If there are any differences you have to describe what you did and enclose partition.log to your post.


    FLO/DEB STOCK
    Code:
    22      671088640B   1551892479B   880803840B                 system
    23      1551892480B  2139095039B   587202560B                 cache

    FLO/DEB MODIFIED
    Code:
    22      614429696B   2187293695B   1572864000B                system
    23      2187293696B  2270167039B   82873344B                  cache
    ...
    30      2348843008B  2610987007B   262144000B                 vendor
    4. After flashing most ROMs system size will reduce to stock, you need to resize /system in TWRP or use flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).

    5. After returning to stock partition table you won't be able to get into the Recovery from the bootloader anymore, but when you start the tablet normally it goes straight in the Recovery. It is normal state. New partition table proposes larger /recovery size (16MB) while stock gives only 10MB. During restoring stock process, it is impossible to restore larger recovery backup into new smaller partition. Whether not to leave user without recovery excess, recovery backup restores into /boot partition. Just flash ordinary TWRP and install ROMs from it.

    6. Don't install the zip file from the USB OTG. Copy them into the /sdcard. Else you will get message after flashing repartition pack.
    Code:
    "Can not extract updater-script. Do you have it in package?
    Updating partition details...
    ...done"
    15
    Flashable /system resize with addon.d support

    Here is a flashable zip that will resize the filesystem on /system back to the full partition size after a ROM install. It also includes an addon.d script that will allow upgrades/dirty flashes with persistent GAPPS and Magisk for ROMs with addon.d support (not UA). The addon.d simply resizes the filesystem before the other persistence scripts run. Note that this zip does not change or otherwise mess with the actual partition size - that needs to be performed prior to ROM installation with Clamor's script or other method.

    Simply flash after initial ROM installation. For ROMs without addon.d support (like UA), this script needs to be flashed every time before GAPPS reinstall. For ROMs with addon.d support, you only have to flash once. If you already have a ROM with addon.d support installed, flash this zip before the upgrade/dirty flash to add the addon.d script to /system.

    Thanks to Clamor for support and building the flashable zip!

    Tested on UA and AICP with multiple size GAPPS and Magisk but should work with any ROM...
    7
    Wiping partitions after resize.

    In case someone else gets the same problem as me, I thought I'd share what I did to complete the process successfully.

    -I pushed the repartition.zip file to the device and executed it with TWRP.
    -It completed and rebooted.
    -When i tried to wipe the partitions they all failed with a mount error. Tried multiple times, identical results.
    -Pushed LineageOS zip to device and attempted install. It finished with an Error 7. Essentially a complete failure to install. I think it was something about being unable to mount one of the partitions.

    How I fixed it
    - In TWRP: Wipe > Format data
    - Type yes
    - Once this completes go to: Wipe > Advanced Wipe
    - Tick all the boxes and wipe. There should be no further mount errors.


    However, I wonder if things might have been smoother if the instructions recommended installing the custom TWRP image as step 3, instead of towards the end of the process?
    Anyway, I hope that someone finds these instructions useful!
    4
    @L.F.B. that script is much simplier and offers less opportunities. For some device models (nexus 7 2013 for example) advanced solution is needed. Second is that I can't republish other devs work. Third is that repartition schemes are incompatible with each other and variety of them actually slows down further development. My current repartition for nexus 5 should have no problems.

    @lollyjay UA TWRP is needed to support /vendor partition. Sizes aren't that important for recovery, like for system image, although sizes of partitions are published in my device trees and can be cherry-picked.