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

Search This thread

Troops42

Member
Feb 20, 2015
14
0
Not sure if this helps but while researching bricked N7'13 devices, I found a thread and in fastboot I was able to gather somemore info:

[email protected]:~$ fastboot getvar all
(bootloader) version-bootloader: FLO-04.08
(bootloader) version-baseband: none
(bootloader) version-hardware: rev_e
(bootloader) version-cdma: N/A
(bootloader) variant: flo 16G
(bootloader) serialno: 071e4c05
(bootloader) product: flo
(bootloader) secure_boot: enabled
(bootloader) lock_state: unlocked
(bootloader) project: flo
(bootloader) off-mode-charge: yes
(bootloader) uart-on: no
(bootloader) partition-type:bootloader: emmc
(bootloader) partition-size:bootloader: 0x0000000000aee000
(bootloader) partition-type:recovery: emmc
(bootloader) partition-size:recovery: 0x0000000001000000
(bootloader) partition-type:boot: emmc
(bootloader) partition-size:boot: 0x0000000001000000
(bootloader) partition-type:system: ext4
(bootloader) partition-size:system: 0x000000005dc00000
(bootloader) partition-type:cache: ext4
(bootloader) partition-size:cache: 0x0000000004908c00
(bootloader) partition-type:userdata: ext4
(bootloader) partition-size:userdata: 0x00000002fe5f3e00
all:
finished. total time: 0.858s
 

Aiden2765

New member
Feb 9, 2021
2
0
hey look its been awhile on this thread but i was just wondering if anything had chamged because i download the proper file then it says on my nexus that its ready to go back to stock
 

Aiden2765

New member
Feb 9, 2021
2
0
What is the proper file maybe ill try it
Hey man I talked to the creator of this tool and helped me through it, basically I used another partitioning kit and the Clamor kit thought it was it so I was unable to reparation, but I had to reflash the normal rom using the flash all tool built into the rom file for the nexus 7 because it rebuilds the partitions from scratch.
 

zosX

Senior Member
Nov 14, 2010
116
6
I'm getting an error: 1 and its saying this isn't a Nexus 7. I started with the repartition script for Lineage OS 18.1 and it gave me an error 1. So I thought since I had repartitioned years ago that I needed to maybe go back to stock sizes for it to work. But this script isn't working either. So now I have a device that's just wiped. I can still get into fastboot at least. I have no way of really logging anything since my partitions are now wiped. All I'm seeing is the TWRP folder in windows. What the hell do I do now? :(
 

zosX

Senior Member
Nov 14, 2010
116
6
You could install everything (including repartition) automatically in one go with CROSS.
Nothing to lose at this point LOL. I'll give it a shot. I tried the old repart back to stock script someone wrote yesterday and while it looks like my partitions are more in line with stock now (900mb system for instance) it is still saying its not a nexus 7. I'll try Cross and report back.
 

zosX

Senior Member
Nov 14, 2010
116
6
You could install everything (including repartition) automatically in one go with CROSS.

I ran restock to be on the safe side and then Cross. You're my hero. You win the award for easiest rom installation ever. Gapps came up corrupt so I just sideloaded one over ADB. No big. just getting the rom going was good. It was funny seeing the old stock boot up animation. That sure brought back some memories.
 

OhioYJ

Senior Member
Feb 25, 2011
1,462
729
So I started trying to convert a couple of my old flo tablets to LOS 18.1 (they were on 14.1). I ran the script on the first one, and I thought it had stopped, as it was doing nothing for a while. Ctrl+C'd, which apprently may have been a mistake (dumb I know, but I thought it had been long enough). Then before I found this thread, I restored the factory image. Booted it. Could not run the script again. Re-installed LOS 14.1, could not run the script again.

It always says this, when I type "modify":

/system/bin/sh: modify: inaccessible or not found
 

captaintrav

New member
Apr 7, 2015
3
0
I successfully re-partioned and installed TWRP downloaded in this thread, wiped the data, but my device is still "flo" and not "flox". What am I missing here?
 

