Translation

(itstool) path: sect3/screen
<prompt>#</prompt> <userinput>zfs get sharenfs <replaceable>mypool/usr/home</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
mypool/usr/home sharenfs on local
<prompt>#</prompt> <userinput>zfs get sharesmb <replaceable>mypool/usr/home</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
mypool/usr/home sharesmb off local
0/3730
Context English Spanish State
Destroying a volume is much the same as destroying a regular file system dataset. The operation is nearly instantaneous, but it may take several minutes for the free space to be reclaimed in the background.
Renaming a Dataset
The name of a dataset can be changed with <command>zfs rename</command>. The parent of a dataset can also be changed with this command. Renaming a dataset to be under a different parent dataset will change the value of those properties that are inherited from the parent dataset. When a dataset is renamed, it is unmounted and then remounted in the new location (which is inherited from the new parent dataset). This behavior can be prevented with <option>-u</option>.
Rename a dataset and move it to be under a different parent dataset:
<prompt>#</prompt> <userinput>zfs list</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool 780M 93.2G 144K none
mypool/ROOT 777M 93.2G 144K none
mypool/ROOT/default 777M 93.2G 777M /
mypool/tmp 176K 93.2G 176K /tmp
mypool/usr 704K 93.2G 144K /usr
mypool/usr/home 184K 93.2G 184K /usr/home
mypool/usr/mydataset 87.5K 93.2G 87.5K /usr/mydataset
mypool/usr/ports 144K 93.2G 144K /usr/ports
mypool/usr/src 144K 93.2G 144K /usr/src
mypool/var 1.21M 93.2G 614K /var
mypool/var/crash 148K 93.2G 148K /var/crash
mypool/var/log 178K 93.2G 178K /var/log
mypool/var/mail 144K 93.2G 144K /var/mail
mypool/var/tmp 152K 93.2G 152K /var/tmp
<prompt>#</prompt> <userinput>zfs rename <replaceable>mypool/usr/mydataset</replaceable> <replaceable>mypool/var/newname</replaceable></userinput>
<prompt>#</prompt> <userinput>zfs list</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool 780M 93.2G 144K none
mypool/ROOT 777M 93.2G 144K none
mypool/ROOT/default 777M 93.2G 777M /
mypool/tmp 176K 93.2G 176K /tmp
mypool/usr 616K 93.2G 144K /usr
mypool/usr/home 184K 93.2G 184K /usr/home
mypool/usr/ports 144K 93.2G 144K /usr/ports
mypool/usr/src 144K 93.2G 144K /usr/src
mypool/var 1.29M 93.2G 614K /var
mypool/var/crash 148K 93.2G 148K /var/crash
mypool/var/log 178K 93.2G 178K /var/log
mypool/var/mail 144K 93.2G 144K /var/mail
mypool/var/newname 87.5K 93.2G 87.5K /var/newname
mypool/var/tmp 152K 93.2G 152K /var/tmp
Snapshots can also be renamed like this. Due to the nature of snapshots, they cannot be renamed into a different parent dataset. To rename a recursive snapshot, specify <option>-r</option>, and all snapshots with the same name in child datasets with also be renamed.
<prompt>#</prompt> <userinput>zfs list -t snapshot</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool/var/newname@first_snapshot 0 - 87.5K -
<prompt>#</prompt> <userinput>zfs rename <replaceable>mypool/var/newname@first_snapshot</replaceable> <replaceable>new_snapshot_name</replaceable></userinput>
<prompt>#</prompt> <userinput>zfs list -t snapshot</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool/var/newname@new_snapshot_name 0 - 87.5K -
Setting Dataset Properties
Each <acronym>ZFS</acronym> dataset has a number of properties that control its behavior. Most properties are automatically inherited from the parent dataset, but can be overridden locally. Set a property on a dataset with <command>zfs set <replaceable>property</replaceable>=<replaceable>value</replaceable> <replaceable>dataset</replaceable></command>. Most properties have a limited set of valid values, <command>zfs get</command> will display each possible property and valid values. Most properties can be reverted to their inherited values using <command>zfs inherit</command>.
User-defined properties can also be set. They become part of the dataset configuration and can be used to provide additional information about the dataset or its contents. To distinguish these custom properties from the ones supplied as part of <acronym>ZFS</acronym>, a colon (<literal>:</literal>) is used to create a custom namespace for the property.
<prompt>#</prompt> <userinput>zfs set <replaceable>custom</replaceable>:<replaceable>costcenter</replaceable>=<replaceable>1234</replaceable> <replaceable>tank</replaceable></userinput>
<prompt>#</prompt> <userinput>zfs get <replaceable>custom</replaceable>:<replaceable>costcenter</replaceable> <replaceable>tank</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
tank custom:costcenter 1234 local
To remove a custom property, use <command>zfs inherit</command> with <option>-r</option>. If the custom property is not defined in any of the parent datasets, it will be removed completely (although the changes are still recorded in the pool's history).
<prompt>#</prompt> <userinput>zfs inherit -r <replaceable>custom</replaceable>:<replaceable>costcenter</replaceable> <replaceable>tank</replaceable></userinput>
<prompt>#</prompt> <userinput>zfs get <replaceable>custom</replaceable>:<replaceable>costcenter</replaceable> <replaceable>tank</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
tank custom:costcenter - -
<prompt>#</prompt> <userinput>zfs get all <replaceable>tank</replaceable> | grep <replaceable>custom</replaceable>:<replaceable>costcenter</replaceable></userinput>
<prompt>#</prompt>
Getting and Setting Share Properties
Two commonly used and useful dataset properties are the <acronym>NFS</acronym> and <acronym>SMB</acronym> share options. Setting these define if and how <acronym>ZFS</acronym> datasets may be shared on the network. At present, only setting sharing via <acronym>NFS</acronym> is supported on FreeBSD. To get the current status of a share, enter:
<prompt>#</prompt> <userinput>zfs get sharenfs <replaceable>mypool/usr/home</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
mypool/usr/home sharenfs on local
<prompt>#</prompt> <userinput>zfs get sharesmb <replaceable>mypool/usr/home</replaceable></userinput>
NAME PROPERTY VALUE SOURCE
mypool/usr/home sharesmb off local
To enable sharing of a dataset, enter:
<prompt>#</prompt> <userinput> zfs set sharenfs=on <replaceable>mypool/usr/home</replaceable></userinput>
It is also possible to set additional options for sharing datasets through <acronym>NFS</acronym>, such as <option>-alldirs</option>, <option>-maproot</option> and <option>-network</option>. To set additional options to a dataset shared through NFS, enter:
<prompt>#</prompt> <userinput> zfs set sharenfs="-alldirs,-maproot=<replaceable>root</replaceable>,-network=<replaceable>192.168.1.0/24</replaceable>" <replaceable>mypool/usr/home</replaceable></userinput>
Managing Snapshots
<link linkend="zfs-term-snapshot">Snapshots</link> are one of the most powerful features of <acronym>ZFS</acronym>. A snapshot provides a read-only, point-in-time copy of the dataset. With Copy-On-Write (<acronym>COW</acronym>), snapshots can be created quickly by preserving the older version of the data on disk. If no snapshots exist, space is reclaimed for future use when data is rewritten or deleted. Snapshots preserve disk space by recording only the differences between the current dataset and a previous version. Snapshots are allowed only on whole datasets, not on individual files or directories. When a snapshot is created from a dataset, everything contained in it is duplicated. This includes the file system properties, files, directories, permissions, and so on. Snapshots use no additional space when they are first created, only consuming space as the blocks they reference are changed. Recursive snapshots taken with <option>-r</option> create a snapshot with the same name on the dataset and all of its children, providing a consistent moment-in-time snapshot of all of the file systems. This can be important when an application has files on multiple datasets that are related or dependent upon each other. Without snapshots, a backup would have copies of the files from different points in time.
Snapshots in <acronym>ZFS</acronym> provide a variety of features that even other file systems with snapshot functionality lack. A typical example of snapshot use is to have a quick way of backing up the current state of the file system when a risky action like a software installation or a system upgrade is performed. If the action fails, the snapshot can be rolled back and the system has the same state as when the snapshot was created. If the upgrade was successful, the snapshot can be deleted to free up space. Without snapshots, a failed upgrade often requires a restore from backup, which is tedious, time consuming, and may require downtime during which the system cannot be used. Snapshots can be rolled back quickly, even while the system is running in normal operation, with little or no downtime. The time savings are enormous with multi-terabyte storage systems and the time required to copy the data from backup. Snapshots are not a replacement for a complete backup of a pool, but can be used as a quick and easy way to store a copy of the dataset at a specific point in time.
Creating Snapshots
Snapshots are created with <command>zfs snapshot <replaceable>dataset</replaceable>@<replaceable>snapshotname</replaceable></command>. Adding <option>-r</option> creates a snapshot recursively, with the same name on all child datasets.
Create a recursive snapshot of the entire pool:
<prompt>#</prompt> <userinput>zfs list -t all</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool 780M 93.2G 144K none
mypool/ROOT 777M 93.2G 144K none
mypool/ROOT/default 777M 93.2G 777M /
mypool/tmp 176K 93.2G 176K /tmp
mypool/usr 616K 93.2G 144K /usr
mypool/usr/home 184K 93.2G 184K /usr/home
mypool/usr/ports 144K 93.2G 144K /usr/ports
mypool/usr/src 144K 93.2G 144K /usr/src
mypool/var 1.29M 93.2G 616K /var
mypool/var/crash 148K 93.2G 148K /var/crash
mypool/var/log 178K 93.2G 178K /var/log
mypool/var/mail 144K 93.2G 144K /var/mail
mypool/var/newname 87.5K 93.2G 87.5K /var/newname
mypool/var/newname@new_snapshot_name 0 - 87.5K -
mypool/var/tmp 152K 93.2G 152K /var/tmp
<prompt>#</prompt> <userinput>zfs snapshot -r <replaceable>mypool@my_recursive_snapshot</replaceable></userinput>
<prompt>#</prompt> <userinput>zfs list -t snapshot</userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool@my_recursive_snapshot 0 - 144K -
mypool/ROOT@my_recursive_snapshot 0 - 144K -
mypool/ROOT/default@my_recursive_snapshot 0 - 777M -
mypool/tmp@my_recursive_snapshot 0 - 176K -
mypool/usr@my_recursive_snapshot 0 - 144K -
mypool/usr/home@my_recursive_snapshot 0 - 184K -
mypool/usr/ports@my_recursive_snapshot 0 - 144K -
mypool/usr/src@my_recursive_snapshot 0 - 144K -
mypool/var@my_recursive_snapshot 0 - 616K -
mypool/var/crash@my_recursive_snapshot 0 - 148K -
mypool/var/log@my_recursive_snapshot 0 - 178K -
mypool/var/mail@my_recursive_snapshot 0 - 144K -
mypool/var/newname@new_snapshot_name 0 - 87.5K -
mypool/var/newname@my_recursive_snapshot 0 - 87.5K -
mypool/var/tmp@my_recursive_snapshot 0 - 152K -
Snapshots are not shown by a normal <command>zfs list</command> operation. To list snapshots, <option>-t snapshot</option> is appended to <command>zfs list</command>. <option>-t all</option> displays both file systems and snapshots.
Snapshots are not mounted directly, so no path is shown in the <literal>MOUNTPOINT</literal> column. There is no mention of available disk space in the <literal>AVAIL</literal> column, as snapshots cannot be written to after they are created. Compare the snapshot to the original dataset from which it was created:
<prompt>#</prompt> <userinput>zfs list -rt all <replaceable>mypool/usr/home</replaceable></userinput>
NAME USED AVAIL REFER MOUNTPOINT
mypool/usr/home 184K 93.2G 184K /usr/home
mypool/usr/home@my_recursive_snapshot 0 - 184K -
Displaying both the dataset and the snapshot together reveals how snapshots work in <link linkend="zfs-term-cow">COW</link> fashion. They save only the changes (<emphasis>delta</emphasis>) that were made and not the complete file system contents all over again. This means that snapshots take little space when few changes are made. Space usage can be made even more apparent by copying a file to the dataset, then making a second snapshot:

Loading…

User avatar None

New source string

FreeBSD Doc / books_handbookSpanish

New source string a year ago
Browse all component changes

Glossary

English Spanish
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect3/screen
Flags
no-wrap
Source string location
book.translate.xml:41242
String age
a year ago
Source string age
a year ago
Translation file
books/es_ES/handbook.po, string 6800