Skip to content

Instantly share code, notes, and snippets.

@joeljacobs
Created April 17, 2018 22:02
Show Gist options
  • Save joeljacobs/6b277a9237130b1ed5706166110dab5f to your computer and use it in GitHub Desktop.
Save joeljacobs/6b277a9237130b1ed5706166110dab5f to your computer and use it in GitHub Desktop.
Add ZFS swap
function zfsswap { pool=${1-rpool}; gigs=${2-50};zfs create -V ${gigs}G -b $(getconf PAGESIZE) -o compression=zle -o logbias=throughput -o sync=always -o primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false $pool/swap && mkswap -f /dev/zvol/$pool/swap && echo /dev/zvol/$pool/swap none swap defaults 0 0 >> /etc/fstab && swapon -av ; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment