NOTE: This is for Testing proposes only. IT is not official Proxmox, but I try to do it as close to the official way as possible. In the zfsonlinux change log, I tried adding a
jaminmc to the versioning, but the kernel would not compile, as the kernel compiling only works with official versioning.
I have made the update for OpenZFS to 2.4.0 as close as I could to the original implementation of 2.3.4 that is the current Proxmox. I mirrored
https://git.proxmox.com/?p=zfsonlinux.git;a=summary on my GitHub, and made a branch for OpenZFS 2.4.0
https://github.com/jaminmc/zfsonlinux. There you can see exactly what was done

.
So to make the current proxmox kernel, which is
proxmox-kernel-6.17.4-2-pve, you will need to disable secure boot in your bios, as the signing keys for the kernel are locked down.
Make a Debian 13 container with 50Gig of storage, at least 4 gigs of ram, and 2 gigs of swap, and give it as many cores as you can handle, as it will use all of them.
Then on Proxmox, I recommend that you make a shared folder, and then map it to your container. Change
CONTAINERID to match your container number:
Bash:
mkdir -p /shared/deb
chmod 777 /shared/deb
CONTAINERID=121
pct set $CONTAINERID -mp0 /shared/deb,mp=/shared/deb
Then ssh into your Debian 13 container, or do a
pct enter $CONTAINERID.
Setup the correct Repositories:
Bash:
cat > /etc/apt/sources.list.d/debian.sources << 'EOL'
Types: deb deb-src
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: contrib main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Types: deb
URIs: http://security.debian.org
Suites: trixie-security
Components: contrib main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOL
cat > /etc/apt/sources.list.d/proxmox.sources << 'EOL'
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-test
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOL
wget https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -O /usr/share/keyrings/proxmox-archive-keyring.gpg
Update and install needed tools:
Bash:
apt update && apt upgrade
apt install devscripts sudo
Clone the Proxmox Kernel (Latest):
Bash:
git clone --depth 10 git://git.proxmox.com/git/pve-kernel.git
cd pve-kernel
EDIT: Latest kernel has 2.4.0!!! Skip this step!! (Left here for posterity)
Remove old ZFS, and add new 2.4.0 Repo:
Bash:
git rm -f submodules/zfsonlinux
git submodule sync
git submodule add -b Openzfs2.4.0 https://github.com/jaminmc/zfsonlinux.git submodules/zfsonlinux
git submodule update --init --recursive
Now we install the Dependencies:
Bash:
mk-build-deps -ir submodules/zfsonlinux/debian/control
make build-dir-fresh
mk-build-deps -ir proxmox-kernel-6.17.4/debian/control
Now we build the Kernel and move the deb's to the shared folder after it finishes:
Code:
make deb && mv *.deb /shared/deb/
Now we need to compile the OpenZFS tools to update them, and move the debs.
Bash:
cd submodules/zfsonlinux/
make deb && mv *.deb /shared/deb/
rm /shared/deb/*dbgsym*
Now on Proxmox, run the following to update the Kernel and openzfs
Code:
dpkg --remove --force-depends libuutil3linux
apt install /shared/deb/{libnvpair3linux,libzfs6linux,libzpool6linux,zfs-initramfs,zfs-zed,zfsutils-linux}*.deb /shared/deb/proxmox-{headers,kernel}-6.17.*-pve_6.17.*_amd64.deb
apt-mark hold proxmox-(headers,kernel)-[Current Version here]
Then Reboot! You will have a working openzfs 2.4.0. You should see this when you run
zfs --version, or
zpool --version:
Bash:
root@proxmox:~# zfs --version
zfs-2.4.0-pve1
zfs-kmod-2.4.0-pve1
root@proxmox:~# zpool --version
zfs-2.4.0-pve1
zfs-kmod-2.4.0-pve1
You then may want to pin your kernel until there is one that has at least OpenZFS 2.4.0 in it if you use 2.4.0 features, or you may run into problems.
Bash:
proxmox-boot-tool kernel pin 6.17.4-2-pve