I'm curious... does this happen to non-jailbroken devices? Was this a problem with versions of firmware prior to 1.1.4?
I sometimes wonder if it's the infamous USB erase issue that sometimes occur when you unplug a device without ejecting it but I doubt it since the media is technically not gone (and this has never happened to me before on other USB devices.) I used
iPod Access for Windows the first time this happened to recover everything from my Touch prior to a restore. It would appear the missing media is due to a corruption in the /var/mobile/Media/iTunes_Control/iTunes/iTunesDB file. Deleting this file allowed my Touch to be recognized by iTunes again... However, this caused other problems leaving the rest of the items in the surrounding folders (such as the old music/videos being seen as "Other" files and when syncing anew the old media is not overwritten so this is not enough to fix the issue, I wish it was though!)
I have a LOT of applications and configuration settings that restoring my iPod Touch takes a looooong time and I loath to start from scratch every few weeks or once a month. Honestly there isn't anything wrong with any of my other applications except according to my Touch I have no music or videos (even though they still exist on the device.) WiFi works, calendar, mail, weather, downloaded apps, etc, etc are still fully functional.
If you're device is jailbroken then you might find the following to be useful for getting your music and video back on. I use the manual sync option:
- Make sure you have all of your music and videos imported and recognized in iTunes so that they will not require any manual changes prior to sync.
- Ssh as root to your Touch (requires jailbreak, BSD subsystem and SSH) and remove the /var/mobile/Media/iTunes_Control. This removes all music, videos, artwork, etc. Syntax would be "rm -r /var/mobile/Media/iTunes_Control" without the quotes. This is applicable on the 1.1.4 firmware (and maybe 1.1.3, not sure.) Older firmware I believe the folder is /var/root/Media/iTunes_Control but you'll need to determine this yourself. Boss tools used to have an app that did this but it was for older firmware (perhaps there is an updated one but I've not found it yet.)
- When you plug this back into your computer iTunes will recognize the devices as new and ask to start from scratch or restore. I choose to set it up as a new device which is all we need since all music and videos are gone but the rest of the device settings are still fine. Restoring will revert some of your other configuration settings and may make a mess depending on the last time your device backed up.
- Sync your music, video, podcasts and pictures (you have to redo pictures even though they are fine on the device because the new DB has no knowledge of them. New syncs will require the old ones be deleted as a result so you might as well do it when you sync the rest and get it over with.)
Depending on the size of your device (mine is 32GB) and the amount of media you have on it will this can take anywhere from 1-4 hours. This is still better than several days and forgetting half the things you had on it prior to the missing music/videos. The next time this occurs I'll work on a better way to do this but for now this is a clear and certain way to get things back to the way they were without having to go through too much trouble or worry about any mess left behind.