- 07-17-2012, 09:50 PM
Thread Author #1
[GUIDE] Nexus 7 - Factory Image Restore
You unlocked, rooted, ROM'd, and, somewhere or another, appear to have royally screwed up your Nexus 7..... Not to fear! As a Nexus device Google has you covered with factory image packages you can use to restore your tablet to brand new out-of-the-box condition. And here's how...
The procedure below will fully wipe of your device, internal SD included. If you are able to boot your tablet at all right now, its a good idea to copy anything you desperately need to save over to your computer, as you can move it back later. This is your last-resort fix for hacking screw ups. Niether myself nor Android Central is responsible for anything that happens to your device... but we will be here to help you as best we can
Here are the GENERAL INSTRUCTIONS TO RESTORE THE STOCK IMAGES. Make sure you know how to do it for your computer/setup and that ADB and fastboot is set up on your computer. Please check the guides provided by Zero Neck and Ragnarokx to ensure that you have your fastboot drivers installed correctly. Also know the exact folder containing the fastboot files you will be using and the specific name of the file, which might be "fastboot", "fastboot-windows", or "fastboot-mac" depending on which unlock method you used for your device.
In addition, make sure you know how to type the commands in for your specific setup. For example, if you're using a superboot folder for Mac, you need to make sure you understand what your "version" of the beginning of the command is (usually "./fastboot-mac" if you're using that r3-superboot folder).
For Linux/Ubuntu, be sure to put "sudo" before any and all fastboot commands, or you will get an error about insufficient permissions.
AC user SladeNoctis has provided a great video walkthrough of the entire process done on a Windows PC. While the commands you would use on a mac or linux box would be slightly different, this should give you a great idea of the overall process and what to expect. Thanks Slade!
1. Download the 4.2.2 (JDQ39) image files to your computer. A direct download link is found here for the Wifi only Nexus 7:
The image for the GSM/HSPA+ Nexus 7 is found right here:
Please be careful to download the correct factory image!!
The instructions below are for the Wifi only tablet.. if you have a GSM/HSPA+ tablet your instructions are pretty much identical except for a tiny change in the filenames.. Any file that contains the word "nakasi" is instead "nakasig" for the GSM/HSPA+ tablet. Make note of that when you type in the fastboot command to flash the factory image!
While a link to the Google page you can search on if you need, is here:
2. Extract the files from that downloaded file. This will give you a folder called "nakasi-jdq39"... and inside of that you will see the files we are going to fastboot to your tablet. We want to place these files into the folder we located earlier which contains our "fastboot" file. Move or copy them over to that folder.
Note: On Linux/Ubuntu you may just extract them to any easily located folder.. Create a new one on the desktop or your home folder is my recommendation.
For reference, there should be 4 files, named:
bootloader-grouper-4.18.img
flash-all.sh
flash-base.sh
flash-all.bat
image-nakasi-jdq39.zip
3. Open a command prompt inside the folder we have set up our files in. On windows this can be done by holding shift as you right-click in the folder, then select "Open command window here". On Mac or on a Linux system you want to open a terminal/command prompt and navigate to that folder using "cd" or "change directory" commands. For example if your folder is called "fastbootfiles" and it is on your desktop, you would enter:
Code:cd desktop
4. Power down your tablet. Reboot into the bootloader by holding Volume Down + Power until you see the bootloader screen. In red letters toward the top of the text you will see fastboot mode. Once here, plug it into your computer.Code:cd fastbootfiles
5. Let's make sure you have your fastboot drivers installed and recognizing your device. Enter in the command prompt:
For Mac:Code:fastboot devices
And press enter. You should see "List of attached devices" Followed by a string of numbers. If you do not see this, you do not have your drivers installed correctly! Go back to Zero Neck's Unlocking guide and grab the correct drivers, and make sure you install them correctly. You can also find the procedure during the video posted by Ragnarokx.Code:./fastboot-mac devices
If you got the expected response, let's move on to fastbooting you back to stock...
6. This first command is going to wipe all your old EVERYTHING from the device. Credit to our resident AC cowboy, Jerry Hildenbrand, for pointing out to me a minor bug with the Nexus 7 bootloader that makes this a wise step to do first. Type each of these lines followed by Enter between them, waiting for one to finish before moving on to the next:
7. This command will flash the stock bootloader on to your device. Enter:Code:fastboot erase boot fastboot erase cache fastboot erase recovery fastboot erase system fastboot erase userdata
And press enter. Make sure you type the command exactly as you see it.Code:fastboot flash bootloader bootloader-grouper-4.18.img
Note: As we noted earlier, replace "fastboot" above with the exact name of the fastboot file in your folder, for your system, such as "fastboot-windows" or "fastboot-mac". Addtionally for Mac's only, the command should be entered as such
Noting the period and forward slash before the command.Code:./fastboot-mac flash bootloader bootloader-grouper-4.18.img
Going forward you Mac folks just remember that with the rest of the commands
Now reboot the bootloader:
Enter.Code:fastboot reboot-bootloader
8. This next command will both wipe your old system and flash the factory image in its place, which includes the stock system, recovery, kernel, and userdata partitions:
Enter, and wait, make sure the command finishes. This might take a few minutes.Code:fastboot -w update image-nakasi-jdq39.zip
Reboot the bootloader again:
Enter.Code:fastboot reboot-bootloader
9. We are done with the hard part... pretty easy right? Now we're just going to lock that bootloader.
Enter.Code:fastboot oem lock
Yes, this step is optional but I strongly recommend it if you had issues earlier which led to this procedure. Now you can unlock again if you like, which will give your tablet that final full wipe to clear out any bad data remaining:
Enter.Code:fastboot oem unlock
10. Finally, reboot and setup your tablet again from scratch!
Code:fastboot reboot
That's it, we're done. You have a stock, factory Nexus 7 tablet to get right back to tinkering with to your heart's content. If you have any questions, comments, concerns, or a recommendation to make this guide clearer, please sound off and myself or someone else will be around to help you out!
Credit for much of this guide and its format also goes to AC Moderator, dmmarck. Show him the love as well!Last edited by 2defmouze; 04-27-2013 at 05:22 PM.
[GUIDE] Nexus 4 - Unlock & Root | [GUIDE] Nexus 4 - Factory Image Restore | [GUIDE] Nexus 7 - Factory Image RestoreNeed a Dropbox? Use this link to sign up and both of us get free bonus space http://db.tt/YOHANuCIThanked by 92:+ Show/Hide list of the thanked -
aaron_b, ace-r1, adnilasor, agprime, Andrew McCreath, AppleBonker, apquijano, balus3u, Camaihofer, captain_dl, Cedric Latour, celliott96, chubb, comhack, Cory Streater, craigf#AC, Criticool, Cyber Warrior, ddavtian, deltascrew, denged5460, derethus, disconnect, dmmarck, Drewid85, droidguy15, eclapham, Enzomatrx, F34R, fareal, filipvdb, garfnodie, Hotam, Hypnoasia, islandak, J T M, jackxl, jairusz, booyahsauce, Jeremy Sarkilahti, Jerry Hildenbrand, jetnag, jgramkow, jktghfg, jmb133, jnichols959, JonChalk, jsxsola, Kevin Michaluk, KT Nguyen, lakedubvt, landjo77, LightFantstic, LukasPodolski, maggard5, TheMediocreMaestro, markyoung04, martin781, matthewmurray, mecouytfbh, Michael McGrath, Miguente, mikec8785, Millerthyme59, mordak, nexusisneecesary, NotJustAPhone, oxymoron, Parrouch, Paul627g, Phil Nickinson, phoenix623, Politician, PrimeRisk, prozack1983, ragnarokx, red3y3, ruh-roh-raggy, sam245, sicario666, Sir Wilhelm, SmokinMitaine, SnoopyLane, sourcex4447_, sujivet, tcummy, Thao Tran, thefrozenpenguin, tjwilliam125, W1LL1am.A.W333z3L, Zambzz, zero neck
- 07-17-2012, 11:44 PM #2
Re: [GUIDE] Factory Image Restore for your Nexus 7
you just advised the $%^&* out of this thread!
great job def

