• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[+]RESTOCK - stock restore, repartition, repair and reset, including USB driver fix

Search This thread

jhford

Senior Member
I bet it is a USB connectivity issue, typical things... the internal wide silver cable, dry-jointed USB port, or maybe USB cable itself.

Please "Run getlog.bat and include "getlog.log" in your post."

If getlog shows 'Device not found...' then there is something wrong on the USB path.
Pardon the delay. Today I soldered the USB charging port pins as you suggested. Not a beautiful soldering job, but it apparently worked, and your assessment was correct, because I have installed Ripee's LOS 17.1, Open Gapps, Magisk, and all of my apps using the Play Store app, Migrate. So, now i have 3 debs with identical 17.1 installations. I wrapped them in brand new Poetic folio cases, my favorite, to celebrate their birthdays,
Thanks for you help
Now I'd like to upgrade my 3 eMMCs to 128GB, if possible, but I haven't spent the time to read the entire relevant tread. Any step-wise shortcuts?
[EDIT] My soldering job was pretty lame after all. I can transfer data just fine but it won't charge. Şo, I'm hunting for a 4G/LTE charging board.
 
Last edited:

k23m

Senior Member
Jan 3, 2016
935
539
Pardon the delay. Today I soldered the USB charging port pins as you suggested. Not a beautiful soldering job, but it apparently worked, and your assessment was correct, because I have installed Ripee's LOS 17.1, Open Gapps, Magisk, and all of my apps using the Play Store app, Migrate. So, now i have 3 debs with identical 17.1 installations. I wrapped them in brand new Poetic folio cases, my favorite, to celebrate their birthdays,
Thanks for you help
Now I'd like to upgrade my 3 eMMCs to 128GB, if possible, but I haven't spent the time to read the entire relevant tread. Any step-wise shortcuts?
Unless you are skilled and equipped for BGA soldering, it is not an option.
Then there is the issue of DEB ROM and TWRP kernel mods for eMMC v5.1.
I don't think DEB mods exist and you'd have to compile them yourself.

In summary, there are preconditions, obstacles and no shortcuts.
This is worthwhile on N7s with faulty eMMC, but not as an upgrade.

(y)
 

jhford

Senior Member
Unless you are skilled and equipped for BGA soldering, it is not an option.
Then there is the issue of DEB ROM and TWRP kernel mods for eMMC v5.1.
I don't think DEB mods exist and you'd have to compile them yourself.

In summary, there are preconditions, obstacles and no shortcuts.
This is worthwhile on N7s with faulty eMMC, but not as an upgrade.

(y)
Thanks. I'll stick with 32GB.
 

jhford

Senior Member
@Km23. Sorry to bother you but you're my most intelligent/knowledgeable Nexus 7 source.

I'm still having some issues with my debs, which I've named 1, 2 & 3. Skipping #1, #2 is much slower than #3. I wiped Dalvik & Cache on both trying to speed them up. Please see attached images. #2 has the red ink which you earlier told me to ignore. Do you still have the same opinion?

Also, debs have 2 antenna cables, grey for WiFi and black for cell data, which run from motherboard to.charging board. They connect to teeny connectors. The issue is that I can't connect them; it's impossible. But I can connect to WiFi and T-Mobile for cell, nonetheless. Does that mean that the cables are really superfluous?
Thanks again
 

Attachments

  • 3.jpg
    3.jpg
    1.9 MB · Views: 12
  • 2.jpg
    2.jpg
    1.9 MB · Views: 13

jhford

Senior Member
@k23m. Sorry to bother you but you're my most intelligent/knowledgeable Nexus 7 source.

I'm still having some issues with my debs, which I've named 1, 2 & 3. Skipping #1, #2 is much slower than #3. I wiped Dalvik & Cache on both trying to speed them up. Please see attached images. #2 has the red ink which you earlier told me to ignore. Do you still have the same opinion?

Also, debs have 2 antenna cables, grey for WiFi and black for cell data, which run from motherboard to.charging board. They connect to teeny connectors. The issue is that I can't connect them; it's impossible. But I can connect to WiFi and T-Mobile for cell, nonetheless. Does that mean that the cables are really superfluous?
Thanks again
 

k23m

Senior Member
Jan 3, 2016
935
539
#2 is much slower than #3. I wiped Dalvik & Cache on both trying to speed them up

