Proxmox VE ZFS Volume Setups
CLI Setup
On a shell terminal execute the following (rename the zfs to your liking):
$ zpool create -f -o ashift=12 zfsa mirror /dev/sda /dev/sdb mirror /dev/sdc /dev/sdd
$ zfs list
$ zfs create -o mountpoint=/mnt/zfsa zfsa/mountpoint
GUI Setup
Go to Proxmox VE → Datacenter → Storage → Add the zfsa ZPOOL as a ZFS Storage
Go to Proxmox VE → Datacenter → Storage → Add the /mnt/zfsa as a Directory
Important Tweaks (CLI)
Mountpoint Options
Edit the file /lib/systemd/system/pvestatd.service and add or modify the following line
After=pve-cluster.service zfs-mount.service
Set the following properties for the ZFS Mountpoints in /etc/pve/storage.cfg
:
Arguments in italics are deprecated or older.
- create-base-path 0
- is_mountpoint 1
- mkdir 0
Disabling ATIME
If you do not have a specific case for which you’ll need to get the logged access
times for a file, disabling atime
in your zfs pool may improve performance.
zfs set atime=off zfsa
Create a new zpool
To create a new pool, at least one disk is needed. The ashift should have the same sector-size (2 power of ashift) or larger as the underlying disk.
$ zpool create -f -o ashift=12 <pool> <device>
Create a new pool with RAID-0
Creating a ZFS Pool with RAID-0 requires a minimum of 2 Disks
$ zpool create -f -o ashift=12 <pool> <device1> <device2>
Create a new pool with RAID-1
Creating a ZFS Pool with RAID-1 requires a minimum of 2 Disks
$ zpool create -f -o ashift=12 <pool> mirror <device1> <device2>
Create a new pool with RAID-10
Creating a ZFS Pool with RAID-10 requires a minimum of 4 Disks
$ zpool create -f -o ashift=12 <pool> mirror <device1> <device2> mirror <device3> <device4>
Create a new pool with RAIDZ-1
Creating a ZFS Pool with RAIDZ-1 requires a minimum of 3 Disks
$ zpool create -f -o ashift=12 <pool> raidz1 <device1> <device2> <device3>
Create a new pool with RAIDZ-2
Creating a ZFS Pool with RAIDZ-2 requires a minimum of 4 Disks
$ zpool create -f -o ashift=12 <pool> raidz2 <device1> <device2> <device3> <device4>
Enabling Compression
To activate compression use the following command in Command Line
$ zfs set compression=lz4 <pool>