April 19, 2024

How to Securely Erase Your iPhone Before Resale

Posted June 17, 2008 at 2:36am by iClarified
These are instructions on how to securely erase your iPhone or iPod touch to prevent the recovery of private data.



Step One
Launch iTunes by selecting its icon in the dock
How to Securely Erase Your iPhone Before Resale


Step Two
Connect your iPhone or iPod touch to the computer then select it from the list of devices on the left.
How to Securely Erase Your iPhone Before Resale

Step Three
Click the Restore button in the Summary tab.
How to Securely Erase Your iPhone Before Resale

If asked to create a backup click Don't Back Up
How to Securely Erase Your iPhone Before Resale

A popup window will appear asking you to confirm the restore. Click the Restore button.
How to Securely Erase Your iPhone Before Resale

Once the Restore has complete a window will appear confirming that your iPhone, iPod has been restored to factory settings. Click the OK button.
How to Securely Erase Your iPhone Before Resale

Now you will be asked to name your iPhone, iPod touch. Enter a new name then click the Done button.
How to Securely Erase Your iPhone Before Resale

Step Four
Now follow your desired method to jailbreak your iPhone. If you do not have a preferred method then use one of the many detailed on this site!

Windows: How to Unlock Your iPhone With iLiberty for Windows
Mac: How to Unlock Your iPhone With iLiberty for Mac

Step Five
Now you will need to install BSD Subsystem and SSH on your iPhone. You can do this by using these tutorials...

Install BSD Subsystem: How to Install BSD Subsystem on Your iPhone

Install SSH: How to Install OpenSSH on Your iPhone Using Installer

NOTE***: To make sure SSH connections do not terminate I would suggest setting Auto-Lock to Never in Settings:General:Auto-Lock.

Step Six
Download umount from here and save it to your Desktop.

Step Seven
Open a new Terminal window from your Applications:Utilities folder.
How to Securely Erase Your iPhone Before Resale

Step Eight
Enter the following command into your Terminal window:
scp ~/Desktop/umount root@192.168.0.192:/sbin/umount
How to Securely Erase Your iPhone Before Resale

Don't forget to replace 192.168.0.192 with the IP Address of your iPhone.

If prompted for a password enter alpine.
How to Securely Erase Your iPhone Before Resale

Step Nine
Now lets SSH into the iPhone. Enter the following command into the Terminal window:
ssh root@192.168.0.192
How to Securely Erase Your iPhone Before Resale

Don't forget to replace 192.168.0.192 with the IP Address of your iPhone.

If prompted for a password enter alpine.
How to Securely Erase Your iPhone Before Resale

Step Ten
Now we need to give umount the executable permissions. Type the following into your Terminal window:
chmod 755 /sbin/umount
How to Securely Erase Your iPhone Before Resale

Step Eleven
To force both mount points in to read only mode, enter the following commands into Terminal:

umount -f /private/var
mount -o ro /private/var
mount -o ro /

How to Securely Erase Your iPhone Before Resale

Step Twelve
We now will wipe both partitions clean by copying /dev/zero over them. Enter the following commands into your Terminal window:

cat /dev/zero > /dev/rdisk0s2; cat /dev/zero > /dev/rdisk0s1

How to Securely Erase Your iPhone Before Resale

NOTE*: This will likely take up to an hour to complete! After completion your iPhone, iPod touch GUI will be unresponsive. This is expected.
How to Securely Erase Your iPhone Before Resale

Step Thirteen
We will now place the iPhone, iPod touch into recovery mode. You can follow the instructions here for a detailed explanation. Though all you need to do is press the Sleep/Wake button and Home button until the iTunes logo and dock connector appear on the screen.
How to Securely Erase Your iPhone Before Resale

Step Fourteen
Follow Steps One through Three again to restore your iPhone, iPod touch. Your iPhone will now be securely erased and ready for resale.


THANKS***: This method was outlined by Jonathan A. Zdziarski.
Add Comment
Would you like to be notified when someone replies or adds a new comment?
Yes (All Threads)
Yes (This Thread Only)
No
iClarified Icon
Notifications
Would you like to be notified when we post a new Apple news article or tutorial?
Yes
No
Comments (11)
You must login or register to add a comment...
Davo
Davo - October 31, 2010 at 10:44am
Wipe iphone 4 system clean E-mail 此主題給朋友 [按此打開] [隱藏] Iphone 4 16g, with Limera1n jailbroken, 4.1. I tried to wipe the whole file system clean by writing zeroing data, but encountered the following problem: I successfully sshed into the device, and force the two partitions (root partition and media partition) to read only mode, but have to unmount the media partition before doing that. So when typing the following command "umount -f /private/var" the system returns the error with "not a directory or special device" So anyone knows what's the cause? Thank you
Steve
Steve - December 22, 2009 at 8:31pm
I get "Killed" after entering "umount -f /private/var" command and "mount_hfs: Resource busy" after entering "mount -o ro /private/var" iPhone 2G OS v3.1.2 Jailbroken/Unlocked
Zoso
Zoso - February 4, 2009 at 3:51pm
Does this work on windows? And it's like this that the iPod on my iPhone have for no special reason disappeared, do I get it back if I restore using iTunes?
p1932
p1932 - October 31, 2010 at 12:15pm
DAVO YOU NEED TO CONNECT IT TO UR PC AND DO THIS:...TRY TO JAIL BREAK IT WITH A DIFFERENT FIRMWARE THEN WHAT YOU NOW HAVE ON YOUR IPHONE BY DOING THIS YOU SCRAMBLE UP YOUR OWN FIRMWARE AND ALL WILL BE WIPED CLEAN THEN YOU DO A COMPLETE RESTORE LEAVING YOU AND ALL YOUR DIRECTORIES CLEAN AS A BABYS ASS
drkfd
drkfd - September 16, 2008 at 11:44pm
Hey, Good stuff. Just curious: Anyone trying this with 2.1 firmware? When I run umount I receive "Killed" immediately. Doesn't seem to be working. I thought maybe there was an updated version of umount in the 2.1 build, but I can't find it anywhere. Any thoughts? Maybe this is no longer necessary due to the new erase features in 2.1? Thanks.
michael
michael - February 3, 2009 at 1:23am
I'm getting the exact same error, been searching all night. Have you found any other info? Maybe editing fstab?
schmave
schmave - May 29, 2009 at 8:14pm
wow, seriously dont try it! if you dont know that you have to run "ldid -S /sbin/umount" then you probably shouldnt be messeing around with your iphone. Becuase the CIA dosent want to retrive your data off your old iphone this is completely unnessecary.
Bill
Bill - July 3, 2008 at 10:37pm
Hey, thanks for putting this up. I read through Zdziarski's post, but I'm not entirely familiar with Terminal and was a little edgy about carrying it out, worried that I might make some changes to my Mac accidentally. Great work here, much appreciated.
Azn
Azn - June 17, 2008 at 1:29pm
How about a windows version?
XianLi
XianLi - June 17, 2008 at 8:57am
Yeah, kinda like a Speak & Spell voice :D BTW, very good tutorial ! :)
Number_41
Number_41 - June 17, 2008 at 7:21am
You sound like a broken record in the terminal cat part haha :)
Recent. Read the latest Apple News.
RECENT
Tutorials. Help is here.
TUTORIALS
Where to Download macOS Monterey
Where to Download macOS Ventura
AppleTV Firmware Download Locations
Where To Download iPad Firmware Files From
Where To Download iPhone Firmware Files From
Deals. Save on Apple devices and accessories.
DEALS