GeistHaus
log in · sign up

ZFS Commands Cheat Sheet

willhaley.com

My commonly used zfs commands. I find the Arch Wiki ZFS article to be a great resource, and is more complete and meaningful reference than my commonly used commands listed here. Export a pool from a machine This should be done before unplugging drives and plugging them into a new machine. zpool export mypool List pools zpool list List pools with datasets zfs list Change encrypted dataset key location zfs set keylocation=file:///keys/my.key mypool/mydataset View/get encrypted dataset key location zfs get keylocation mypool/mydataset Load the key for a dataset zfs load-key -r mypool/mydataset Mount a dataset zfs mount mypool/mydataset Change the mountpoint of a pool zfs set mountpoint=/mnt/mymount mypool Change the mountpoint of a dataset zfs set mountpoint=/mnt/mymount mypool/mydataset Create an encrypted pool (no dataset) sudo zpool create \ -o feature@encryption=enabled \ -O encryption=on \ -O keylocation=file:///keys/my.key \ -O keyformat=raw \ -O mountpoint=/mnt/mymount \ mypool /dev/my/device/123 Rename a pool zpool export mypool zpool import mypool mypool-with-new-name Rename a dataset zfs rename mypool/mydataset-old-name mypool/mydataset-new-name Rename/change the udev symlink of a pool If disks were added with references like /dev/sdX the entire pool can be exported and re-imported with the -d search path to use predictable dev node names.

0 pages link to this URL

No pages have linked to this URL yet.