ZFS on linux upgrade from 0.6.2 to 0.6.3 made my zpool unreadable help translate CentOS to Ubuntu commands

$ sudo find /lib/modules/$(uname -r)/updates -name "splat.ko" -or -name "zcommon.ko" -or -name "zpios.ko" -or -name "spl.ko" -or -name "zavl.ko" -or -name "zfs.ko" -or -name "znvpair.ko" -or -name "zunicode.ko" | xargs rm -f
$ sudo apt-get install --reinstall ubuntu-zfs
$ sudo apt-get install --reinstall $(dpkg-query --show --showformat='${binary:Package}\n' | egrep 'spl|zfs')

Ubuntu keeps all its dkms in /lib/modules/$(uname -r)/updates, rather than in /lib/modules/$(uname -r)/extra and find /lib/modules/$(uname -r)/weak-updates as CentOS does.

yum resinstall is equivalent to apt-get install --reinstall.
Ubuntu's zfs metapackage is ubuntu-zfs instead of zfs-release as it is in CentOS.
rpm -qa is equivalent to dpkg-query --show --showformat='${binary:Package}\n'

I'm also uncertain if the find command actually needs to be run, as apt-get may take care of that already, but running it won't break the process.

Someone with more knowledge of or experience with dpkg may be able to write a marginally more efficient command, but I suspect this is good enough for most purposes.


The official bug page has this fix for Ubuntu and Debian users:

# apt-get update
# apt-get dist-upgrade
# reboot

I have debian-zfs installed on proxmox 3.2 (using this kernel pve-headers-2.6.32-26-pve). This is how I fixed it after the upgrade.

aptitude purge dkms debian-zfs spl-dkms zfs-dkms

I chose "Yes" to all the prompts, to remove it all. After that was done, I did some checking if there are any dkms leftovers. The below command should show an empty directory.

ls /lib/modules/2.6.32-26-pve/updates/dkms/

If you see anything in there (the above directory), you need to delete it all (unless you have other custom kernel modules).

Then it was as simple as:

apt-get install debian-zfs

Then import my pool (my pool is called tank):

zpool import tank

zfs got upset because it was not properly exported before all the drama happened.

cannot import 'tank': pool may be in use on another system

That's not a problem, I tried again with this:

zpool import -f tank

The above worked, and I was able to see my pool with this command:

zpool status
    root@proxmox-01:~# zpool status
  pool: tank
 state: ONLINE
  scan: scrub repaired 0 in 0h8m with 0 errors on Tue Jul  8 20:39:13 2014
config:

        NAME                                           STATE     READ WRITE CKSUM
        tank                                           ONLINE       0     0     0
          raidz2-0                                     ONLINE       0     0     0
            scsi-SATA_WDC_WD1001FALS-_WD-WMATV4198253  ONLINE       0     0     0
            scsi-SATA_WDC_WD1002FAEX-_WD-WCAW30398837  ONLINE       0     0     0
            scsi-SATA_WDC_WD1002FAEX-_WD-WCAW30404054  ONLINE       0     0     0
            scsi-SATA_WDC_WD1002FAEX-_WD-WCAW30406039  ONLINE       0     0     0

errors: No known data errors

I was happy with this. But proxmox was a little bit more difficult. I had to mess about with the mount point for proxmox, because it automatically creates the directory structure of "storage" that you add to proxmox.

First I check if /tank was not lovely zfs pool, using du -hs /tank. My pool has a lot of stuff in it, a lot more than 12KB.

I export (disconnect) my zfs pool zpool export tank

I removed the EMPTY /tank directory with rm -R /tank (please double check!!)

Then I import my pool (connect) zpool import tank and your zfs storage should be working, and accessible to proxmox.

This is how I got my zfs to work on proxmox in the first place:

http://www.anotherlan.com/proxmox-zfs-on-linux-local-storage