Another great way is to use the tool in this thread:
[APP] Windows: Create Your Own Data.img Maker Application, +/- From Existing data.img - xda-developers
I used this last week to expand my data.img from the normal 256 to 1024. What I love is that it does not force you to start with an empty data.img file, it takes your existing one and allows you to expand it up to 2gb in just a few clicks!
I STRONGLY recommend this for those who are not tech savy, or need a WYSIWYG gui to guide them.
Great thread and write-up here btw.