yashsingh1/xdaforums huggingface dataset:
[Nexus 7 (2013) Original Android Development] quaxe:
I followed the instructions here https://wiki.lineageos.org/devices/flox/install and successfully performed EFS/Persist Backup and installed Lineage 18.1 on Nexus 7 2013. Everything worked great, however, I'm trying to install Nethunter and I need an older version of android. I think I need to reverse the partitioning but I searched the forums and haven't been able to confirm the procedure. Can someone point me in the right direction?
[Nexus 7 (2013) Original Android Development] k23m:
To reverse it, or in other words restore stock partitions, just install sysrepart-stock.

"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
[Nexus 7 (2013) Original Android Development] quaxe:
Thanks for your response. I tried sysrepart-stock, and tried flashing the full OTA image (6.0.1) and it hangs on boot at the 4 colored icons. I also tried flashing factory image using fastboot, when I do that it gets to the google screen and immediately reboots. I did the sysrepart-stock between attempts. Doing some more research I came across your post here where you suggested using fresh persist https://xdaforums.com/t/bootloop-fix-for-nexus-7-2013-when-flashing-doesnt-help.3783564/ I also tried jackhill's method and tried flashing the old factory image even though you said it wasn't necessary because i wanted to exhaust all options before posting back here. Is this thing done for? or are there some other things I can try?
[Nexus 7 (2013) Original Android Development] k23m:
If you can use Windows, do Restock and

k23m-persist-fix2.zip

"If you see errors, copy and report them... run relog.bat and attach "relog-xxxxxx.zip" to your post."​

Post your logs in the Restock's thread. If you can not use Windows, then PM me.
[Nexus 7 (2013) Original Android Development] quaxe:
That seemed to do the trick, I ran restock.bat from Restock2 and installed k32m-persist-fix2.zip from TWRP and about 10min later it finally booted. I thought this thing was gone...Thank you!
[Nexus 7 (2013) Original Android Development] Wasuhz:
Edit: Deleted. Wrong thread
[Nexus 7 (2013) Original Android Development] olekor:
I have installed "lineage-18.1-20211008-UNOFFICIAL-flo" by using djibe Nexus 7 2013 pack using repartition "sysrepart_1280_120",

I then via TWRP("twrp-3.5.2_9-0-flo") attempt to flash gapps "MindTheGapps-11.0.0-arm-20210920_083829"- error:1,could not mount /mnt/system/aborting

also "open_gapps-arm-11.0-nano-20211007-UNOFFICIAL"- I got Error 70. Before this repartition, I have tried repartition by using "flo-deb_clamor_repartition" to flox, but again something was wrong after running the command within the ADB shell: modify.

So I was completely confused about how should be made repartition system partition.

Besides these troubles, I need to each time flash TWRP when I try to get in RECOVERY from bootloader mode.

Could be somebody who has enough experience can direct me to the right way.
[Nexus 7 (2013) Original Android Development] k23m:
You need a larger 'system' partition - use CROSS' scripts:

:coffee:
[Nexus 7 (2013) Original Android Development] olekor:
following your advice, but I don't blame you, my N7 become bricked-continuous boot GOOGLE, tried "Nexus 7 2013 Unbricking Guide for Windows 10 x64 - revised and simplified", but MiFlash doesn't recognize N7, very regret, would be better to remain, as was-in previous condition-without repartition.

Update: I have recovered by Restock to the latest stock image, but can't connect wi-fi, as I don't use a password, it's a really stupid situation.
[Nexus 7 (2013) Original Android Development] lostdistance:
I landed on this page because I encountered the same "mke2fs" command failures. In case it may be of help to others, this is how I fixed it.

I was installing lineage-18.1-20211206 on my Nexus 7 (2013), which previously had Google's stock Android 6.0.1 (MOB30X). My host was a Linux PC.

The installation instructions proceeded smoothly until I loaded the flo-deb_clamor_repartition_20201203.zip repartition scripts and ran the "modify" command (output attached). The "modify" command reported some progress, some errors, and then seemed to hang.

Eventually I decided to terminate adb by hitting Control-C. To my surprise this did not terminate adb, as I expected, but instead terminated the "modify" command (or whatever followed), returning me to the adb shell prompt. This then provided the opportunity to complete the "modify" command by hand.

After reviewing the repartition scripts within the ZIP file, I was able to determine that it was flo-deb_kingston_repartition_32GB.sh which failed. Specifically, the four "mkfs.ext4" commands:

mkfs.ext4 /dev/block/mmcblk0p22
mkfs.ext4 /dev/block/mmcblk0p23
mkfs.ext4 /dev/block/mmcblk0p30
mkfs.ext4 /dev/block/mmcblk0p31

