Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/books/handbook/zfs/chapter.xml
Show First 20 Lines • Show All 2,259 Lines • ▼ Show 20 Lines | <para>When <command>ls .zfs/snapshot</command> was issued, the | ||||
others. Copying files or directories from this hidden | others. Copying files or directories from this hidden | ||||
<filename>.zfs/snapshot</filename> is simple enough. Trying | <filename>.zfs/snapshot</filename> is simple enough. Trying | ||||
it the other way around results in this error:</para> | it the other way around results in this error:</para> | ||||
<screen>&prompt.root; <userinput>cp <replaceable>/etc/rc.conf</replaceable> /var/tmp/.zfs/snapshot/<replaceable>after_cp/</replaceable></userinput> | <screen>&prompt.root; <userinput>cp <replaceable>/etc/rc.conf</replaceable> /var/tmp/.zfs/snapshot/<replaceable>after_cp/</replaceable></userinput> | ||||
cp: /var/tmp/.zfs/snapshot/after_cp/rc.conf: Read-only file system</screen> | cp: /var/tmp/.zfs/snapshot/after_cp/rc.conf: Read-only file system</screen> | ||||
<para>The error reminds the user that snapshots are read-only | <para>The error reminds the user that snapshots are read-only | ||||
and can not be changed after creation. No files can be | and cannot be changed after creation. Files cannot be | ||||
copied into or removed from snapshot directories because | copied into or removed from snapshot directories because | ||||
that would change the state of the dataset they | that would change the state of the dataset they | ||||
represent.</para> | represent.</para> | ||||
<para>Snapshots consume space based on how much the parent | <para>Snapshots consume space based on how much the parent | ||||
file system has changed since the time of the snapshot. The | file system has changed since the time of the snapshot. The | ||||
<literal>written</literal> property of a snapshot tracks how | <literal>written</literal> property of a snapshot tracks how | ||||
much space is being used by the snapshot.</para> | much space is being used by the snapshot.</para> | ||||
Show All 33 Lines | used:</para> | ||||
<screen>&prompt.root; <userinput>zfs list -rt all <replaceable>camino/home/joe</replaceable></userinput> | <screen>&prompt.root; <userinput>zfs list -rt all <replaceable>camino/home/joe</replaceable></userinput> | ||||
NAME USED AVAIL REFER MOUNTPOINT | NAME USED AVAIL REFER MOUNTPOINT | ||||
camino/home/joe 108K 1.3G 87K /usr/home/joe | camino/home/joe 108K 1.3G 87K /usr/home/joe | ||||
camino/home/joe@plans 21K - 85.5K - | camino/home/joe@plans 21K - 85.5K - | ||||
camino/home/joe@backup 0K - 87K -</screen> | camino/home/joe@backup 0K - 87K -</screen> | ||||
<para>A typical use for clones is to experiment with a specific | <para>A typical use for clones is to experiment with a specific | ||||
dataset while keeping the snapshot around to fall back to in | dataset while keeping the snapshot around to fall back to in | ||||
case something goes wrong. Since snapshots can not be | case something goes wrong. Since snapshots cannot be | ||||
changed, a read/write clone of a snapshot is created. After | changed, a read/write clone of a snapshot is created. After | ||||
the desired result is achieved in the clone, the clone can be | the desired result is achieved in the clone, the clone can be | ||||
promoted to a dataset and the old file system removed. This | promoted to a dataset and the old file system removed. This | ||||
is not strictly necessary, as the clone and dataset can | is not strictly necessary, as the clone and dataset can | ||||
coexist without problems.</para> | coexist without problems.</para> | ||||
<screen>&prompt.root; <userinput>zfs clone <replaceable>camino/home/joe</replaceable>@<replaceable>backup</replaceable> <replaceable>camino/home/joenew</replaceable></userinput> | <screen>&prompt.root; <userinput>zfs clone <replaceable>camino/home/joe</replaceable>@<replaceable>backup</replaceable> <replaceable>camino/home/joenew</replaceable></userinput> | ||||
&prompt.root; <userinput>ls /usr/home/joe*</userinput> | &prompt.root; <userinput>ls /usr/home/joe*</userinput> | ||||
▲ Show 20 Lines • Show All 1,129 Lines • ▼ Show 20 Lines | <para><acronym>ZFS</acronym> is a fundamentally different file | ||||
system because it is more than just a file system. | system because it is more than just a file system. | ||||
<acronym>ZFS</acronym> combines the roles of file system and | <acronym>ZFS</acronym> combines the roles of file system and | ||||
volume manager, enabling additional storage devices to be added | volume manager, enabling additional storage devices to be added | ||||
to a live system and having the new space available on all of | to a live system and having the new space available on all of | ||||
the existing file systems in that pool immediately. By | the existing file systems in that pool immediately. By | ||||
combining the traditionally separate roles, | combining the traditionally separate roles, | ||||
<acronym>ZFS</acronym> is able to overcome previous limitations | <acronym>ZFS</acronym> is able to overcome previous limitations | ||||
that prevented <acronym>RAID</acronym> groups being able to | that prevented <acronym>RAID</acronym> groups being able to | ||||
grow. Each top level device in a zpool is called a | grow. Each top level device in a pool is called a | ||||
<emphasis>vdev</emphasis>, which can be a simple disk or a | <emphasis>vdev</emphasis>, which can be a simple disk or a | ||||
<acronym>RAID</acronym> transformation such as a mirror or | <acronym>RAID</acronym> transformation such as a mirror or | ||||
<acronym>RAID-Z</acronym> array. <acronym>ZFS</acronym> file | <acronym>RAID-Z</acronym> array. <acronym>ZFS</acronym> file | ||||
systems (called <emphasis>datasets</emphasis>) each have access | systems (called <emphasis>datasets</emphasis>) each have access | ||||
to the combined free space of the entire pool. As blocks are | to the combined free space of the entire pool. As blocks are | ||||
allocated from the pool, the space available to each file system | allocated from the pool, the space available to each file system | ||||
decreases. This approach avoids the common pitfall with | decreases. This approach avoids the common pitfall with | ||||
extensive partitioning where free space becomes fragmented | extensive partitioning where free space becomes fragmented | ||||
across the partitions.</para> | across the partitions.</para> | ||||
<informaltable pgwide="1"> | <informaltable pgwide="1"> | ||||
<tgroup cols="2"> | <tgroup cols="2"> | ||||
<tbody valign="top"> | <tbody valign="top"> | ||||
<row> | <row> | ||||
<entry xml:id="zfs-term-zpool">zpool</entry> | <entry xml:id="zfs-term-pool">pool</entry> | ||||
<entry>A storage <emphasis>pool</emphasis> is the most | <entry>A storage <emphasis>pool</emphasis> is the most | ||||
basic building block of <acronym>ZFS</acronym>. A pool | basic building block of <acronym>ZFS</acronym>. A pool | ||||
is made up of one or more vdevs, the underlying devices | is made up of one or more vdevs, the underlying devices | ||||
that store the data. A pool is then used to create one | that store the data. A pool is then used to create one | ||||
or more file systems (datasets) or block devices | or more file systems (datasets) or block devices | ||||
(volumes). These datasets and volumes share the pool of | (volumes). These datasets and volumes share the pool of | ||||
remaining free space. Each pool is uniquely identified | remaining free space. Each pool is uniquely identified | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | <tbody valign="top"> | ||||
<listitem> | <listitem> | ||||
<para | <para | ||||
xml:id="zfs-term-vdev-file"><emphasis>File</emphasis> | xml:id="zfs-term-vdev-file"><emphasis>File</emphasis> | ||||
- In addition to disks, <acronym>ZFS</acronym> | - In addition to disks, <acronym>ZFS</acronym> | ||||
pools can be backed by regular files, this is | pools can be backed by regular files, this is | ||||
especially useful for testing and experimentation. | especially useful for testing and experimentation. | ||||
Use the full path to the file as the device path | Use the full path to the file as the device path | ||||
in the zpool create command. All vdevs must be | in <command>zpool create</command>. All vdevs must be | ||||
at least 128 MB in size.</para> | at least 128 MB in size.</para> | ||||
</listitem> | </listitem> | ||||
<listitem> | <listitem> | ||||
<para | <para | ||||
xml:id="zfs-term-vdev-mirror"><emphasis>Mirror</emphasis> | xml:id="zfs-term-vdev-mirror"><emphasis>Mirror</emphasis> | ||||
- When creating a mirror, specify the | - When creating a mirror, specify the | ||||
<literal>mirror</literal> keyword followed by the | <literal>mirror</literal> keyword followed by the | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | <listitem> | ||||
mirrored, but <acronym>RAID-Z</acronym> is not | mirrored, but <acronym>RAID-Z</acronym> is not | ||||
supported. If multiple log devices are used, | supported. If multiple log devices are used, | ||||
writes will be load balanced across them.</para> | writes will be load balanced across them.</para> | ||||
</listitem> | </listitem> | ||||
<listitem> | <listitem> | ||||
<para | <para | ||||
xml:id="zfs-term-vdev-cache"><emphasis>Cache</emphasis> | xml:id="zfs-term-vdev-cache"><emphasis>Cache</emphasis> | ||||
- Adding a cache vdev to a zpool will add the | - Adding a cache vdev to a pool will add the | ||||
storage of the cache to the <link | storage of the cache to the <link | ||||
linkend="zfs-term-l2arc"><acronym>L2ARC</acronym></link>. | linkend="zfs-term-l2arc"><acronym>L2ARC</acronym></link>. | ||||
Cache devices cannot be mirrored. Since a cache | Cache devices cannot be mirrored. Since a cache | ||||
device only stores additional copies of existing | device only stores additional copies of existing | ||||
data, there is no risk of data loss.</para> | data, there is no risk of data loss.</para> | ||||
</listitem> | </listitem> | ||||
</itemizedlist></entry> | </itemizedlist></entry> | ||||
</row> | </row> | ||||
▲ Show 20 Lines • Show All 666 Lines • Show Last 20 Lines |