Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Josh7047

macrumors newbie
Original poster
Jul 20, 2014
24
0
i have a JB iPhone 5s on ios 8.1. i want to unjailbreak but when i put it into DFU mode and try to restore it keeps saying error 21 after preparing to restore. Any ideas?
 
i tried recovery mode, it just gets stuck on preparing for restore.

----------

ive tried all ports. Can someone please help me??
 
You don't need to put it in recovery or dfu mode.
Just plug it to iTunes and hit restore.
The jb iPhone still turns on and starts up fine right?
You're sure there's no hardware issue with it?
You try another computer?
What do you think we're both doing?trying to help you.
You're welcome.
 
I used Tinyumbrella to exit recovery mode. when i did this i noticed it said "Do not restore, windows/system32/drivers/hosts/etc is not writable" Does this have anything to do with it not being able to restore? should i still try restoring without DFU?

----------

When im not trying via DFU mode, it always ends up getting stuck preparing for restore with the recovery logo on the phone.
 
Tiny umbrella has been useless for a few years now. Why are you using it with an iPhone 5S?
And your hosts file not pointing to apples servers is the reason the restore will not go thru.
Fix your redirects either manually or via TU settings to make sure hosts point to apples servers and not cydias.
Restore will never complete unless you fix your hosts that you messed up by using TU.
That's what I thought was the case when I told you if you can't fix it restore it on another computer with iTunes.
 
I have no clue how to fix those, can you give me a rundown?
Open Tiny Umbrella and uncheck the box that says Set hosts file to Cydia on exit and close it.

You can uninstall TinyUmbrella at that point. Years ago we could use SHSH blobs to downgrade or restore to old firmware and needed to redirect to Cydia. TinyUmbrella was one way of doing that. That method no longer works.
 
Open Tiny Umbrella and uncheck the box that says Set hosts file to Cydia on exit and close it.

You can uninstall TinyUmbrella at that point. Years ago we could use SHSH blobs to downgrade or restore to old firmware and needed to redirect to Cydia. TinyUmbrella was one way of doing that. That method no longer works.

That is all i have to do to make the restore work?
 
That is all i have to do to make the restore work?

That's how you fix your hosts file. Your hosts file may be incorrect, which will stop the restore from going through. Try restoring after you fix it and post back with the error code if you receive any more errors while trying to restore.
 
I've had a similar issue.

Is it safe to say one 8.1 JB you simply can't "restore" your phone via the settings menu? When I tried that the phone just freezes up in the restoration process. I had to throw it in DFU and restore it via Pangu. is this normal (for being jb)
 
Last edited:
i went into tinyumbrella and that box was already unchecked, i unchecked all the other boxes, closed it and tried to restore. Same error.
 
i went into tinyumbrella and that box was already unchecked, i unchecked all the other boxes, closed it and tried to restore. Same error.

What happens when you type gs.apple.com in your browser? Do you go to apple's site or cydia?

Edit: I'm almost positive it'll take you to the cydia page. In checking that box didn't work because in your earlier post you said you got an error when using TU; that the hosts file was not writeable.

Anyways, you may or may not be able to manually edit the hosts file depending on what version of windowsill are using and how you are logging in to it. This is why AppleJuiced suggested using a different computer to restore.

If your browser takes you to cydia, then your hosts file needs to be fixed. Here's a screenshot of what it may look like.
 

Attachments

  • image.jpg
    image.jpg
    50.2 KB · Views: 91
Last edited:
I've had a similar issue.

Is it safe to say one 8.1 JB you simply can't "restore" your phone via the settings menu? When I tried that the phone just freezes up in the restoration process. I had to throw it in DFU and restore it via Pangu. is this normal (for being jb)


Yes, that's been my experience - you can't restore via the phone's Settings menu.
 
What happens when you type gs.apple.com in your browser? Do you go to apple's site or cydia?

Edit: I'm almost positive it'll take you to the cydia page. In checking that box didn't work because in your earlier post you said you got an error when using TU; that the hosts file was not writeable.

Anyways, you may or may not be able to manually edit the hosts file depending on what version of windowsill are using and how you are logging in to it. This is why AppleJuiced suggested using a different computer to restore.

If your browser takes you to cydia, then your hosts file needs to be fixed. Here's a screenshot of what it may look like.

It takes me to a page called "GCS Default server" it has three boxes with options of Apple, Apache web server and Tech Probs. My hosts does not have those two lines, im reinstalling itunes right now.

----------

i still get error 21 after reinstall of itunes. I would like to note i have two files named hosts in the etc folder. One is hosts.bak and the other is hosts.umbrella. i have kept tinyumbrella because that is the only way i can get out of recovery mode after i get error 21.
 
Try again with DFU restore......you know that when in DFU, screen of your iPhone should be just black?
 
It takes me to a page called "GCS Default server" it has three boxes with options of Apple, Apache web server and Tech Probs. My hosts does not have those two lines, im reinstalling itunes right now.

----------

i still get error 21 after reinstall of itunes. I would like to note i have two files named hosts in the etc folder. One is hosts.bak and the other is hosts.umbrella. i have kept tinyumbrella because that is the only way i can get out of recovery mode after i get error 21.


Remove the tiny umbrella host file and rename Host.bak to Host.

Then try to restore.

If that doesn't work you can delete the host file, then connect to a network and a new host file will populate.
 
I've had a similar issue.

Is it safe to say one 8.1 JB you simply can't "restore" your phone via the settings menu? When I tried that the phone just freezes up in the restoration process. I had to throw it in DFU and restore it via Pangu. is this normal (for being jb)

Just so you know for future reference.
You can never ever ever do an "Erase all" with a JB device.
You need to plug it to itunes and hit restore to bring it to stock firmware.
There is no restore via settings menu. Its an erase all content and setting option that doesn't work on JB device.
 
From the iphone wiki:

Error 21
Custom firmware restore fail (PwnageTool since 4.1). You have to put your device into the DFU mode and not into recovery mode. Device won't boot correctly an stuck at the Apple logo after the error. Press and hold power and home button until it reboots.
Error when using Sauriks server for a restore with iOS 5.x in the recovery mode at least on a A5 device.
This error can also happen when you try to restore an iPod with hardware dfu. Use iREB r5 to solve this.
You are trying to update to a beta firmware without UDID activation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.