When I ran these directly from the adb shell they succeeded. I then resumed the installation instructions by rebooting the device. Eventually I finished the installation successfully. My Nexus 7 is now running LineageOS 18.1, seemingly without any problems.

If I were to guess as to what went wrong with the repartition script, I would suspect a race condition between the "parted" command and the subsequent "mkfs.ext4" commands. The repartition script made no attempt to ensure that the partition table changes had propagated throughout the system before attempting to use them. This is achieved in Linux, for example, by using the "blockdev", "partx", "hdparm", or "partprobe" commands. I would presume that adb shell has something similar available to it.
[Nexus 7 (2013) Original Android Development] jhford:
Is your device a Flo or a Deb and does it have16GB or 32GB of storage?
[Nexus 7 (2013) Original Android Development] lostdistance:
It's a Flo (Wi-Fi) with 32GB of storage.
[Nexus 7 (2013) Original Android Development] jhford:
Did you think the repartition will work on a 16GB device? I'm trying to build one for my sister-in-law.
[Nexus 7 (2013) Original Android Development] lostdistance:
As far as I can tell yes. The ZIP file contains repartition scripts for both 16GB and 32GB devices. If the scripts cannot verify your device then they will print "This is not Nexus 7 (2013)".
[Nexus 7 (2013) Original Android Development] jhford:
OK. I've downloaded you modify.txt file. How do I use it? Thanks
[Nexus 7 (2013) Original Android Development] lostdistance:
My modify.txt file is output from my adb shell; it is not a script that can be run. To install LineageOS you need to acquire the downloads and follow the associated installation instructions.
[Nexus 7 (2013) Original Android Development] Kick-Ass Joe:
Hi, if I used "sysrepart_1380_20.zip" for lineage-19.0-20211212-UNOFFICIAL-flo.zip, how do I return to stock 6.0.1 (MOB30X)?
[Nexus 7 (2013) Original Android Development] extremko:
I think I have a big problem. Let me try to describe what I did and hopefully someone can help me out of a bricked Nexus.

This is what happened, to the best of my recollection:

I followed the "Install LineageOS on flox" tutorial - https://wiki.lineageos.org/devices/flox/install

Got to the Repartition section, step 4. I started the adb shell and executed "modify".

The command seems to have been running fine, but at some point just stopped. No changes or updates on either the terminal or the Nexus.

This is a paste from the terminal: https://justpaste.it/84c0f

At that point, I suspected my USB cable got disconnected so I didn't get the update. I replugged the cable and continued. If there was an error, further steps would fail, right?

Rebooted to recovery because the device didn't reboot itself automatically. I probably should have started freaking out here. I continued with steps 6 and 7. Wipe data and flash new Lineage recovery over TWRP

> fastboot -w

> fastboot flash recovery lineage-18.1-20211227-recovery-flox.img

Well, ****. My new Lineage recovery started reporting issues with file system mount points.

Image:

Text at the bottom:

E:Failed to bind mount /mnt/staging/emulated/media/0 to /storage/emulated: No such file or directory
E:emulated failed to bind mount /mnt/staging/emulated/media/0 to /storage/emulated: No such file or directory

NOW I started freaking out.

OK, OK... I will just sideload Clamor Repartition zip again, like in the step 3.

> adb sideload flo-deb_clamor_repartition_20201203.zip
adb: sideload connection failed: 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.
adb: trying pre-KitKat sideload method...
adb: pre-KitKat sideload connection failed: 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.

What?

> adb devices
List of devices attached
090a26b7 unauthorized

No!!!

I checked "C:\Users\username\.android" and it has keys. Three files are present:

- adb_usb.ini

- adbkey

- adbkey.pub

adb_use.ini looks weird, a bunch of "0x####" which is probably normal

adbkey is a standard-looking private key

adbkey.pub looks like a public key, but ends with "unknown@unknown". Not sure if it did before. Had no reason to look :|

So now Nexus won't boot. And recovery doesn't work. I tried wiping and factory resetting. Nothing worked.

I can now throw away by dear old Nexus 7 now, right? :'(
[Nexus 7 (2013) Original Android Development] extremko:
Hm. I managed to get recovery to "Apply update". Command 'adb devices' then shows

> adb devices
List of devices attached
090a26b7 sideload

I tried sideloading Clamor again, but that doesn't help, even though the result is "Install completed with status 0."

I still cannot get adb shell to work because device is still unauthorized.

> adb devices
List of devices attached
090a26b7 unauthorized