But you're not describing what ROM, partitioning or TWRP is used, nor attaching any logs. Anyway, try the following on deb #2:
  1. RESTOCK2 and reboot
  2. FSTRIM - For optimal eMMC performance run fstrim.bat from time to time. (it is in RESTOCK2 package)
  3. quote your benchmark scores
  4. If you see errors (on stock ROM), copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.
Again, I support only stock ROM :)


debs have 2 antenna cables.... Does that mean that the cables are really superfluous?

No, they use so-called diversity antennas, or simply put, more than one to improve RF range and performance. So when you disconnect one of them everything still works.

(y)
 
  • Like
  • Love
Reactions: ipdev and osm0sis

jhford

Senior Member
But you're not describing what ROM, partitioning or TWRP is used, nor attaching any logs. Anyway, try the following on deb #2:
  1. RESTOCK2 and reboot
  2. FSTRIM - For optimal eMMC performance run fstrim.bat from time to time. (it is in RESTOCK2 package)
  3. quote your benchmark scores
  4. If you see errors (on stock ROM), copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.
Again, I support only stock ROM :)




No, they use so-called diversity antennas, or simply put, more than one to improve RF range and performance. So when you disconnect one of them everything still works.

(y)
What if both are disconnected? Also, you use TWRP 3.3.1-0, but I have been using TWRP 3.4.0-0, the deb version. Could this be one of the sources of my problems? Also, I ran the CF-Bench full benchmark but have no idea where the results are output so I can create a zip file or use its natively output zip file.
[EDIT] The log files are attached, but, as mentioned, above, I can't find the benchmark file.
[EDIT2] I couldn't for life of me figure out how to generate a benchmark report from CF-Bench, so I typed it manually in Notepad and zipped it. See attached.
[EDIT 3] I forgot to answer one of your questions. I was running Ripee's LineageOS 17.1 ROM prior to using Restock2 today.
 

Attachments

  • relog-17215953.zip
    45.9 KB · Views: 2
  • getlog.zip
    5.8 KB · Views: 1
  • CF-Benh.zip
    494 bytes · Views: 2
Last edited:

k23m

Senior Member
Jan 3, 2016
935
539
I uninstalled the drivers from Device Manager on Windows, then just reconnected directly to Bootloader using Fastboot and it worked perfectly without an issue.

TWRP fails to boot for me ~1-in-20, I found no solution. Uninstalling/reinstalling the drivers is useless. If you had re-tried again, it'd worked anyway.


You didn't answer to some people asking if your scripts can be used as-is with a N7 2012.

Of course not! Rhetorical questions...


After running the script, when I try to boot into recovery mode I keep getting the Google screen and nothing happens. Any ideas?

Yes I may have one if you mention which CROSS script and options you selected, and don't forget...

If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.


What if both are disconnected?
....
[EDIT2] I couldn't for life of me figure out how to generate a benchmark report from CF-Bench, so I typed it manually in Notepad and zipped it. See attached.
[EDIT 3] I forgot to answer one of your questions. I'm was running Ripee's LineageOS 17.1 ROM.

Diversity antennas are used for both WiFi and LTE.

I see no problem on stock ROM, your benchmark scores are perfect and your eMMC is presumably refreshed after running the TRIM script. There are discrepancies between partition size and filesystem size but they are not relevant in this context, however TWRP may indicate them as errors.

If you note errors or performance issues on custom ROMs, please report them on dedicated forum threads. Keep in mind that monstrosity apps like Facebook will surely degrade overall performance on this 2GB RAM, old 2013 device.
 

jhford

Senior Member
TWRP fails to boot for me ~1-in-20, I found no solution. Uninstalling/reinstalling the drivers is useless. If you had re-tried again, it'd worked anyway.




Of course not! Rhetorical questions...




Yes I may have one if you mention which CROSS script and options you selected, and don't forget...

If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.




Diversity antennas are used for both WiFi and LTE.

I see no problem on stock ROM, your benchmark scores are perfect and your eMMC is presumably refreshed after running the TRIM script. There are discrepancies between partition size and filesystem size but they are not relevant in this context, however TWRP may indicate them as errors.

If you note errors or performance issues on custom ROMs, please report them on dedicated forum threads. Keep in mind that monstrosity apps like Facebook will surely degrade overall performance on this 2GB RAM, old 2013 device.
I cancelled my FB account, albeit with great difficulty, for obvious reasons, immediately after the public reporting of the Cambridge Analytica scandal.
 
  • Like
