diff --git a/docs/zfs.md b/docs/zfs.md index 0cb05a4..659085a 100644 --- a/docs/zfs.md +++ b/docs/zfs.md @@ -13,3 +13,33 @@ sudo zfs set compression=zstd tank/myzstddataset sudo zfs set mountpoint=/data/mydataset tank/mydataset ``` +## Maintenance + +### Get Status + +``` +sudo zpool status +``` + +### Replace Disk + +``` +sudo zdb +sudo zpool status -g # Show by GUID +sudo zpool offline tank +sudo zpool status +# Remove old disk, insert new disk +sudo zdb +sudo zpool replace tank /dev/disk/by-id/ +sudo zpool status +``` + +## Initial Setup + +``` +sudo zpool create tank raidz1 sda sdb sdc +sudo zpool set ashift=12 tank +sudo zpool set autoexpand=on tank +sudo zpool set compression=on tank +``` +