Whoa. How is it mounted if it's damaged/erased? This is weird. I think maybe I'm not fully understanding what is going on here. What does diskutil info disk0 tell you?
Ok, try: umount /dev/disk0
first. You might need a sudo on that. (In fact you might need a sudo for the diskutil eraseDisk. I'm more used to partitioning command line stuff in linux and solaris than os x.) If umount doesn't do it, try diskutil umount disk0.
Ok, try: umount /dev/disk0
first. You might need a sudo on that. (In fact you might need a sudo for the diskutil eraseDisk. I'm more used to partitioning command line stuff in linux and solaris than os x.) If umount doesn't do it, try diskutil umount disk0.