User Tools

Site Tools


quickreference:zfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
quickreference:zfs [2022/12/17 14:10] – [iSCSI considerations] rodolicoquickreference:zfs [2024/02/03 23:04] (current) rodolico
Line 56: Line 56:
 # turn swap back on (could also use swapon /dev/zvol/storage/swap, but I'm lazy) # turn swap back on (could also use swapon /dev/zvol/storage/swap, but I'm lazy)
 swapon -aL swapon -aL
 +</code>
 +
 +===== Using a file for swap space =====
 +
 +Instead of using a swap partition or zvol, we can simply use a file. In this case, we can add swap space by deleting/recreating the swap file (after turning swap off), but a simpler way if you need more swap space is to simply add a second swap file.
 +
 +Following code creates an 8G swap file. Note that after reading https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/, I modified my old way of doing this.
 +
 +<code bash>
 +# create an 8G swap file
 +dd if=/dev/zero of=/swap bs=1G count=8
 +# set permissions
 +chmod 0600 /swap
 +# look for an unused md device (ie, not listed)
 +mdconfig -lv 
 +cp /etc/fstab /etc/fstab.save
 +# edit /etc/fstab and add the following line, using the correct md##
 +joe /etc/fstab
 +md42 none swap sw,file=/swap 0 0
 +# save your file
 +# turn on swap
 +swapon -aq
 +# look at swap information
 +swapinfo -k
 </code> </code>
  
Line 158: Line 182:
    * https://wordpress.morningside.edu/meyersh/2009/11/30/zfs-deduplication/    * https://wordpress.morningside.edu/meyersh/2009/11/30/zfs-deduplication/
    * https://linuxhint.com/zfs-deduplication/    * https://linuxhint.com/zfs-deduplication/
 +   * https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/
  
  
quickreference/zfs.txt · Last modified: 2024/02/03 23:04 by rodolico