If you have the space, the entire hard drive can be imaged using the command (as root):
Code:
dd if=/dev/hda bs=1k conv=sync,noerror | gzip -c > /<a partition not on hda>/backup.img.gz
Then, if your system crashes a Linux live-cd can restore it using the command (again, as root):
Code:
zcat /<path to backup device>/backup.img.gz | dd of=/dev/hda bs=1k
Ubuntu might have it's own backup/restore utility... I don't know.
Note: I just wrote the above commands off the top of my head... check them before use.