- Forum
- Google Hardware, Services & Apps
- More Google Devices & Services
- Google Nexus 7 Tablet (2012)
- Google Nexus 7 (2012) Rooting, ROMs, & Hacks
[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...
[WARN]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[/WARN]
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!
[INFO]
1. Download the 4.3 (JWR66V) image files to your computer. A direct download link is found here for the Wifi only Nexus 7: https://dl.google.com/dl/android/aos...y-d341d356.tgz
The image for the GSM/HSPA+ Nexus 7 is found right here: https://dl.google.com/dl/android/aos...y-aebc7b11.tgz
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... As well, your files will contain the codename "tilapia" instead of "grouper" 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: http://developers.google.com/android/nexus/images
2. Extract the files from that downloaded file. This will give you a folder called "nakasi-jwr66v"... 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.23.img
flash-all.sh
flash-base.sh
flash-all.bat
image-nakasi-jwr66v.zip
*radio-tilapia-1231_0.18.0_0409.img <--- IF you downloaded the image for the 3G/HSPA+ Nexus 7 you will see this file and should move it as well as the others
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
Code:cd fastbootfiles
5. Let's make sure you have your fastboot drivers installed and recognizing your device. Enter in the command prompt:
Code:fastboot devices
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:
Code:fastboot erase boot fastboot erase cache fastboot erase recovery fastboot erase system fastboot erase userdata
Code:fastboot flash bootloader bootloader-grouper-4.23.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
Code:./fastboot-mac flash bootloader bootloader-grouper-4.23.img
Going forward you Mac folks just remember that with the rest of the commands
Now reboot the bootloader:
Code:fastboot reboot-bootloader
7 (b). **IF you have the 3G/HSPA+ Nexus 7 you should flash the radio file as well. Wifi-only Nexus 7's skip this step. To flash the radio file:
Code:fastboot flash radio radio-tilapia-1231_0.18.0_0409.img
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:
Code:fastboot -w update image-nakasi-jwr66v.zip
Reboot the bootloader again:
Code:fastboot reboot-bootloader
9. We are done with the hard part... pretty easy right? Now we're just going to lock that bootloader.
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:
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!07-17-2012 10:50 PMLike 128 -
- 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 09:23 AMLike 4 -
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.
Sent from my Nexus 7 using Tapatalk 2zero neck likes this.07-19-2012 01:55 PMLike 1 - 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?07-20-2012 11:21 PMLike 0 - 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?
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 207-20-2012 11:32 PMLike 0 - 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
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)07-21-2012 01:50 AMLike 0 - 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))
07-21-2012 01:56 AMLike 0 - 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)
Sent from my Nexus 7 using Tapatalk 2zero neck likes this.07-21-2012 02:02 AMLike 1 -
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:
Code:C:\r3superboot>fastboot-windows flash system system.img sending 'system' (432360 KB)... OKAY writing 'system'... FAILED (command write failed (Unknown error))
07-21-2012 02:31 AMLike 0 - 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:
Code:C:\r3superboot>fastboot-windows flash system system.img sending 'system' (432360 KB)... OKAY writing 'system'... FAILED (command write failed (Unknown error))
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 207-21-2012 02:43 AMLike 0 - 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.
Also going forward remember to make full nandroid backups in recovery before you try to tweak anything in the system2defmouze likes this.07-21-2012 02:55 AMLike 1 - 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).07-21-2012 03:57 AMLike 0 - i try to run step six and i get an error message saying: failed (command write failed unknown error) for each command i type. any ideas?07-21-2012 04:57 PMLike 0
-
Sent from my Galaxy Nexus using Tapatalk 207-21-2012 04:59 PMLike 0 -
- 07-21-2012 05:50 PMLike 1
- Forum
- Google Hardware, Services & Apps
- More Google Devices & Services
- Google Nexus 7 Tablet (2012)
- Google Nexus 7 (2012) Rooting, ROMs, & Hacks
[GUIDE] Nexus 7 - Factory Image Restore
LINK TO POST COPIED TO CLIPBOARD