I don't know how it could be done on the Kindle itself, but if you have an image file, you can just use fdisk,parted, etc. using the file instead of a real device. If you're using some tool which refuses to work on files, you could losetup a device first.
It's pretty much exactly the same method as used here
, except that you're treating the device as a disk rather than as a partition (i.e., run fdisk /dev/loop0, rather than mkfs.ext3)