If, like me, you spent days hacking your iPhone to make it work on an unofficial cell phone network, then you can understand how scary it is when iTunes tells you that it wants to restore the phone to factory defaults.
If I’d followed iTunes advice my phone would’ve been rendered useless. So, I was quite pleased when I discovered another fix.
It seems that my phone went on the fritz in the middle of exporting images to iPhoto. So I found a fix online where you delete the contents of the media folder, then when you reconnect to iTunes you get the option to load a the backup. No restore, no factory defaults, all is good!
If you have command line access to your phone you can use the following:
rm -R /var/root/Media
Otherwise you can connect via SSH or SFTP and delete the files manually.
[UPDATE]
Please read the comments, the best fix is from Bosaka, but as new updates to iTunes and iPhones are are made things can change. The best bet is to read all of the comments below. This way you can be sure to get the right fix for your iPhone. I feel very strongly that this whole stance that Apple has taken to inhibit your access to your iPhone data and restrict carrier choices is very backwards, and we fully support everyone at Hackint0sh and the Dev Team in their efforts to fight this. You should check their sites for other solutions to iPhone and iTunes related problems.
Related posts:
- Gmail settings for iPhone & MacBook Pro
- Nicest support email ever from Bianca at iTunes Store
- An update to the carrier settings for your iPhone is available. Would you like to download it now?
- WordPress for iPhone
- Repair cracked iPhone screen
Sponsored links:

