Debian: reinstall zfs when changing the linux kernel

root's picture

Your zfs was working properly but you have upgraded your system, including the kernel, and your zfs is no more available.
This is normal because zfs was compiled for the other one.
So all you will have to do is to execute the following commands (do not forget of course to install/put in place the needed linux source or headers before that):
dpkg-reconfigure spl-dkms
dpkg-reconfigure zfs-dkms

PS: If you install the debian package of linux-headers (e.g. linux-headers-3.16.0-4-amd64), most probably the zfs modules will be compiled automatically. Do above commands if you have the kernel/headers installed manually.

And no matter what, at the end, you will have to restart zfs:

root@pluto:~# zfs list
no datasets available
root@pluto:~# /etc/init.d/zfs-mount stop
[ ok ] Checking if zfs userspace tools present.
[ ok ] Unmounting ZFS filesystems.
[ ok ] Unmounting volumes registered in fstab: .
[....] Exporting ZFS poolsrmmod: ERROR: Module zfs is in use
. ok
root@pluto:~# /etc/init.d/zfs-mount start
[ ok ] Checking if zfs userspace tools present.
[ ok ] Importing ZFS pool backups (using /dev/disk/by-vdev)[....] Importing ZFS pool backups (using /dev/disk/by-id).
[ ok ] Mounting ZFS filesystems not yet mounted.
[ ok ] Mounting volumes registered in fstab: .
root@pluto:~# zpool list
NAME      SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
backups   200G   106G  93.1G     16.0E      -    53%  1.00x  ONLINE  -

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content