Reactions: k23m

jhford

Senior Member
TWRP fails to boot for me ~1-in-20, I found no solution. Uninstalling/reinstalling the drivers is useless. If you had re-tried again, it'd worked anyway.




Of course not! Rhetorical questions...




Yes I may have one if you mention which CROSS script and options you selected, and don't forget...

If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.




Diversity antennas are used for both WiFi and LTE.

I see no problem on stock ROM, your benchmark scores are perfect and your eMMC is presumably refreshed after running the TRIM script. There are discrepancies between partition size and filesystem size but they are not relevant in this context, however TWRP may indicate them as errors.

If you note errors or performance issues on custom ROMs, please report them on dedicated forum threads. Keep in mind that monstrosity apps like Facebook will surely degrade overall performance on this 2GB RAM, old 2013 device.
OK. Thanks. My 2 debs are up and running, and both are supposed to identical, but there is an anomaly. "Storage" of Deb #1 shows 16.93 GB of used storage and shows "53% used" in the circle at the top right of storage page, but Storage of Deb #2 shows 25.19 GB used but the "used" circle at the top right is absent. Deb #2 does not have enough free storage for a Nandroid backup. The culprit is System. Deb #1 System shows 8.9 GB used but Deb #2 shows 18 GB used. The delta is 9 GB. But I'm certain that I used your Ultimate tool to resize the partitions on both devices. Here's hoping for another great fix suggestion.
Thanks again
 

MrFishy

New member
Dec 3, 2010
2
0
To repair the stock ROM's bootloop, install k23m-persist-fix2.zip in TWRP. You'll find it in the RESTOCK's download section.
Hi, thanks k23m! After installing Lineage OS 18.1 (repartioned), I tried to flast back to stocky many ways but after flashing - I got stuck on the "android" logo (animated) but it would never fully boot into the OS.

However, got it working with the fix. The important thing is to install Restock, get back into the bootloader straight away (don't let it fully boot), then twrp and the then install the fix.
 

ipdev

Recognized Contributor
Feb 14, 2016
1,651
1
2,257
Google Nexus 10
Nexus 7 (2013)
But you're not describing what ROM, partitioning or TWRP is used, nor attaching any logs. Anyway, try the following on deb #2:
  1. RESTOCK2 and reboot
  2. FSTRIM - For optimal eMMC performance run fstrim.bat from time to time. (it is in RESTOCK2 package)
  3. quote your benchmark scores
  4. If you see errors (on stock ROM), copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.
Again, I support only stock ROM :)




No, they use so-called diversity antennas, or simply put, more than one to improve RF range and performance. So when you disconnect one of them everything still works.

(y)
The lag on my main flo has been growing.
unofficial Lineage 18.1

I remembered you had a post along these lines.
I did not remember the command you mentioned or the thread you posted it in.
Found it. ;)


Running fstrim seemed to help quite a bit. :D

I recently clean flashed my deb but, will definitely use fstrim when the lag grows.
Might give it a try on other devices. 🙃

Cheers. :cowboy:

PS.
From my main flo.
Code:
/cache: 0 bytes trimmed
/system: 114855936 bytes trimmed
/data: 7112704000 bytes trimmed
 
  • Like
Reactions: k23m

k23m

Senior Member
Jan 3, 2016
935
539
I rebuilt the software for my N7 2013 deb using Restock which I've done enough to do it in my sleep. But it's bootlooping on the Stock Rom four circular objects splash screen and won't stop. Any ideas? Thanks

Yes, get and flash k23m-persist-fix2.zip from RESTOCK's front page.
 

jhford

Senior Member
I have 3 N7 Debs, but I had an unused N7 Flo laying around which I decided to root/rom and give to my sister-in-law. But I made a bone-headed mistake, probably because I've never modded a Flo before. I mindlessly flashed followmsi's DEB version of TWRP, instead of his/her Flo version. 🤔 To fix it, I did an Android Recovery Factory Reset (dead Android), and flashed followmsi's FLO version of TWRP. That didn't work. Stock Android 4.4 (I think) and fastboot booted, but followmsi's FLO version of TWRP didn't boot. The tablet just hung on the Google Splash Screen. Then I tried Restock with the same result. My sister-in-law will be grateful for any help. Thanks
[EDIT].
I tried Restock again from Restock2 folder hoping to install TWRP from addons.bat. Everything wrote as normal, but, again, TWRP did not boot. It's stock at the Google splash screen again.
 