OhioYJ

Senior Member
Feb 25, 2011
1,462
729
So I started trying to convert a couple of my old flo tablets to LOS 18.1 (they were on 14.1). I ran the script on the first one, and I thought it had stopped, as it was doing nothing for a while. Ctrl+C'd, which apprently may have been a mistake (dumb I know, but I thought it had been long enough). Then before I found this thread, I restored the factory image. Booted it. Could not run the script again. Re-installed LOS 14.1, could not run the script again.

It always says this, when I type "modify":

/system/bin/sh: modify: inaccessible or not found

Ok, so I got it working.

- I booted up a Windows machine and tried the CROSS script above. This did not work. In fact it said my memory was bad (well one possibility). However it would still boot the stock ROM, and LOS 14.1, so that didn't quite seem right.
- The other ZIPs, in the CROSS thread and TWRP there did end up fixing my issue. Between going back to stock partition, and using the ultimate zip I was able to flash LOS 18.

Pretty sure something got borked in the partitions during this process originally, I'm just not sure what.
 

jhford

Senior Member
Oct 28, 2005
515
65
Moto G Power
I'm a user of your repartition tool, and I hope this is not the wrong forum in which to ask the following question. The partitions of one of my 2 Nexus 7 2013 mobile (4G/LTE) tablets are totally screwed up. What's the best method to restore all of the partitions back to stock so I can flash your partition tool on a pristine system? Thank you.
 

k23m

Senior Member
  • Jan 3, 2016
    897
    500
    which files to flash in order to create a bigger system partition.

    The partitions of one of my 2 Nexus 7 2013 mobile (4G/LTE) tablets are totally screwed up. What's the best method to restore all of the partitions back to stock so I can flash your partition tool on a pristine system? Thank you.


    "To recover from other repartition attempts, simply install sysrepart-ultimate if you intend to use LOS17+ or sysrepart-stock if you have other plans. If direct sysrepart installation is impossible due to TWRP or GPT issues, run the repartition.bat script."

    CROSS - Custom ROM Scripted Setup
     

    ZoltanG

    Member
    May 11, 2019
    5
    0
    I wanted to install LineageOS 18.1 and followed their wiki (https://wiki.lineageos.org/devices/flox/install) but the repartitioning was unsuccessful.
    It is part of the story, that earlier I have already used 2 different repartition scripts (the first one gave me 1195 Mb, the second 1280 Mb)
    Before I first time flashed flo-deb_clamor_repartition_20201203.zip I didn't change back to stock.

    Here is a list of the outputs to the screen:

    [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb sideload flo-deb_clamor_repartition_20201203.zip Total xfer: 1.00x [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb shell error: device unauthorized. This adb server's $ADB_VENDOR_KEYS is not set Try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device. #### #### Here I enabled ADB as it was not done previously #### #### Messages on the tablet's screen: E:[libfs_mgr]Failed to mount /cache: Invalid argument E:Failed to mount /cache/recovery/last_locale E:[libfs_mgr]Failed to mount /cache: Invalid argument Enabled ADB #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb shell flox:/ # modify 2048+0 records in 2048+0 records out 1048576 bytes (1.0 M) copied, 0.100525 s, 10 M/s 20480+0 records in 20480+0 records out 10485760 bytes (10 M) copied, 0.287475 s, 35 M/s umount: /mnt/system: Invalid argument umount: /data: Invalid argument umount: /sdcard: Invalid argument umount: /cache: Invalid argument GNU Parted 1.8.8.1.179-aef3 Using /dev/block/mmcblk0 Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) rm 22 (parted) rm 23 (parted) rm 24 (parted) rm 25 (parted) rm 30 (parted) mkpart primary 614429696B 2187293695B (parted) name 22 system (parted) mkpart primary 2187293696B 2263875583B (parted) name 23 cache (parted) mkpart primary 2263875584B 2264924159B (parted) name 24 misc (parted) mkpart primary 2264924160B 2281701375B (parted) name 25 recovery (parted) mkpart primary 2348843008B 2610987007B (parted) name 30 vendor (parted) mkpart primary 2610987008B 31272713727B (parted) name 31 userdata (parted) quit Information: You may need to update /etc/fstab. mke2fs 1.45.4 (23-Sep-2019) The file /dev/block/mmcblk0p22 does not exist and no size was specified. mke2fs 1.45.4 (23-Sep-2019) The file /dev/block/mmcblk0p23 does not exist and no size was specified. mke2fs 1.45.4 (23-Sep-2019) The file /dev/block/mmcblk0p30 does not exist and no size was specified. mke2fs 1.45.4 (23-Sep-2019) The file /dev/block/mmcblk0p31 does not exist and no size was specified. 2048+0 records in 2048+0 records out 1048576 bytes (1.0 M) copied, 0.218598 s, 4.5 M/s 20480+0 records in 20480+0 records out 10485760 bytes (10 M) copied, 2.087799 s, 4.7 M/s #### #### Here I was waiting about 6-7 minutes and as nothing moved I tried to do something in Lineage Recovery. Pushed Volume Up/Down and Power On/Off on the tablet. Suddenly it rebooted, the Google sign and the "unlocked" symbol came up. I waited again about 5 minutes and then rebooted the tablet in Bootloader mode. #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ fastboot devices 077a734c fastboot [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb devices List of devices attached [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ fastboot boot lineage-18.1-20210419-recovery-flox.img downloading 'boot.img'... OKAY [ 0.355s] booting... OKAY [ 0.035s] finished. total time: 0.390s #### #### Here I enabled ADB in Lineage Recovery #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb devices List of devices attached 077a734c recovery [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ fastboot devices #### #### I tried to flash again the repartitioning script #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb sideload flo-deb_clamor_repartition_20201203.zip Total xfer: 0.00x #### #### Messages on the tablet's screen: #### Now send the package you want to apply to the device with "adb sideload <filename>"... Supported API 3 Finding update package... E:[libfs_mgr]Failed to mount /cache: Invalid argument E:Failed to mount /cache E:Failed to set up expected mounts for install: aborting E:[libfs_mgr]Failed to mount /cache: Invalid argument #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb devices List of devices attached 077a734c recovery [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb sideload flo-deb_clamor_repartition_20201203.zip adb: sideload connection failed: closed adb: trying pre-KitKat sideload method... adb: pre-KitKat sideload connection failed: closed [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ adb push sysrepart_1280_120.zip /sdcard/ sysrepart_1280_120.zip: 1 file pushed. 7.7 MB/s (827984 bytes in 0.102s) [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ #### #### tryed to reboot to Recovery, but only the Google sign and the "unlocked" symbol came up and after about 15-20 seconds it tried to load it again and again, no success. Turned it off and restarted in Bootloader. Fastboot devices still can see it. Booted up TWRP recovery temporarily: #### [email protected]:~/Downloads/Android ROMs & setup tools/setups/ROMS/LineageOS 18.1$ fastboot boot twrp-3.0.2-0-flo.img downloading 'boot.img'... OKAY [ 0.291s] booting... OKAY [ 0.029s] finished. total time: 0.320s
    When TWRP started I flashed again flo-deb_clamor_repartition_20201203.zip and it directed me to go to Terminal and write the word: stock
    From there I could boot the original ROM (Validus 8.1 custom rom) and everything worked like if nothing had happened before.

    I'm really lucky I got my tablet back again as I did a lot of mistake, for sure.
    Now I finally found this thread and learned a lot about the possible problems and their handling.

    I downloaded the repartition zip, the partition_resize.zip and the flo-recovery.img and want to try again with these by following your instructions. (However I could't open the web page to get loging.zip Is there any other place to get it from?

    Knowing what I did before, would you recommend any preliminary steps?
     

    ZoltanG

    Member
    May 11, 2019
    5
    0
    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"
    I tried to download the loging.zip but I got a 404 Not Found error. Is there any other place where I could get it from? Thanks.
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 75
      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
      16
      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.
    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