How to Encrypt Partition under Ubuntu 11.10

Here is a quick how-to for password protecting and encrypting your partition using cryptsetup under Ubuntu/Kubuntu Oneiric Ocelot. It should work for older versions too but haven’t tested it.

Obviously you have to be root and have cryptsetup installed.
PS: I’m NOT responsible for any damage or data loss caused by executing the supplied code.