• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Identify ZFS Snapshot Differences using “zfs diff”

by admin

To determine the differences between ZFS snapshots, you can use the zfs diff command. The output of this command provides a high-level description of the differences between a snapshot and a descendant dataset. The descendant can be either a snapshot of the data set or the current data set. For each file that has undergone a change between the original snapshot and the descendant, the type of change is described along with the name of the file. In the case of a rename, both the old and new names are shown. The type of change follows any time stamp displayed and is described as a single character.

Let’s see an example to get more idea about how the ‘zfs diff’ command works.

1. In the example, a before snapshot of the rpool/export/home ZFS file system was taken.

# zfs snapshot rpool/export/home@before

2. A new file (newfile) was then created in /export/home/geek directory.

# touch /export/home/file1

3. Then another snapshot (after) of the same ZFS file system was taken.

# zfs snapshot rpool/export/home@after

4. The zfs list command is used to list the snapshots based on name and creation date.

# zfs list -r -t snapshot -o name,creation rpool/export/home
NAME                      CREATION
rpool/export/home@before  Sun Jan 14  8:07 2018
rpool/export/home@after   Sun Jan 14  8:13 2018

5. The “zfs diff” command is then run to determine the differences between the before and after snapshots.

# zfs diff rpool/export/home@before rpool/export/home@after
M       /export/home/
+       /export/home/file1

The M in the zfs diff command output indicates that the /export/home/ directory has been modified, and the + indicates that a file /export/home/file1 exists in the later snapshot. The table in below summarizes the file or directory changes that are identified by the zfs diff command.

File or Directory Change Identifier
File or directory is modified, or file or directory link has changed. M
File or directory is present in the older snapshot but not in the newer snapshot. –
File or directory is present in the newer snapshot but not in the older snapshot. +
File or directory is renamed. R

Filed Under: Solaris, Solaris 11, ZFS

Some more articles you might also be interested in …

  1. Beginners Guide to Solaris 11 Network Administration
  2. How to identify the boot device (primary and alternate) in Solaris
  3. How to Configure a Solaris 10 Jumpstart server and client [SPARC]
  4. What are Oracle Solaris 11 Installation Methods
  5. How To Use ‘zpool split’ to Split rpool in solaris 11 (x86/x64)
  6. How to Enable ssh/sshd Debugging for Solaris
  7. Understanding the sysconfig utility in Solaris 11
  8. Solaris : Troubleshooting startup (rc init) scripts
  9. How to configure Probe Based IPMP in Solaris 11
  10. How to run savecore (crash dump) manually in Solaris

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright