Set up a zfs Pool on Proxmox

While it is possible to configure zfs pools from within the Proxmox web interface, you have more control if you create it using the command line.

You can read more about zfs on Proxmox here: https://pve.proxmox.com/wiki/ZFS_on_Linux

Identify Your Devices

Start by identifying the drives you want to include in your new zfs pool.

I’m using disk by-id to reference my physical drives – referencing by ID is preferable because the drives are identified by their hardware as opposed to their location in the SATA chain. For example, if the drives are moved to a different port in the system they will still be configured correctly.

# cd /dev/disk/by-id
# ls -l

lrwxrwxrwx 1 root root 9 Mar 9 23:42 wwn-0x50014ee26913f7a0 -> ../../sdb
lrwxrwxrwx 1 root root 9 Mar 9 23:42 wwn-0x50014ee2be6a01e0 -> ../../sda
# zpool create wd2tb -o ashift=12 raidz1 /dev/disk/by-id/wwn-0x50014ee26913f7a0 /dev/disk/by-id/wwn-0x50014ee2be6a01e0

It’s not available to use yet. You still need to add it as “storage” within Proxmox. You do that by adding it in the storage menu. Enable thin provision because that works best if you want to host VM’s on it.

# zpool create wd2tb -o ashift=12 raidz1 /dev/disk/by-id/wwn-0x50014ee2be6a01e0 /dev/disk/by-id/wwn-0x50014ee26913f7a0

# zfs set compression=lz4 wd2tb

# zfs create wd2tb/wd-data