Question: In my spare time, I help administer a hosted Debian Linux server that serves a variety of websites and hosts email for a few people. It doesn't see huge volumes of traffic, but of course we want to do things properly. However, when we first got this server, someone rolled a custom kernel for us which allowed us to do various things that we wanted to do (like LVM, RAID etc). That's now a few years ago and of course there's various security bugs been fixed etc and we'd rather just be operating from a stock kernel that is kept up-to-date.

The problem is that we don't have a list of the features we enabled when we rolled the custom kernel and a couple of attempts to use a new one have resulted in a kernal that won't boot. So the question is - how do we go about using the stock Debian kernels whilst still being able to have all the functionality we depend on? What information do I need to gather first, and then what are the steps to make it happen?

Answer: 
Do you have /proc/config.gz or /boot/config-X.X.X for your current kernel?

If you do, just diff your config and the Debian one.

For what it's worth, the Debian configs enable pretty much everything - definitely RAID, LVM etc. Just make sure the initrd gets built when you install the Debian kernel as most things are modular in their kernel.

I haven't come across anything where I've had to build a custom kernel for a Debian server in a long time, except when I wanted to add kernel patches for whatever reason.
Setup your grub to boot your custom kernel as a [Fallback System](http://www.gnu.org/software/grub/manual/html_node/Booting-fallback-systems.html "Fallback Systems") to ensure that the server comes back up again even if the new kernel fails to boot.

Using that, you can safely `apt-get install` the `linux-image` for your hardware architecture, wich is most likely either `linux-image-686` or `linux-image-amd64` and try to reboot into that kernel.