How to Create a Disk Image of an Entire Mac Hard Drive

You can image a Mac hard drive with the help of a free third party utility called Carbon Copy Cloner. The resulting image will be saved as the familiar .dmg format, this has a number of potential uses ranging from creating a drive clone for backup purposes, restoring the image elsewhere as a bootable backup, or even for deploying the same Mac OS X installation on multiple machines.
The process below will describe how to create an exact image replica of a selected Mac hard drive. If the hard drive being imaged is very large the resulting disk image is also going to be large, be sure to have adequate space to support the image or consider saving it to another location.
- Get Carbon Copy Cloner free from Bombich and copy it to the /Applications/ folder
- Launch Carbon Copy Cloner and pull down the “Source” menu, selecting “Macintosh HD” or whatever the Mac hard disk is named
- Pull down the “Destination” menu and choose “New Disk Image”
- Give the disk image a name and select a destination, if you don’t have the local storage capacity for such a large disk image be sure to choose an external or network drive as the image destination
- Pull down the “Image Format” menu and choose “Read-only disk image”, this saves the image as the familiar DMG format
- Click “OK”
- Back at the main CCC menu, choose “Clone” to create the exact replica of the drive as a disk image file


The process of creating the disk image can take a very long time depending several factors, including the speed of the Mac, the size of the disk being imaged, and the destination of the image itself. Don’t be surprised if it takes quite a while to create the backup file.
When finished you’ll have an exact replica of the Macs hard drive in the form of a .dmg image file. If you intend on using the image on a Windows PC, you may want to convert it to an .iso first.
You’ll notice we didn’t choose to create an encrypted image, that is an option you can use if it fits your use case, though creating encrypted drive images takes even longer and they also have the potential of issues when restoring down the road.

http://support.apple.com/kb/ht1553
Check out this link.
Disk Utility does the same thing.
if i create a disk image, *.dmg file, and format my hard drive. Can i drag applications off the disk image onto my new formatted HDD and the applications will install/run like normal?
Can it be run when system is up, or does it require u to boot off something?
Image of entire Mac can be created by Disk utility, which is an inbuilt feature of Mac OS X. Follow these steps:-
1. Go to Applications > Utilities
2. From the File menu, select New > Disk Image from Folder.
3. Select the Drive , click the New Image button
4. Choose the destination where you want to store your image
5. Once the disc image is created, it will appear in the left pane in the Disk Utility application.