If you happen to use iTunes and are, like me, foolish enough to trust it to manage all your music for you, it might be worth doing a health check and a bit of spring cleaning.
I’ve been using iTunes for at least four years (the earliest file in my library claims to date from July 2005, but that’s probably just the date I learnt how to do non-destructive migrations), and have let iTunes to handle where and how it stores the music files I’ve collected. I noticed the other day that I’m using rather more disk space than I should, since I’m back to just 15gb free even though I’ve upgraded the hard disk of my Macbook Pro.
A quick check revealed that one of the big disk hogs is my iTunes collection, weighing in at around 50gb. However, iTunes itself reports that I have just 38gb of music, so somewhere around 12gb is being wasted – or, put another way, almost 10% of my hard disk.
A quick search in the command line gives some indication of what is going wrong:
find ~/Music/iTunes -name *\ 1.* |wc -l
1852
… for some reason, my music collection has lots of duplicates. For example, my copy of Moby’s “Play” includes 7 bonus tracks:
05 Southside 1.m4a
06 Rushing 1.m4a
10 7 1.m4a
11 Run On 1.m4a
12 Down Slow 1.m4a
15 Inside 1.m4a
16 Guitar Flute and String 1.m4a
I’m now doing a long and tedious trawl through my collection to remove these bogus tracks, though if anyone knows of a tool that will compare my iTunes library with the actual files on disk, I’d love to hear of it.
Related posts:
Did you try the “View/Show Duplicates” menu item?
The “Show Duplicates” menu item will identify identical tracks across multiple albums, but does not pick up on duplicates stored on disk for the same album. In fact, iTunes only thinks it has 38gb of music (so the dupes are not in the library)At some point it has obviously got confused over what is on disk.
The best way I’ve found for iTunes library clean up is to consolidate the library. Dig up a spare hard drive, tell iTunes preferences to store your music there and to keep your music organized, then choose “Consolidate Library” from the Advanced menu. That will only copy over files that are referenced in your iTunes library despite however many copies are on your current disk. Once you’re sure everything is cool, trash the old iTunes folder and repeat this in the other direction to move everything back to the original drive. Good luck!
Try this to locate duplicates:
find ~/Music/iTunes -type f -exec sha1sum “{}” \; | sort >dupecheck.txt
Then look through the list for items with the same SHA-1 digest. I wrote a bash script to check subsequent lines for the same digest, and to print out these lines, but that’s on my machine at home. This is a beginning, though.