ZFS Cheatsheet
#
ZFS (Zettabyte File System) is a combined file system and logical volume manager designed for high storage capacities and data integrity.
Pool Management
#
Command/Option | Example | Description |
---|
zpool create | zpool create mypool /dev/sdX1 | Create a new ZFS storage pool |
zpool destroy | zpool destroy mypool | Destroy a ZFS storage pool |
zpool status | zpool status mypool | Display the status of a ZFS pool |
zpool list | zpool list | List all ZFS pools |
zpool scrub | zpool scrub mypool | Start a scrub operation to check for data integrity |
File System Management
#
Command/Option | Example | Description |
---|
zfs create | zfs create mypool/mydataset | Create a new ZFS file system |
zfs destroy | zfs destroy mypool/mydataset | Destroy a ZFS file system |
zfs list | zfs list | List all ZFS file systems |
zfs snapshot | zfs snapshot mypool/mydataset@snapshot1 | Create a snapshot of a ZFS file system |
zfs rollback | zfs rollback mypool/mydataset@snapshot1 | Roll back to a specific snapshot |
Quotas and Reservations
#
Command/Option | Example | Description |
---|
zfs set quota | zfs set quota=10G mypool/mydataset | Set a quota on a ZFS file system |
zfs set reservation | zfs set reservation=5G mypool/mydataset | Set a reservation on a ZFS file system |
Properties and Tuning
#
Command/Option | Example | Description |
---|
zfs get | zfs get all mypool/mydataset | Get all properties of a ZFS file system |
zfs set | zfs set compression=lz4 mypool/mydataset | Set a property on a ZFS file system |
zfs inherit | zfs inherit compression mypool/mydataset | Inherit a property from the parent dataset |
Replication and Send/Receive
#
Command/Option | Example | Description |
---|
zfs send | zfs send mypool/mydataset@snapshot1 > /path/to/backup | Send a snapshot to a file |
zfs receive | zfs receive mypool/mydataset < /path/to/backup | Receive a snapshot from a file |
Zpool and ZFS Commands
#
Command/Option | Example | Description |
---|
zpool upgrade | zpool upgrade | Upgrade ZFS pools to the latest version |
zfs get | zfs get all mypool/mydataset | Display all properties of a ZFS dataset |
This cheatsheet covers essential ZFS commands and options to help you manage and maintain ZFS file systems and storage pools effectively.