Help on saving sdcard image?

I have been using linux for a little while but only as a desktop user to do away with Windows. Hope to use the raspberry pi to learn more about linux and get my 10 year old into thinking more of PC's then just games.

Anyway. I bought a new Ultra SD Scandisk card 8 GB etc. Picked Debian Squeeze, went through the install and resize procedure as listed on the wiki, booted up the device then enabled ssh and installed xrdp, provided a root password. I ran apt-get update and also tried to use apt-get to install fswebcam and aptitude-gtk. I started to notice errors such as missing paths and other messages I should have saved or written down.

So once again to ensure I have a good working system I have just re-installed the SD card and got back to the stage before using 'apt-get update'.

What I would like to know is how can I save the image from the card on to my desktop PC as pi8gb.img. That way I could save time to get back to a good install when ever I screw it up?Cheers

One the size of the partiation has been increased on the SD card, a DD of the raw image will give rather a large file. If you want to save some space, instead just take a copy of the files, so something like:

cd /path/to/roottar cf ../debian.tar .

then probably compress the result

bzip2 debian.tar

To extract do reverse:

cd /path/to/rootbunzip2 -c ../debian.tar.bz2 | tar xf -

That should save some space. also look at xz compression if you want very small images.