*INCREDIBLE*MECHA*TORO*GROUPER* GALAXY S3 *
* [TORO RADIOS] * [NEXUS WALLS] * [GROUPER GUIDE] * [CHATTER] * - 07-18-2012, 07:18 AM #3
Re: [GUIDE] Factory Image Restore for your Nexus 7
Nice one, mang. 2 defs up
- 07-18-2012, 09:34 PM #4
Re: [GUIDE] Factory Image Restore for your Nexus 7
Nice one!
- 07-19-2012, 03:34 AM #5
- 07-19-2012, 08:23 AM #6
Re: [GUIDE] Factory Image Restore for your Nexus 7
THANK YOU! I totally hosed up messing with changing icons around using ROM TOOLBOX and if I had not run across this I would have been toast. Granted I was up until 2:00 am but hey that is part of the fun.
THANK YOU very much. Directions were simple to follow and I am unlocked, re-rooted, and ready to hose it up again. - 07-19-2012, 12:55 PM
Thread Author #7
- 07-19-2012, 01:29 PM #8
Re: [GUIDE] Factory Image Restore for your Nexus 7
Awesome work, I have a feeling I'll be a frequent visitor here lol
Former moderator & advisor.
HTC - the One to rule them all.
- 07-19-2012, 08:06 PM #9
Re: [GUIDE] Factory Image Restore for your Nexus 7
Awesome guide, just used it to do a clean install of the new official Clockwork.
- 07-19-2012, 08:09 PM
Thread Author #10
Re: [GUIDE] Factory Image Restore for your Nexus 7
Nice.. I'm updating in a few to include full wipe intructions.. details to follow.. lol
[GUIDE] Nexus 4 - Unlock & Root | [GUIDE] Nexus 4 - Factory Image Restore | [GUIDE] Nexus 7 - Factory Image RestoreNeed a Dropbox? Use this link to sign up and both of us get free bonus space http://db.tt/YOHANuCI - 07-20-2012, 09:29 AM
Thread Author #11
Re: [GUIDE] Factory Image Restore for your Nexus 7
Guide updated... few edits for clarity and new Step 6 to fully wipe your old, possibly corrupted files and data off of the device. Thanks Jerry!
[GUIDE] Nexus 4 - Unlock & Root | [GUIDE] Nexus 4 - Factory Image Restore | [GUIDE] Nexus 7 - Factory Image RestoreNeed a Dropbox? Use this link to sign up and both of us get free bonus space http://db.tt/YOHANuCI - 07-20-2012, 10:21 PM #12
Re: [GUIDE] Factory Image Restore for your Nexus 7
So, great guide, only problem is mine stops at:
sending 'system'... FAILED (unknown status code)
Also, it says the archive does not contain boot.sig, recovery.sig, or system.sig.
A little background:
I tried to change the battery image in the status bar using ROM toolbox and it killed SystemUI.apk. This led to the joy of no status bar or menu bar (hooray!), and even though I chose to back it up before I applied the battery image, the backup was nowhere to be found. I decided to just try to reflash the factory image, and now I can only boot to the bootloader.
Any ideas?Riding the lightning. - 07-20-2012, 10:32 PM
Thread Author #13
You made a backup in recovery and couldn't find it? The recovery should be able to locate automatically. Though I guess that's besides the point now if you ran the "erase" commands in step 6 already..
For now I would try redownloading the images and running the commands again. If it errors out try to get me the exact message and all details you can.
Sent from my Nexus 7 using Tapatalk 2 - 07-21-2012, 12:50 AM #14
Re: [GUIDE] Factory Image Restore for your Nexus 7
No, ROM Toolbox asked if I wanted to backup SystemUI.apk and framework-res.apk and I said yes. Apparently, the built-in backup for ROM Toolbox doesn't work though.
I tried a fresh download of the factory image and I also tried a "flash stock + unroot" using the Nexus Toolkit (even though it uses the same process). Both result in the same error. Here it is in its entirety:
C:\r3superboot>fastboot-windows -w update image-nakasi-jrn84d.zip
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: 3.34
Baseband Version.....: N/A
Serial Number........: 015d2109ce440c1a
--------------------------------------------
checking product... OKAY
checking version-bootloader... OKAY
sending 'boot' (4884 KB)... OKAY
writing 'boot'... OKAY
sending 'recovery' (5228 KB)... OKAY
writing 'recovery'... OKAY
sending 'system' (432360 KB)... FAILED (unknown status code)Riding the lightning. - 07-21-2012, 12:56 AM #15
Re: [GUIDE] Factory Image Restore for your Nexus 7
An update:
Just tried to flash the system and userdata partitions manually to no avail:
Code:C:\r3superboot>fastboot-windows flash system system.img sending 'system' (432360 KB)... FAILED (remote: (Nv3pBadReceiveLength)) C:\r3superboot>fastboot-windows flash userdata userdata.img sending 'userdata' (104285 KB)... FAILED (remote: (Nv3pBadReceiveLength))
Riding the lightning. - 07-21-2012, 01:02 AM
Thread Author #16
Hmm.. That's odd that it's failing there, even with the toolkit. I'm going to ask around a bit and research on my own and see if we can get past that. Fwiw I am SURE we can, so as we say, don't panic. I'll get back to you ASAP, sometime tomorrow after I get some info!
Sent from my Nexus 7 using Tapatalk 2 - 07-21-2012, 01:20 AM
Thread Author #17
Just a quicky thought, try it with the tablet connected to a different USB port (one in the back if you're on a PC is preferred). Might not help but just a thought while I'm looking around for you.
Sent from my Nexus 7 using Tapatalk 2 - 07-21-2012, 01:31 AM #18
Re: [GUIDE] Factory Image Restore for your Nexus 7
Yeah, I'll try that. In the meantime though, another update.
If I do all the commands manually (e.g. fastboot-windows flash userdata userdata.img) I can get all of them sent and written, except system of course. Here's what I get:
Aren't unknown errors awesome!Code:C:\r3superboot>fastboot-windows flash system system.img sending 'system' (432360 KB)... OKAY writing 'system'... FAILED (command write failed (Unknown error))
Riding the lightning. - 07-21-2012, 01:43 AM
Thread Author #19
Lol so awesome! Haha
We'll get this squared away there is definitely something odd but obvious here, lol. I'm calling it a night but I'll be looking into it tomorrow more, and obviously keep me posted if you're able to figure it out.
Also going forward remember to make full nandroid backups in recovery before you try to tweak anything in the system
Sent from my Nexus 7 using Tapatalk 2 - 07-21-2012, 01:55 AM #20
Re: [GUIDE] Factory Image Restore for your Nexus 7
So, good news is it's fixed. Bad news is I didn't think to switch to a rear USB port before wasting so much time. I should know the simplest solution is usually the right one. Oh well, thanks for the help 2defmouze.
Luckily I was still able to get to CWM to make a backup before I started this whole process (but after SystemUI.apk got borked), so now I'm in the process of restoring that and I'm going to grab the apk from the system dump posted on xda (what I should've done in the first place).Also going forward remember to make full nandroid backups in recovery before you try to tweak anything in the systemRiding the lightning. - 07-21-2012, 02:57 AM
Thread Author #21
[GUIDE] Nexus 4 - Unlock & Root | [GUIDE] Nexus 4 - Factory Image Restore | [GUIDE] Nexus 7 - Factory Image RestoreNeed a Dropbox? Use this link to sign up and both of us get free bonus space http://db.tt/YOHANuCI - 07-21-2012, 03:57 PM #22
- 07-21-2012, 03:59 PM
Thread Author #23
- 07-21-2012, 04:48 PM #24
- 07-21-2012, 04:50 PM
Thread Author #25



Reply




































