User Tools

Site Tools


unix:freebsd:zfs

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
unix:freebsd:zfs [2019/03/02 00:23]
rodolico [ZFS Volumes]
unix:freebsd:zfs [2019/03/02 00:36] (current)
rodolico [ZFS Volumes]
Line 94: Line 94:
 //A volume is a special type of dataset. Rather than being mounted as a file system, it is exposed as a block device under /​dev/​zvol/​poolname/​dataset. This allows the volume to be used for other file systems, to back the disks of a virtual machine, or to be exported using protocols like iSCSI or HAST.// //A volume is a special type of dataset. Rather than being mounted as a file system, it is exposed as a block device under /​dev/​zvol/​poolname/​dataset. This allows the volume to be used for other file systems, to back the disks of a virtual machine, or to be exported using protocols like iSCSI or HAST.//
  
-zfs volumes are created using the -V parameter, and statically creating a size on creation. The basic syntax is+zfs volumes are created using the -V parameter, and statically creating a size on creation. The basic syntax is as follows (volblocksize is set to the default, 8k, and volmode=dev gives faster access when used over iSCSI)
  
 <code bash> <code bash>
-zfs create -V 10G storage/​virtual_2+zfs create -V 10G -o volblocksize=8K,​volmode=dev ​storage/​virtual_2
 </​code>​ </​code>​
  
Line 105: Line 105:
 /​dev/​zvol/​zpoolname/​zvolname /​dev/​zvol/​zpoolname/​zvolname
  
 +The zvol can be grown or reduced by setting the volsize property. Obviously be careful of this if you grow or reduce something with data and a file system on it. Several other setting can be changed during or after creation, though some will only work on //new// data after set.
 +
 +<code bash>
 +zfs set volsize=15G storage/​virtual_2
 +zfs set checksum=off storage/​virtual_2
 +zfs set compression=off storage/​virtual_2
 +zfs set readonly=on storage/​virtual_2
 +</​code>​
 +
 +You can take a snapshot of a volume, and the space for the snapshot is allocated out of the zpool it is in.
  
 ====== Specialized Tuning ====== ====== Specialized Tuning ======
unix/freebsd/zfs.txt ยท Last modified: 2019/03/02 00:36 by rodolico