Last edited:

jhford

Senior Member
I have 3 N7 Debs, but I had an unused N7 Flo laying around which I decided to root/rom and give to my sister-in-law. But I made a bone-headed mistake, probably because I've never modded a Flo before. I mindlessly flashed followmsi's DEB version of TWRP, instead of his/her Flo version. 🤔 To fix it, I did an Android Recovery Factory Reset (dead Android), and flashed followmsi's FLO version of TWRP. That didn't work. Stock Android 4.4 (I think) and fastboot booted, but followmsi's FLO version of TWRP didn't boot. The tablet just hung on the Google Splash Screen. Then I tried Restock with the same result. My sister-in-law will be grateful for any help. Thanks
[EDIT].
I tried Restock again from Restock2 folder hoping to install TWRP from addons.bat. Everything wrote as normal, but, again, TWRP did not boot. It's stock at the Google splash screen again.
See attached.
[EDIT] Again, it didn't attach it. Is it a question of my XDA rights? How else can I get you this tiny file?
 

Alekos

Senior Member
I'm having an issue where I can flash LineageOS - and it boots, but not stock. I've done CROSS2 (updated) repartition, ran restock and mob30x-fix1 - it just hangs at boot. but any custom ROM will work (LOS and crDroid).

I was trying to fix a bluetooth issue (where it won't enable) - wifi is fine. was wondering if I could flash a modem or persist img to fix it...

I was able to boot into stock a few years ago (because this issue has been going on since 2019) and had twrp + stock working - but was trying to resolve the BT issue.

ran the persist.zip fix also, but still has this in the log:

this error sticks out:
mount: mounting /dev/block/platform/msm_sdcc.1/by-name/persist on /tmp/persist failed: Invalid argument

so after running restock - and trying to format persist, I get this error:
fastboot format persist
fastboot: error: Formatting is not supported for file system with type ''.
 

Attachments

  • relog-11361859.zip
    45.7 KB · Views: 1
  • getlog.zip
    5.5 KB · Views: 1
  • getlog_restock2.zip
    5.5 KB · Views: 1
  • relog-11440785_cross.zip
    43.7 KB · Views: 1
  • persist_error_formatting.zip
    1.5 KB · Views: 1
Last edited:
  • Like
Reactions: k23m

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I'm having an issue where I can flash LineageOS - and it boots, but not stock. I've done CROSS2 (updated) repartition, ran restock and mob30x-fix1 - it just hangs at boot. but any custom ROM will work (LOS and crDroid).

    I was trying to fix a bluetooth issue (where it won't enable) - wifi is fine. was wondering if I could flash a modem or persist img to fix it...

    I was able to boot into stock a few years ago (because this issue has been going on since 2019) and had twrp + stock working - but was trying to resolve the BT issue.

    ran the persist.zip fix also, but still has this in the log:

    this error sticks out:
    mount: mounting /dev/block/platform/msm_sdcc.1/by-name/persist on /tmp/persist failed: Invalid argument

    so after running restock - and trying to format persist, I get this error:
    fastboot format persist
    fastboot: error: Formatting is not supported for file system with type ''.
  • 26
    RESTOCK is a new Nexus 7 2013 repair and factory reset tool for Windows. The NRT app (Nexus Root Toolkit) is similar but is old, closed-source, unsupported, abandoned, does no eMMC diagnostics and most importantly - it offers no repartitioning. Unlike NRT, Restock is specialized and optimized for Nexus 7'13 only, with streamlined operation and minimal user input.

    If fastboot mode is available, then no matter what software problems like bootloops or softbricks are observed, or what custom ROM you had used before - Restock will restore your tablet to original, latest stock image, factory setup in 10 minutes (more time for one-off components download if necessary). Unforeseen issues should be reported in this thread and hopefully will be resolved within 24 hours.

    If fastboot mode is not available, try the unbricking guide first.

    For hardware issues, check this thread.

    FEATURES

    • supports both flo and deb variants
    • small app download size (2.5MB)
    • automatic latest stock image (mob30x) and USB driver download from official google.com locations
    • robust, reliable USB device detection and driver installation - tested on Windows: XP-32, W7-32/64, W10-64(1809)
    • eMMC memory test and diagnostics
    • automatic device unlocking
    • option of repartition to original factory layout
      - precise and reliable for any eMMC size, including 64GB and 128GB mods
      - required for repartition scripts which check for original layout and flashing specific custom ROMs like e.g. Ubuntu Touch
      - advised for selling in original factory condition and resolving difficult ROM flashing issues and starting from scratch
    • minimal user interaction and fully scripted auto-processing
    • the Restock script is open for inspection, corrections and improvements; post your comments and suggestions here
    USAGE

    1. download the attached zip file
    2. unzip it
    3. double-click on "restock.bat"
    4. follow the prompts
    SAMPLE OUTPUT
    Code:
    Nexus 7'13 Restock v1 @2019 k23m
    SUPPORT - http://bit.ly/2C35sLZ
    WARNING - installing factory image will ERASE ALL DATA from the device
    Enter device name [flo OR deb]: flo
    
    Downloading USB drivers and the latest factory image.
    If not deleted, will not be downloaded again.
    
    --  https://dl-ssl.google.com/android/repository/latest_usb_driver_windows.zip
    Resolving dl-ssl.google.com... 74.125.24.190, 74.125.24.91, 74.125.24.93, ...
    Connecting to dl-ssl.google.com|74.125.24.190|:443... connected.
    WARNING: cannot verify dl-ssl.google.com's certificate, issued by 'CN=GTS CA 1O1,O=Google Trust Services,C=US':
      Unable to locally verify the issuer's authority.
    HTTP request sent, awaiting response... 200 OK
    Length: 8682859 (8.3M) [application/zip]
    Saving to: 'latest_usb_driver_windows.zip'
    latest_usb_driver_windows.zip  14%[======>                              ]   1.21M   383KB/s    eta 19s
    ...
    
    --  https://dl.google.com/dl/android/aosp/razor-mob30x-factory-52684dff.zip
    Resolving dl.google.com... 172.217.25.46
    Connecting to dl.google.com|172.217.25.46|:443... connected.
    WARNING: cannot verify dl.google.com's certificate, issued by 'CN=GTS CA 1O1,O=Google Trust Services,C=US':
      Unable to locally verify the issuer's authority.
    HTTP request sent, awaiting response... 200 OK
    Length: 505296115 (482M) [application/zip]
    Saving to: 'razor-mob30x-factory-52684dff.zip'
    
    razor-mob30x-factory-52684dff  86%[=============================>       ] 417.98M   410KB/s    eta 2m 57s
    ...
    
    1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
    2. when in the bootloader menu, connect it to your PC
    3. wait a few seconds, then...
    Press any key to continue . . .
    ...
    ...
    INFO:   Successfull installation of 'd:\restock\data\usb_driver\android_winusb.inf'.
    INFO:   Returning with code 0x1
    
    Device not found...
    1. disconnect it from PC
    2. reboot to bootloader again
    3. reconnect it to PC
    Press any key to continue . . .
    
    Verify...
    eMMC test...
    If it freezes here, the chip is faulty and needs replacement.
    eMMC OK
    Lock status...
    GPT...
    
    Partitions had been changed.
    Restore original partitions? [y/n]: y
    Wait...
    sending 'bootloader' (3911 KB)...
    OKAY [  0.141s]
    writing 'bootloader'...
    OKAY [  1.518s]
    finished. total time: 1.658s
    rebooting into bootloader...
    OKAY [ -0.000s]
    finished. total time: 0.008s
    Wait...
    sending 'gpt' (35 KB)...
    OKAY [  0.016s]
    writing 'gpt'...
    OKAY [  0.109s]
    finished. total time: 0.141s
    rebooting into bootloader...
    OKAY [ -0.000s]
    finished. total time: 0.012s
    
    If error, copy and post it, include restock.log
    
    http://bit.ly/2C35sLZ
    
    Note: Android flash takes 2 minutes, initial boot takes 7 minutes.
    
    Press any key to continue . . .
    sending 'bootloader' (3915 KB)...
    OKAY [  0.125s]
    writing 'bootloader'...
    OKAY [  1.377s]
    finished. total time: 1.502s
    rebooting into bootloader...
    OKAY [  0.000s]
    finished. total time: 0.007s
    archive does not contain 'boot.sig'
    archive does not contain 'recovery.sig'
    archive does not contain 'system.sig'
    --------------------------------------------
    Bootloader Version...: FLO-04.08
    Baseband Version.....: none
    Serial Number........: xxxxxxxxx
    --------------------------------------------
    checking product...
    OKAY [  0.016s]
    checking version-bootloader...
    OKAY [  0.000s]
    sending 'boot' (7422 KB)...
    OKAY [  0.234s]
    writing 'boot'...
    OKAY [  1.000s]
    sending 'recovery' (8166 KB)...
    OKAY [  0.266s]
    writing 'recovery'...
    OKAY [  0.328s]
    erasing 'system'...
    OKAY [  1.143s]
    sending 'system' (843549 KB)...
    OKAY [ 26.516s]
    writing 'system'...
    OKAY [ 39.986s]
    erasing 'userdata'...
    OKAY [ 23.750s]
    formatting 'userdata' partition...
    Creating filesystem with parameters:
        Size: 28856791040
        Block size: 4096
        Blocks per group: 32768
        Inodes per group: 8192
        Inode size: 256
        Journal blocks: 32768
        Label:
        Blocks: 7045115
        Block groups: 215
        Reserved block group size: 1024
    Created filesystem with 11/1761280 inodes and 154578/7045115 blocks
    sending 'userdata' (139085 KB)...
    writing 'userdata'...
    OKAY [ 12.434s]
    erasing 'cache'...
    OKAY [  0.437s]
    formatting 'cache' partition...
    Creating filesystem with parameters:
        Size: 587202560
        Block size: 4096
        Blocks per group: 32768
        Inodes per group: 7168
        Inode size: 256
        Journal blocks: 2240
        Label:
        Blocks: 143360
        Block groups: 5
        Reserved block group size: 39
    Created filesystem with 11/35840 inodes and 4616/143360 blocks
    sending 'cache' (10984 KB)...
    writing 'cache'...
    OKAY [  0.891s]
    rebooting...
    finished. total time: 107.057s
    Press any key to exit...



    RESTOCK 2

    SCRIPTS
    • restock.bat - the main script: stock install, repair, repartition and factory reset
    • addons.bat - install TWRP custom recovery, mob30x-fix1, root/Magisk, ElementalX-N7-6.17 kernel
    • fstrim.bat - faster eMMC writes: dispatches TRIM command for all unused filesystem blocks
    • safe-unlock.bat - unlock without data loss
    • getlog.bat - diagnostics #1
    • relog.bat - diagnostics #2
    ADDONS
    These addons should be installed immediately after RESTOCK and before Android setup:
    1. TWRP deb/flo custom recovery (it must be flashed before the other addon options)
    2. MOB30X-FIX1 - improved Android 6.0.1 stock MOB30X installation, info: https://forum.xda-developers.com/showthread.php?t=4021757 In short, it adds WiFi 'Skip' setup option and removes old GApps to increase space on the system partition
    3. root/Magisk - https://github.com/topjohnwu/Magisk
    4. ElementalX-N7-6.17 custom kernel - I recommend to preset "doubletap2wake" and "battery life extender". For car use also preset "USB OTG + charge mode", info: https://forum.xda-developers.com/showthread.php?t=2389022
    ERRORS
    If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.

    FSTRIM
    For optimal eMMC performance run fstrim.bat from time to time.

    SAFE UNLOCK
    Unlock your device without data loss. MiFlash is described in the Unbricking Guide:
    https://forum.xda-developers.com/showpost.php?p=75360854&postcount=199
    Do not proceed unless you have read the unbricking guide and downloaded all components.




    OPTIONS

    Try mob30x-fix1 for improved Android 6.0.1 stock installation.

    Next consider CROSS : 1-click installation of secure, up-to-date Android 7-to-11 custom ROMs, including TWRP, repartition, root, etc. as easily as RESTOCK.


    🤞
    2
    Did not even realize this was new! Thanks for making such a wonderfull tool! Currently using it to flash flo, and it works great!
    Will install lineage after this tho :p

    Code:
    1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
    2. when in the bootloader menu, connect it to your PC
    3. wait a few seconds, then...
    Press any key to continue . . .
    Verify...
    eMMC test...
    If it freezes here, the chip is faulty and needs replacement.
    eMMC OK
    Lock status...
    GPT...
    
    If error, copy and post it, include restock.log
    
    [url]http://bit.ly/2C35sLZ[/url]
    
    Note: Android flash takes 2 minutes, initial boot takes 7 minutes.
    Press any key to continue . . .
    sending 'bootloader' (3915 KB)...
    OKAY [  0.131s]
    writing 'bootloader'...
    OKAY [  1.581s]
    finished. total time: 1.719s
    rebooting into bootloader...
    OKAY [  0.009s]
    finished. total time: 0.014s
    archive does not contain 'boot.sig'
    archive does not contain 'recovery.sig'
    archive does not contain 'system.sig'
    --------------------------------------------
    Bootloader Version...: FLO-04.08
    Baseband Version.....: none
    Serial Number........: 07206d7c
    --------------------------------------------
    checking product...
    OKAY [  0.003s]
    checking version-bootloader...
    OKAY [  0.004s]
    sending 'boot' (7422 KB)...
    OKAY [  0.239s]
    writing 'boot'...
    OKAY [  0.397s]
    sending 'recovery' (8166 KB)...
    OKAY [  0.265s]
    writing 'recovery'...
    OKAY [  0.448s]
    erasing 'system'...
    OKAY [  0.743s]
    sending 'system' (843549 KB)...
    OKAY [ 26.422s]
    writing 'system'...
    OKAY [ 51.719s]
    erasing 'userdata'...
    OKAY [  9.570s]
    formatting 'userdata' partition...
    Creating filesystem with parameters:
        Size: 13342060544
        Block size: 4096
        Blocks per group: 32768
        Inodes per group: 8144
        Inode size: 256
        Journal blocks: 32768
        Label:
        Blocks: 3257339
        Block groups: 100
        Reserved block group size: 799
    Created filesystem with 11/814400 inodes and 91881/3257339 blocks
    sending 'userdata' (137198 KB)...
    writing 'userdata'...
    OKAY [ 12.298s]
    erasing 'cache'...
    OKAY [  0.051s]
    formatting 'cache' partition...
    Creating filesystem with parameters:
        Size: 587202560
        Block size: 4096
        Blocks per group: 32768
        Inodes per group: 7168
        Inode size: 256
        Journal blocks: 2240
        Label:
        Blocks: 143360
        Block groups: 5
        Reserved block group size: 39
    Created filesystem with 11/35840 inodes and 4616/143360 blocks
    sending 'cache' (10984 KB)...
    writing 'cache'...
    OKAY [  1.029s]
    rebooting...
    
    finished. total time: 103.239s
    Press any key to exit...
    2
    I had this mad idea to install Android 11 on my old and unused Nexus 7 but right after the first try with the repartitioning, my microusb stopped working (forever)... so my tab started sitting on the table totally empty with a messed partition.
    Hopefully a friend of mine had a Nexus 7 with broken screen so I just took its motherboard (avoiding the microusb soldering) and did all over again the procedure.
    Again I had problems with the connection but this time was the cable. Infact even if kept perfectly/unused I've found that not all my cables were good for this procedure so I just used a Samsung cable and everything worked.
    So, just giving an advice: before doing everything, just test your ports and cables :)
    Aaaand big thanks to all the devs who keep alive this great device, especially @k23m who guided me through all this procedure!
    2
    @k23m
    I feel guilty pushing users your way but, you know more about this than I do.🙃
    Logs are attached to quoted post.
    I am not that familiar with k23m's scripts or processes.
    Sorry, I do not have much time this week so, I will not be able to look into it until the weekend.
    I replied to your post in this thread in hope that you may get help faster than I could provide.

    Cheers. :cowboy:

    Thanks ipdev, I am in contact with the user via PM already.

    Cheers!
    2
    Well, it finally booted! But it took some attempts... Seems like there were problems in both mmcblk0p23 (cache) and mmcblk0p30 (data), so tried fastboot format cache and fastboot format userdata, but somehow it didnt work. What it finally make it boot was to format data and format cache from TWRP. What a nightmare!
    I'm afraid, it's not over. The eMMC flash memory IC is faulty and with no spare NAND blocks the issue will unpredictably show up at random partitions. If it works now, then do not flash any new ROM again, keep it read-only as much as possible and the Nexus will be still usable. Note that the lifespan of your 16GB eMMC is half of the more common 32GB model. It is possible to replace eMMC and even upgrade it to 64GB, more info is here.
    :good: