1.6.1. Set-up ZFS volume in RAID 10 and add it as Storage¶
CLI Setup¶
On a shell terminal
$ 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/ZFSA
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)¶
Edit the file /lib/systemd/system/pvestatd.service and add or modify the following line
After=pve-cluster.service zfs-mount.service
- Set the properties:
is_mountpoint to 1 and mkdir to 0 for the ZFS Mountpoints in /etc/pve/storage/storage.cfg
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>