This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| computing:zfsreminders [2022/08/05 00:22] – created oemb1905 | computing:zfsreminders [2025/02/21 02:42] (current) – oemb1905 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Rename | + | ------------------------------------------- |
| + | * **zfsreminders** | ||
| + | * **Jonathan Haack** | ||
| + | * **Haack' | ||
| + | * **webmaster@haacksnetworking.org** | ||
| + | |||
| + | ------------------------------------------- | ||
| + | |||
| + | // | ||
| + | |||
| + | ------------------------------------------- | ||
| + | |||
| + | Create a pool on a single drive and specify a mountpoint for it. Note: use id, not uuid. | ||
| + | |||
| + | | ||
| + | |||
| + | If you have more than one drive to begin with, you can make mirrors as follows: | ||
| + | |||
| + | zpool create -m /mnt/Pool Pool -f mirror / | ||
| + | |||
| + | If you accidentally used short names, then export and import to change it asap like this: | ||
| + | |||
| + | zpool export vms | ||
| + | zpool import -d / | ||
| + | |||
| + | If you messed up and picked a wrong name and/or mountpoint, adjust later as follows. To rename: | ||
| zpool export [pool_name] | zpool export [pool_name] | ||
| zpool import [original_pool_name] [new_pool_name] | zpool import [original_pool_name] [new_pool_name] | ||
| | | ||
| - | Change | + | To change |
| zfs set mountpoint=/ | zfs set mountpoint=/ | ||
| | | ||
| - | Adding another | + | If you now have more than one drive, add another |
| - | zpool attach nameofpool /dev/disk/ | + | zpool attach nameofpool |
| | | ||
| + | To create an encrypted dataset you generate a key and then specify the location and name of the pool as follows: | ||
| + | |||
| + | dd if=/ | ||
| + | zfs create -o encryption=on -o keyformat=raw -o keylocation=file:/// | ||
| + | | ||
| + | After reboot, import (mount), the data set as follows: | ||
| + | |||
| + | zfs load-key pool/ | ||
| + | zfs mount pool/ | ||
| + | | ||
| + | If you need to delete a dataset, do the following: | ||
| + | |||
| + | zfs destroy -r pool/ | ||
| + | | ||
| + | To create snapshots, here is a reasonable template: | ||
| + | |||
| + | DATE=`date +" | ||
| + | / | ||
| + | | ||
| + | To delete all snapshots and start over: | ||
| + | |||
| + | zfs list -H -o name -t snapshot | xargs -n1 zfs destroy | ||
| + | | ||
| + | To add a zfs cache or slog hard drive to your pool, do the following: | ||
| + | |||
| + | zpool add pool cache / | ||
| + | zpool add pool log / | ||
| + | |||
| + | To view current snapshots, do the following: | ||
| + | |||
| + | zfs list -r -t snapshot -o name, | ||
| + | zfs list -r -t snapshot -o name, | ||
| + | | ||
| + | To view pool space, including snapshots, do the following: | ||
| + | |||
| + | zfs list -ro space | ||
| + | | ||
| + | To replace a failed drive, power down the host, remove drive, reboot, get '' | ||
| + | |||
| + | sudo zpool replace pool < | ||
| + | sudo zpool replace pool 3347762980558930904 / | ||
| + | |||
| + | To check the health, statistics, and basic specs of your pool: | ||
| + | |||
| + | zpool status -v | ||
| + | zpool iostat -v | ||
| + | zpool list -v | ||
| + | | ||
| + | Also, to see whether cache volume is necessary, run and look at cache hit/miss ratio: | ||
| + | |||
| + | arc_summary | ||
| + | |||
| + | Change location of the keys for your encrypted datasets: | ||
| + | |||
| + | sudo zfs set keylocation=file:/// | ||
| + | | ||
| + | Send and receive entire pool to new pool | ||
| + | |||
| + | zfs snapshot -r pool1@latestsnap | ||
| + | zfs send -R pool1@latestsnap | zfs receive -F pool2 | ||
| + | | ||
| + | Arc information | ||
| + | | ||
| + | arcstat | ||
| + | arc_summary -d | less | ||
| + | nano / | ||
| + | <# 8GB example - 8*(2^30) = below> | ||
| + | <# | ||
| + | <# Set Max ARC size => 2GB == 2147483648 Bytes> | ||
| + | <options zfs zfs_arc_max=2147483648> | ||
| + | <# Set Min ARC size => 1GB == 1073741824> | ||
| + | <options zfs zfs_arc_min=1073741824> | ||
| + | cat / | ||
| + | cat / | ||
| + | |||
| + | nmap tests and other security checks | ||
| + | |||
| + | nmap -sV --script ssl-enum-ciphers -p 443 website.com | ||
| + | nikito -h website.com | ||
| + | wpscan --url https:// | ||
| + | |||
| + | --- // | ||