Skip to content

Instantly share code, notes, and snippets.

@aspyct
Last active July 28, 2023 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspyct/9b604979f6717c8ac6d5cc1cffb759e0 to your computer and use it in GitHub Desktop.
Save aspyct/9b604979f6717c8ac6d5cc1cffb759e0 to your computer and use it in GitHub Desktop.
ZFS Essentials
# Create a ZFS pool (i.e. choose disks that are part of the storage)
# In this case, it's a two-disk mirror
# Make sure to use /dev/disk/by-id/* for a stable pool
sudo zpool create <pool_name> mirror /dev/disk/by-id/<disk1> /dev/disk/by-id/<disk2>
sudo zfs create <pool_name>/<dataset_name>
# Check status
sudo zpool status
# Change the mountpoint of a volume
sudo zfs set mountpoint=/path/to/directory poolname/volumename
# Rename a volume
sudo zfs rename poolname/volumename poolname/newvolumename
# Destroy a volume
sudo zfs destroy poolname/volumename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment