How to find where files reside on a partition
A disk defragmenter might do what you want for this. Possibly.

OS X since 10.3 automatically defragments files, but doesn't do anything to move them all to the 'top' of your volume. A 3rd party defragmenter might do this, which theoretically would clear out all the cruft that's preventing non-destructive repartitioning from taking place.

The other option is what Apple recommends in that dialog: clone the volume at the filesystem level, reformat, and then clone it back--when it rewrites, all of the files will be written one by one at the 'top' of the volume. Of course, if you need to do that, you might as well repartition while you're in the process of reformatting the disk.