Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if custom kernel modules that I compile and install via a package will persist through a kernel upgrade. I am trying to install ZFS as kernel module in Ubuntu but the problem is because of license conflicts I cannot make it directly part of the kernel. So I was wondering if I upgrade my kernel from the Ubuntu repo will APT doing anything to "migrate" the old kernel modules over to the new kernel. Because with something like ZFS I need to be very careful because my system would be sitting on ZFS and if I break it the system is unbootable.

Can someone give me some insight to whether I need to take special precautions or not.

share|improve this question
up vote 2 down vote accepted

If you install another kernel, any kernel modules you had on a prior kernel will NOT continue to work. Any kernel modules that do work in the new kernel will either be ones that are shipped directly with the kernel, or ones that are compiled automatically on boot using the DKMS system (see ).

With that said, you don't have to worry about upgrading your kernel as long as you keep the previous version of your kernel around, and know how to boot to it from the grub menu. If the new kernel doesn't work, just reboot into the old, working kernel.

share|improve this answer
Oh I see that makes sense. I was wondering what DKMS meant when referring to modules in linux. Cool thanks. – ianc1215 Jul 12 '12 at 0:58
Be careful though; if you want to use DKMS with a ZFS module, then you'll have to have DKMS compile against the new kernel and create the kernel module BEFORE you reboot into the new kernel. Because obviously you won't be able to mount the filesystem containing the necessary files (your C compiler, your Linux kernel headers, your ZFS source code, the DKMS binaries, etc.) if you can't mount your root filesystem, or whichever filesystem the files are mounted on. – allquixotic Jul 12 '12 at 3:34
Excelent point. Do you are saying to be sure the modules compile before I reboot. Gotch ya. – ianc1215 Jul 12 '12 at 13:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .