Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

13.13. ZFS Snapshots and Clones

13.13.1. ZFS Snapshots

filesystem@snapname, volume@snapname Creating ZFS Snapshots

The following example creates a snapshot of tank/neo that is named friday.

freebsd# zfs snapshot tank/neo@friday Destroying ZFS Snapshots

Snapshots are destroyed by using the zfs destroy command.

# zfs destroy tank/home/ahrens@friday Renaming ZFS Snapshots

# zfs rename tank/home/cindys@111205 pool/home/cindys@today Displaying and Accessing ZFS Snapshots

freebsd# zfs list -t snapshot
tank/neo@friday      0      -    18K  - Rolling Back to a Snapshot

# zfs rollback pool/home/ahrens@tuesday
cannot rollback to 'pool/home/ahrens@tuesday': more recent snapshots exist
use '-r' to force deletion of the following snapshots:
# zfs rollback -r pool/home/ahrens@tuesday

13.13.2. ZFS Clones Creating a Clone

# zfs clone pool/ws/gate@yesterday pool/home/ahrens/bug123

# zfs snapshot projects/newproject@today
# zfs clone projects/newproject@today projects/teamA/tempuser
# zfs set sharenfs=on projects/teamA/tempuser
# zfs set quota=5G projects/teamA/tempuser Destroying a Clone

ZFS clones are destroyed with the zfs destroy command.

# zfs destroy pool/home/ahrens/bug123

Clones must be destroyed before the parent snapshot can be destroyed.