How Can We Help?
< All Topics
Print

Proxmox ZFS Mastery: A Step-by-Step Tutorial

ZFS is a scalable local file system and logical volume manager that manages data placement, storage, and retrieval in enterprise-class computing systems, ensuring at least two metadata copies are stored every time data is written to disk.

a) How do I activate email notifications in Proxmox ?

1. First, enter the /etc/zfs/zed.d/zed.rc command to enter the file.

2. Then, find the ZED_EMAIL_ADDR and set it to root by default.

b) How do I limit ZFS memory usage in Proxmox ?

1. First, enter the /etc/modprobe.d/zfs.conf command to enter the file.

2. Then, enter the options zfs zfs_arc_max=8589934592 command in it.

Note: To ensure zfs_arc_max is set to at most zfs_arc_max-1, update the configuration in /etc/modprobe.d/zfs.conf, where options zfs zfs_arc_min=8589934591 and options zfs zfs_arc_max=8589934592; otherwise, zfs_arc_max will be ignored.

Note: To update the initramfs in your ZFS root file system, use the update-initramfs -u command every time the value changes.

c) How do I swap on ZFS in Proxmox ?

1. First, enter the sysctl -w vm.swappiness=10 command to swap on ZFS.

2. You can use the vm.swappiness=10 command to make the swappiness persistent.

proxmox

d) How does ZFS compression work in Proxmox ?

1. First, enter the zpool set compression=lz4 <pool> command to activate compression.

2. Then, enter the zfs set compression=off <dataset> command to disable compression at any time.

e) How do I use the ZFS special device in Proxmox ?

Note: The redundancy of the special device should match the pool’s redundancy, as it serves as the point of sale for the entire pool.

Note: The addition of a unique device to the pool cannot be undone.

1. First, enter the zpool create -f -o ashift=12 <pool> mirror <device1> <device2> special mirror <device3> → <device4> to create a pool with a special device and RAID-1.

2. Then, enter the zpool add <pool> special mirror <device1> <device2> command to add a special device to an existing pool with RAID-1.

Note: If the special_small_blocks value exceeds or equals the dataset’s default record size of 128K, all data will be written to the special device, requiring caution.

3. After that, enter the zfs set special_small_blocks=4K <pool> command to opt in for all files smaller than 4K-block spool-wide.

4. You can use the zfs set special_small_blocks=4K <pool>/<filesystem> command to opt in for small file blocks for a single dataset.

5. You can also use the zfs set special_small_blocks=0 <pool>/<filesystem> command to opt out of small file blocks for a single dataset.

f) How do I corrupt the cache file in Proxmox ?

1. First, enter the zpool set cachefile=/etc/zfs/zpool. cache POOLNAME command to run each pool.

2. Then, enter the update-initramfs -u -k all command to update the initramfs.

Table of Contents