I think I probably deleted by computer key from Nexus when I wiped all the storages and need to bring it back in. Is there a way to use Sideload to push my key in somehow so the tablet trusts me again?

Then I can probably do all the other steps to recover from failed repartitioning... :/
[Nexus 7 (2013) Original Android Development] k23m:
Please don't as there is a very simple way to recover from this situation and automatically repartition and install flox.

Get CROSS and run lineage-install-3-flox.bat

Should there be any problems, post them in the CROSS' thread.
[Nexus 7 (2013) Original Android Development] extremko:
Thank you! I think I'm in a much better place now, although still having issues. I've posted a new comment in the CROSS thread.
[Nexus 7 (2013) Original Android Development] NightLord:
What is the point in adding a vendor partition for the N7? To my understanding having a vendor partition could provide for compatibility with GSI's, but I havent seen any vendor images for N7 floating around. If there is nothing to flash onto it, it is just a waste of space.
[Nexus 7 (2013) Original Android Development] Propagandaminister:
I ran in exactly the same issue.

The keys are not gone when wiping - you just have to "enable ADB" in advanced menu of the recovery tool when using the shell commands.

You probably did enable ADB the first time when repartitioning because in the instructions it is mentioned in step 2 under EFS/Persist Backup and stayed enabled for the next steps. Otherwise you would have gotten the unauthorized message before.
[Nexus 7 (2013) Original Android Development] extremko:
Thanks for the advice!

But it's all resolved a long time ago thanks to @k23m and his tool CROSS. Simply an epic piece of code. Immensely helpful.
[Nexus 7 (2013) Original Android Development] lelemka0:
I have a problem after repartitioning, I can't use reboot recovery to enter recovery in system or recovery, and can't select recovery mode in bootloader to enter recovery, they are all stuck in google screen.

I'm sure I've flashed the correct bootable recovery, I've tried fastboot boot FILENAME.img and got into twrp successfully.

The only way to get into recovery right now is to hold down the volume + and power keys while powered off.

This prevents me from using system updates properly. Can someone tell me what to do?

The current partition table is as follows.

~ # parted /dev/block/mmcblk0 unit b p quit
Model: MMC HBG4e (sd/mmc)
Disk /dev/block/mmcblk0: 31272730624B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 67108864B 156745727B 89636864B fat16 radio
2 201326592B 204472319B 3145728B modemst1
3 204472320B 207618047B 3145728B modemst2
4 268435456B 283795455B 15360000B ext4 persist
5 335544320B 336343039B 798720B m9kefs1
6 336343040B 337141759B 798720B m9kefs2
7 402653184B 403451903B 798720B m9kefs3
8 403451904B 406597631B 3145728B fsg
9 469762048B 471298047B 1536000B sbl1
10 471298048B 472834047B 1536000B sbl2
11 472834048B 474931199B 2097152B sbl3
12 474931200B 480174079B 5242880B aboot
13 480174080B 480698367B 524288B rpm
14 536870912B 553648127B 16777216B boot
15 603979776B 604504063B 524288B tz
16 604504064B 604505087B 1024B pad
17 604505088B 606041087B 1536000B sbl2b
18 606041088B 608138239B 2097152B sbl3b
19 608138240B 613381119B 5242880B abootb
20 613381120B 613905407B 524288B rpmb
21 613905408B 614429695B 524288B tzb
22 614429696B 2187293695B 1572864000B ext2 system
23 2187293696B 2263875583B 76581888B ext4 cache
24 2263875584B 2264924159B 1048576B misc
25 2264924160B 2281701375B 16777216B recovery
26 2281701376B 2281709567B 8192B DDR
27 2281709568B 2281717759B 8192B ssd
28 2281717760B 2281718783B 1024B m9kefsc
29 2348810240B 2348843007B 32768B metadata
30 2348843008B 2610987007B 262144000B ext2 vendor
31 2610987008B 31272713727B 28661726720B ext4 userdata
[Nexus 7 (2013) Original Android Development] eniac2000:
Hello together. I am new in the forum and I think I have a similar problem with my Nexus 7. I tried to update the tablet to LineageOS 18.1 with the manual of Lineage. While the process I got an Error in the Repartition part.

I powered off the tablet and on again but it could not boot. I can still enter the Fastboot Mode.

I had tried to do a factory reset but I get the Error: "Partion table doesn't exists"

Could you please help me to run LineageOS 18.1 on the tablet?
[Nexus 7 (2013) Original Android Development] k23m:
1 - https://xdaforums.com/t/restock-sto...r-and-reset-including-usb-driver-fix.3995981/

then

