ZFS: Difference between revisions
Created page with "How to use ZFS: ==Background== There are three levels to understand * zpools are a JBOD of one or more vdevs * vdevs are groups of drives, likely in raidz(2|3) or mirror. * d..." |
|||
Line 10: | Line 10: | ||
==Usage== | ==Usage== | ||
<pre> | <pre> | ||
# Create a zpool with a mirror vdev | # Create a zpool with a mirror vdev. | ||
zpool create -f -o ashift=12 $zpool_name mirror \ | zpool create -f -o ashift=12 -o compression=lz4 $zpool_name mirror \ | ||
/dev/disk/by-id/diskA \ | /dev/disk/by-id/diskA \ | ||
/dev/disk/by-id/diskB | /dev/disk/by-id/diskB | ||
# Create a dataset. | |||
zfs create -o encryption=aes-256-gcm -o keyformat=passphrase $zpool_name/$dataset_name | |||
</pre> | </pre> | ||
Revision as of 01:03, 7 November 2021
How to use ZFS:
Background
There are three levels to understand
- zpools are a JBOD of one or more vdevs
- vdevs are groups of drives, likely in raidz(2|3) or mirror.
- datasets are filesystems stored on a zpool
- z
Usage
# Create a zpool with a mirror vdev. zpool create -f -o ashift=12 -o compression=lz4 $zpool_name mirror \ /dev/disk/by-id/diskA \ /dev/disk/by-id/diskB # Create a dataset. zfs create -o encryption=aes-256-gcm -o keyformat=passphrase $zpool_name/$dataset_name
Pros and Cons
VS Snapraid + btrfs + mergerfs
- Pros
- ZFS has realtime parity.
- ZFS can work while degraded.
- ZFS snapshots with send and receive.
- ZFS has encryption on per-dataset.
- ZFS handles everything altogether including parity on permissions
- Cons
- The main con is that ZFS is less expandable. You need to buy all of your drives up front.
- If many drives die, i.e. >2 for raidz2, you lose all your data.