You are best advised to do a back up to an external storage device such as a hard drive to achieve that, you can create a recovery partition on your installed hard drive, but if the hard drive is the component that fails then everything is lost.
A recovery partition is good though to repair damaged software contained on the working part of the hard drive.
Macrium Reflect is a good and free way of doing this, others are mainly 30 day free trials.
It will either clone the entire disc or just the data needed to reinstall the operating system, whichever you want;
http://www.macrium.com/reflectfree.aspx
After you have downloaded it register it and you will then get an e-mail explaining how to use it a short time later.
The full and rather tedious explanation from Microsoft about Macrium and reinstalling Windows for the last time is in the link below;
http://www.officialwindowsmagazine.com/news/reinstall-windows-for-the-last-time/
Regards, Bob.