I document quite a bit of tutorials and self made howtos in our intranet site so I decided to share this with everyone. It is mainly from the Proxmox wiki but the last few parts are from around the net and my knowledge. As you can see in the Proxmox wiki it added somethings later that fixed my problem but I had to reinstall the packages from scratch.
By the way
dpkg –get-selections | grep <whatever>
dokg –purge <package name>
is a great time saver when trying to fix what mistakes were made.
Feel free to email us if there is something wrong or not necessary.
Source:
http://pve.proxmox.com/wiki/ZFS#Native_ZFS_for_Linux_on_Proxmox_2.0
Basically watch what kernel headers you have and make a symbolic link that allows certain packages to build properly,
Install instructions:
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys F6B0FC61
aptitude update
Be warry of which kernel you are running with this one. Change as necessary.
ln -s /lib/modules/2.6.32-11-pve/build /lib/modules/2.6.32-11-pve/source
aptitude install pve-headers-2.6.32-11-pve
aptitude install dkms pve-headers-$(uname -r)
aptitude install ubuntu-zfs
I didn’t seem to need this one but I do it anyway since Im paranoid.
aptitude install spl-dkms
Just in case the kernel gets upgraded do this
aptitude install dkms pve-headers-$(uname -r)
then this to rebuild the packages
aptitude reinstall spl-dkms zfs-dkms
Now lets get it to startup with the system as well. Add the following to /etc/rc.local
#Mount ZFS storage
/usr/local/sbin/zfs-fuse
/usr/local/sbin/zfs mount -a
When the system reboots it tends to mount the directory that zfs has set as a mountpoint before zfs gets a chance since the zfs mount command is called in /etc/rc.local. I want to keep things as pristine as possible so this all can work even if an update occurs that changes things a bit so I will keep it as it is. The only thing I can think of is to make the commands apart of an /etc/init.d script then place it above file system mounting better yet above what ever proxmox is running to cause this.
I believe the issue is from what we set in the “Storage” tab. So i left that the same and will not bother it. Ran the following which creates a symlink to zfs new mountpoint which i changed with the command below.
Change zfs mount point directory no need to create it beforehand.
zfs set mountpoint /mnt/datapool0/vm datapool0
Mount it
zfs mount -a
Then run this to remove the vm subdirectory and create a link to the correct place
rm -rf /datapool0/vm;ln -s /mnt/datapool0/vm /datapool0/vm
Reboot and test. This was a quick fix and still work after reboots. Essentially just create some BS directory then symlink it to the real one afterward.
***UPDATE 08/05/2012***
I had an issue with the backups using snapshot instead of suspend. Suspend causes down time so I researched the error.
Undefined subroutine &PVE::Storage::cluster_lock_storage called at /usr/share/perl5/PVE/VZDump/QemuServer.pm line 240
Found this post:
http://forum.proxmox.com/archive/index.php/t-10438.html
I feared that this may mess up the current install of zfs and its dependencies being that we needed the kernel headers before. So I ran the suggested fix and it all came up after a reboot.
“aptitude update && aptitude full-upgrade” then reboot
The backups are working as expected using snapshot and not suspend.