2 - https://xdaforums.com/t/iiiii-cross-custom-rom-scripted-setup.4092215/
[Nexus 7 (2013) Original Android Development] eniac2000:
I did all steps from Point 1 with one exception: safe-unlock.bat

Afterwards I tried to install lineage-install-3-flox.bat but where I can find that *.bat file?
[Nexus 7 (2013) Original Android Development] Altarentys:
Hi, it looks like loging zip doesn't exist anymore, where can I find it ? (got error 404 when i click the link in the OP)

edit: I don't need it anymore for now
[Nexus 7 (2013) Original Android Development] bettzysdaddy:
So I believe I repartitioned my 16GB Flo, but when I tried to install Lineage 18, it said "this is for flox, and this device is flo", so I'm wondering if I did anything wrong? I went ahead and flashed an unofficial Lineage 19 ROM because I didn't have an OS, so any help as to why official Lineage 18 for flox didn't recognize my tablet as repartitioned? Thank you
[Nexus 7 (2013) Original Android Development] unclebob123abc:
Hi All, Is there support still available for this?

I am trying to go from Flo to Flox, but seem to be stuck.

I tried to sideload flo-deb_clamour_repartition.zip which went ok - used terminal to enter modified, went ok no errors.

Did the formatting. When I try and load Linage-18.1-20230301 i get an error - E304: This package is for device flox; this device is flo.

Any tips on where to look for whats gone wrong?

EDIT: I managed to get it working - formatting from the recovery image linked didnt seem to format correctly, found a different recovery from lineageos to format that that step has completed ok.
[Nexus 7 (2013) Original Android Development] sh0nuff:
A bit late to the game, just looking at updating my N7 Deb to Lineage 18/19/20 ... I saw there's a flash in the Cross thread that mentions a sysrepart-ultimate.zip file that ups the system to 4GB vs 1.5, is this not advisable seeing as this thread has more recent posts/comments?
[Nexus 7 (2013) Original Android Development] Neffy27:
I also messed up this process last night. There's no point in trying to run the script again expecting a different result. In the Github, the source code of the script is there. Since you're able to get to the bootloader, I manually fastboot boot twrp recovery image and manually ran the steps in the source scripts via terminal. This got me back to being able to have a good recovery and get a ROM installed.
[Nexus 7 (2013) Original Android Development] Rosyjazz:
I am grateful for this wonderful information. However, unfortunately, thee instructions are NOT really clear enough instructions for me…I have flashed zips and installed apk’s, but have not fooled around with ADB at all. In fact, I am quite lost! My silly brain just can’t seem to comprehend it!

Do I simply put these files onto my N7, and use TWRP to install them? Any particular order? Will I still need to go into ADB for anything? How do I keep my wifi/BT drivers? Will titanium backup do that? How the heck do I even get into ADB? I keep tyoing it in my (admin) terminal...

adb : The term 'adb' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the

spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

+ adb root

+ ~~~

+ CategoryInfo : ObjectNotFound: (adb:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

I am unlocked and rooted with Nexus Toolkit (which I like a lot!) I have TWRP 3.7.0_9-1. I am currently using Pure Nexus 7.1.2. And BeansGapps –Mini-7.1.x-20170725.

I do understand how to Root, unlock and use TWRP, install zip and apk files... Heck, I have even learned how to build a desktop pc...computer language is just not my thing! :(

I really would love to install 18.1 or even 20!

Help is quite appreciated.

TIA!
[Nexus 7 (2013) Original Android Development] AndroidFanMan:
Getting the message "This is not Nexus 7 (2013)". TWRP 3.2.3-0 with Lineage OS 15.1 installed. Trying to flash from sideload or from internal doesn't matter in TWRP.

Not sure what else I can do to make it work.
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=5526640]AndroidFanMan[/MENTION] lets start from partition.log
[Nexus 7 (2013) Original Android Development] AndroidFanMan:
Here we go.

Model: MMC HAG2e (sd/mmc)

Disk /dev/block/mmcblk0: 15762194432B

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 67108864B 156745727B 89636864B fat16 radio

2 201326592B 204472319B 3145728B modemst1

3 204472320B 207618047B 3145728B modemst2

4 268435456B 283795455B 15360000B ext4 persist

5 335544320B 336343039B 798720B m9kefs1

6 336343040B 337141759B 798720B m9kefs2

7 402653184B 403451903B 798720B m9kefs3

8 403451904B 406597631B 3145728B fsg

9 469762048B 471298047B 1536000B sbl1

10 471298048B 472834047B 1536000B sbl2

11 472834048B 474931199B 2097152B sbl3

12 474931200B 480174079B 5242880B aboot

13 480174080B 480698367B 524288B rpm

14 536870912B 553648127B 16777216B boot

15 603979776B 604504063B 524288B tz

16 604504064B 604505087B 1024B pad

17 604505088B 606041087B 1536000B sbl2b

18 606041088B 608138239B 2097152B sbl3b

19 608138240B 613381119B 5242880B abootb

20 613381120B 613905407B 524288B rpmb

21 613905408B 614429695B 524288B tzb

22 671088640B 1551892479B 880803840B ext2 system

23 1551892480B 2139095039B 587202560B ext4 cache

24 2147483648B 2148532223B 1048576B misc

25 2214592512B 2225078271B 10485760B recovery

26 2281701376B 2281709567B 8192B DDR

27 2281709568B 2281717759B 8192B ssd

28 2281717760B 2281718783B 1024B m9kefsc

29 2348810240B 2348843007B 32768B metadata

30 2415919104B 15762177535B 13346258432B ext4 userdata
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=5526640]AndroidFanMan[/MENTION] you have unknown before MMC chip, congrats! I'll send you a PM when repartition pack will be updated.
[Nexus 7 (2013) Original Android Development] Thracks:
This is not working for my 16GB Nexus 7 2013.

