go here and be happy
http://www.geekzone.co.nz/inane/1119
My God it took me so long to find that when i wanted to do it I wanted to make sure I posted it for you. That will work 100% for a backing up and then also reflashing a rom that is already on your phone. If you are trying to build one put it on an sd card and then flash I don't know though