{ 45 comments… read them below or add one }
I’ve just got the same message on my iPhone but this clue doesn’t work for me. What is your iPhone version? I have iPhone 8G (old generation) with software version 2.1.
I’m on an unlocked 8gb 1.1.2.
Do you have root access to your phone?
Yes, I have. Actually, I found what was the problem. Because I’m using a Custom Firmware which is created with symbolic links, I’ve had to remove the /private/var/mobile/Media/ as well.
Anyway, thank you for your effort! My explanation can be used from other people (or at least I hope so because this page comes at the first place in google result)
Kind regards,
Danail Petrov
Thanks for posting your findings, I too hope this will help others.
Just out of interest, where did you get the custom firmware and what benefits does it have?
Well, I’ve downloaded it from a website. I can’t remember what was actually it’s url address but I can find it if you ask to. There are lot of programs which allows you to create even your custom firmware with your favorite applications as well. So once you have installed all the thinks you need, you can create your own image/firmware. It works like old school software called “Norton ghost” (if you’ve heard it).
I have figured out more specific cure:
Instead of deleting entire “/private/var/mobile/Media folder”,
just delete “/private/var/mobile/Media/iTunes_Control/iTunes/iTunesDB” database file. Make sure also to remove (back up) media files from”/private/var/mobile/Media/iTunes_Control/Music”. Since database file is deleted these files will have no reference inside itunes anymore. You can add them again to iTunes later.
Next time you launch iTunes -will create new database file.
(I was using iphone 3G, Itunes
Danail, sounds cool, fire me the link if you find it.
bosaka, neat! 3g is my next purchase, just as soon as they iron-out those bugs.
thnx bosaka…this works for iphone 3G 2.1….
thank you
WOW!!! thanks a lot. i was going crazy here for a sec. works great.
thank you very much bosaka!!!
You guys are the shit. Thank you so much. I was actually able to grab the photos I thought that were lost when I started the 2.2 restore in itunes without syncing my pix. WOHOO!
yo boska boy…u fkin genius man….thanks it worked like butter….thanks
Bosaka…BOOYAKA! May ALLAH have Mercy on you for the advice. It was an immense help and provided much relief to me after over a month of being without my music and updates to my photo albums. JC, may the Most Gracious provide HIS Grace to you too for providing the forum on which this advice can be found.
PEACE!s
My appreciation to you.
Rgds
bosaka you are the best thank you very much .
Worked beautifully! Thanks very much!!!! especially bosaka! xxxx
Just a note to all the jailbroken 3.0 fw peeps out there…this fix will work for you too. I thought the jailbreak FUBAR’d my phone…but it was indeed this file that bosaka directs you to delete above.
1. Recover via iTunes.
2. Jailbreak
3. Use iFunBox or the like to delete the file above
4. Open iTunes.
5. Rejoice to the Deity of your choice.
Have a nice day =)
This saved me!!!! THANK YOU VERY MUCH!!
Need help.. Mine is the 4GB software V. 2.1
I have this problem and I don’t know how to do the command thing, please provide full details.. Any help will truly be appreciated
just delete this :/private/var/mobile/Media/iTunes_Control/iTunes/iTunesDB” database file.(only itunesdb and not entire folder from var.,….)
sorry i m such an amateur here but how would you go about deleting that file luki!??? thanks in advance!
i am having the same problem.. i tried looking for :/private/var/mobile/Media/iTunes_Control/iTunes/iTunesDB but i cannot find it.. do i do this from my phone or my PC and if so, where do i find it.. i am using a windows pc
PLEASE HELP??
Bosaka’s tips was really helpful, thanx alot dude : )
Worked a treat for me on the wifes new iphone
Coulnt sync wanted to restore itself, seeing as thre phone was jailbroken this was not an option, i used iphone browser to delete the relevant files
Thanks so much
Download the free programm WIN SCP – log on to your iphone with that programm – and read the comments above!
GOD BLEES YOU….I am trying for more then 1 week to find out how to fix this error..but thiss…WOW..this is the fastest and most simple way ever. Just use Ifunbox…and that is it. Thank you very much.
Lol, last but not least, I’ve found a stuff even better for those of you with OS 3+
I’m with 3.0.1 16Gb and this happened to me when I upgraded iTunes to 9. I disconnected the phone while on sync and since the phone didn’t responded, I made a reset (home and power buttons) and for two days, on different iTunes versions (7 to 9) on different computers (Win XP to Win 7), content of my phone couldn’t be read.
1) Then I ssh’ed today in
/private/var/mobile/Media/iTunes_Control/iTunesand found some files namedsomething.tmp1andsomething.tmp2…2) … deleted
iTunesDB…3) … renamed my
something.tmp1( this file was 5M+ size and I guess this was the size of my original DB file) file iniTunesDB4)… restarted iTunes on my computer and iTunes read my phone with all my files
thanks bosaka worked a treat
It really worked.
I was about to restore again. Lucky I saw your post and saved a valueable time.
I am using Iphone 2g, with OS3.0.
Thanks a lot for post.
worked perfectly! love it!
Is iTunesDB the only one i should delete? Because I did that and itunes still won’t read it. Should I delete iTunesCDB as well?
Any help would be appreciated!
I followed Bosaka
“/private/var/mobile/Media/iTunes_Control/iTunes/iTunesDB” database file. Make sure also to remove (back up) media files from”/private/var/mobile/Media/iTunes_Control/Music”.
i didn’t understand it. I’m using Windows Vista and not able to find what it private/var…
Please tell me step by step what to do
To Monti,
those directries ( var,private etc…) are not part of your vista or laptop, those are iPhone directory structure. You can use winscp or ifunbox or other similar windows software / or ifile iPhone application to see such iPhone directries. Use google to search help for those software and you can download those also. I prefer ifile iPhone application as you have to just delete the files only. U can find ifile in cydia.
I think this will help you.
To Pris:
You can delete iTunes CDB too if you’re using iTunes 9+ on your computer.
To all: Every solution works fine but:
1) Bouyaka’s trick will make your device readable again but will delete ALL your media.
2) Not only “the best”’s solution will make your device readable but also all your media will be recovered.
And additional trick is the following (on OS 3+, itunes 9+).
There is a folder named “backup” in your media folder.
/User/Media/iTunes_Control/iTunes/iTunes Library.itlp/DBTemp/BackupBrowse thru it and you’ll find the last back up of your iTunesDB or iTunesCDB file. Just copy it from there to
/User/Media/iTunes_Control/iTunesHmmm you also know that
/Usermeansprivate/var/mobile/this kicks ass! thank you, it worked! I had to do a quick tutorial on ssh ( http://appadvice.com/appnn/2009/03/accessing-files-on-your-iphone-a-guide-to-sshsftp-for-windows-users-jailbreak/ ) but it worked!
bosaka’s way is perfect, but if for someone it wont help just delete itunes_control and itunes will read your iphone and just restore from your backup which is done everytime you connect your iphone
thank you.. and i mean it!
thanx alot bosaka!!! dammmm u saved my life….
i used diskaid to delete itunesDB and music… its free on download.com
Nice! it really does work.
thanks a lot………..
i did as bosaka had recommended. it did work for me but the only glitch is that previously i had 3.70 Gb free with the same stuff, but now it has shrunken to 1.55 gb.
itunes shows Other as 3.29 Gb whereas i hadnt added anything after the problem started.
is there a sort of backup for the deleted itunes database. how can i recover the lost space
I also had this problem of itunes not being able to read the contents of my iphone 3gs 16gb. at first bosaka’s fix didnt work! I discovered because I am using iTunes 9+ you also have to delete iTunesCDB file aswell as iTunesDB file. Both of these are found in: /private/var/mobile/Media/iTunes_Control/iTunes/. I also deleted files in: /private/var/mobile/Media/iTunes_Control/Music.
Hope this helps!
dear sir,
With reference to this post i without looking to the other post i deleted MEDIA folder completly after doing that the itunes issue was resolved but i have another problem the Camera Icon, Ipod icon, Sms Icon are hidden when i use an application to unhide it so that the same is seen on the springboard but it could not be seen when i try to put in a folder created by categories i can see only sms icon and i can use it but not the other two can someone help me
I’ve had a frustrating morning dealing with this problem (was going to go for a bike ride, but instead spent the whole morning fixing this piece of crap), and now that I think I’ve made it work properly AND restore my music again without having to restore and unjailbreak my phone, I thought I’d summarize the steps to fix this problem for the next poor sucker who the phone craps out on.
This assumes that your phone is already jailbroken (I wonder if anyone who has a non-jailbroken phone ever experiences this problem?).
1) On a Mac using Cyberduck or a PC using WinSCP, view the files on your iPhone (google SSH Cyberduck iPhone if you need help with this step)
2) Navigate to /private/var/mobile/Media/iTunes_Control/iTunes/
and delete the file iTunesDB
At this point, iTunes will no longer give you the error message BUT, your music, ringtones, podcasts will still be taking up space on your iPhone but your iPhone won’t try to read them and iTunes won’t see them. The solution is the next step.
3) In Cyberduck (or WinSCP) navigate to /private/var/mobile/Media/iTunes_Control/Music and delete all of the folders in the Music directory
4) Go back one level to /private/var/mobile/Media and go to the Ringtones directory and delete them too.
5) Close iTunes and open it again, allow your iPhone to sync again. It should copy all your music, podcasts, and videos back to your phone, though depending on how much you have, it could take a while.
6) If you have Ringtones in your iTunes and they’re not going back on your phone after all of this, plug your phone in and select the iPhone in Devices in iTunes and click the Ringtones tab. Deselect ’sync ringtones’ and it will display a message warning you that all ringtones will be removed from you phone. Accept that and click ‘apply’. After the phone has finished syncing, select ‘Sync Ringtones’ again and click apply. Allow it to sync. That successfully put the ringtones back on my phone.
I did this on March 6th 2010 on a Jailbroken 3G 16 gig running the 3.1.2 OS and it worked fine. Good luck with your own phones, I hope this works for you and I summarized the instructions clearly enough.