Steps:

1) Restored the latest stock factory image (6.0.1 from Google).

2) Flash the latest official TWRP (v3.2.3.0).

2a) Now my system is in a 100% fresh state, with OEM partitions and the expected recovery.

3) Follow the steps outlined in this post EXACTLY. No errors occur during this process.

4) Return to new -UA recovery & attempt to wipe partitions.

5) Cannot mount /system, /data, /storage

I have repeated these steps twice to rule out user error. I am 100% confident I am following the steps correctly.

What's next? I have return back to the latest factory image + official TWRP and await your guidance. :)
[Nexus 7 (2013) Original Android Development] MikiGry:
Format those partitions a few times. I had a problem with can't mount /vendor error. It disappeared after 3rd format of /vendor
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=2562511]Thracks[/MENTION] you shouldn't return to stock. Take a partition.log or if no /data, take photos of log on screen in TWTP.
[Nexus 7 (2013) Original Android Development] rlw6534:
I think I had to wipe everything twice, rebooting recovery before things were normal. I also did wipe, advanced wipe, resizefs on everything as well (twice) just to make sure the filesystem was using the entire partition. Not sure which was the fix but I have done it more than once successfully this way.
[Nexus 7 (2013) Original Android Development] lollyjay:
[MENTION=5424240]Clamor[/MENTION] here is my partition log after repartition. Was it successful?
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=4762414]lollyjay[/MENTION] you had to just look into second post to verify, no need in posting logs if they match sizes from there. But yeah, repartition went totally fine.
[Nexus 7 (2013) Original Android Development] MikiGry:
Is there any chance, that repartition can be somehow incompatible with other roms and it's causing them to lag and act wirdly ?
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=5468078]MikiGry[/MENTION] nah, partitions have nothing to do with ROMs. If you have lags than it is ROM developer issue not partition layout.

P.S. I used this layout for more than half of year with different UA builds (7.1/8.1) including experimental and I didn't have any problems
[Nexus 7 (2013) Original Android Development] lollyjay:
Yes sorry I didn't tap the button to open the information.
[Nexus 7 (2013) Original Android Development] MikiGry:
Then it's something on my side :/

I faced that issue on latest UA and DU 12.1.5 . Basicly Flo is very choppy and laggy. Especially scrolling. It's awfull. For some reason MP decisions keeps 2/4 cores online with 2nd (as core are numerated from 0-3) core active from time to time. 3rd core is almost never used. Installing kernel audiator and toggling 3rd core brings it (after a few attempts) online, but totally beaks MP decisions (tons on "error switching x core offline" errors in logcat and 4 cores active all the time)

. To fix that, clean flash of a rom is required

Does it happen to your Flo on latest UA ?
[Nexus 7 (2013) Original Android Development] Clamor:
[MENTION=5468078]MikiGry[/MENTION] I didn't ever had any problems with my flo (except that sensors problems described in UA rom thread). He has some excessive heating at video playback and microlags, but no choppiness. I"ll install Adiutor and check.
[Nexus 7 (2013) Original Android Development] MikiGry:
I think i found the circuit. Magisk was causing it. The way i was installing it exactly (ROM + Gapps --> reboot and setup --> reboot recovery, install magisk ---> reboot). Installing it just after gapps and then rebooting seems to fix choppyness and lags problem (at least with LOS)