Created
April 17, 2018 22:02
-
-
Save joeljacobs/6b277a9237130b1ed5706166110dab5f to your computer and use it in GitHub Desktop.
Add ZFS swap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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