You can use dd
# dd if=/dev/sda of=/path/to/dump.bin bs=8M
This makes an image of /dev/sda as dump.bin. Note that "bs" refers to block size, and basically means how much does dd read/write at a time. You'd want to have a somewhat large block size to speed things up
When you get a new hard drive, you can dump the image back using the following command (assuming your new drive is /dev/sdb)
# dd if=/path/to/dump.bin of=/dev/sdb bs=8M
This will basically make your new drive a byte-by-byte clone of your old drive. Note that this also means any data in your new drive will be permanently erased!
However, the new drive much be at least the same size as the image.
You can also combine this command with compression tools such as gzip or bzip2 to achieve compression, which will compress a lot
If your hard drive is failing, this may not work, if there were errors while reading (or writing)
Also, if you're having trouble copying all of the disk, you can alternatively attempt to make a dump of only /dev/sda1 (which contains your system files), and attempt to copy your /home files on a file-by-file basis. On your new drive you can then recreate your partition layout manually and dump the file into the appropriate partition.