ZFS-DIFF(8)

πŸ’– ZFS-DIFF(8) πŸ’–

okay bestie, so this is zfs-diff from the System Manager's Manual, and it's genuinely one of the most useful little tools in the whole ZFS family, no cap.


✨ NAME ✨

zfs-diff β€” show difference between ZFS snapshots πŸ¦‹


🌸 SYNOPSIS 🌸

zfs diff [-FHth] snapshot snapshot|filesystem

πŸ’… DESCRIPTION πŸ’…

So what this does is it shows you the difference between a snapshot of a given filesystem and another snapshot of that same filesystem from a later time, OR the current contents of the filesystem. Basically a glow-up reveal for your data. ✨

The first column is a character telling you the type of change. The other columns are giving pathname, new pathname (in the rename case, obviously πŸ’), change in link count, and optionally file type and/or change time.

The types of change are, and this is important so pay attention bestie:

  • - β€” The path has been removed πŸ’€
  • + β€” The path has been created πŸŽ€
  • M β€” The path has been modified ✏️
  • R β€” The path has been renamed πŸ‘‘

⭐ OPTIONS ⭐

  • -F β€” Displays an indication of the type of file, in a manner similar to the -F option of ls(1). Here's the whole lil alphabet of file types, memorise it iykyk:
    • B β€” Block device
    • C β€” Character device
    • / β€” Directory
    • > β€” Door
    • | β€” Named pipe
    • @ β€” Symbolic link
    • P β€” Event port
    • = β€” Socket
    • F β€” Regular file
  • -H β€” Gives you more parsable tab-separated output, without header lines and without arrows. so if you're piping this into a script, this is your main character flag fr fr πŸ”₯
  • -t β€” Displays the path's inode change time as the first column of output. like a little timestamp baddie in front πŸ’œ
  • -h β€” Do not \0ooo-escape non-ASCII paths. so your weird lil unicode filenames get to live their truth 🌈

🌈 EXAMPLES 🌈

πŸ“ Example 1: Showing the differences between a snapshot and a ZFS Dataset

The following example shows how to see what has changed between a prior snapshot of a ZFS dataset and its current state. The -F option is used to indicate type information for the files affected.

# zfs diff -F tank/test@before tank/test
M       /       /tank/test/
M       F       /tank/test/linked      (+1)
R       F       /tank/test/oldname -> /tank/test/newname
-       F       /tank/test/deleted
+       F       /tank/test/created
M       F       /tank/test/modified

look at that output. directory modified, a linked file went up by one link count, a rename with the lil -> arrow, one deleted, one created, one modified. the whole character arc in six lines. we love to see it. πŸ‘‘


🫢 SEE ALSO 🫢

zfs-snapshot(8)


okay that's the whole page bestie, you ate that, go diff some snapshots and slay ✨

this one's from OpenZFS, dated July 11, 2022 β€” mwah, kisses, take care of your datasets πŸ’–πŸ’…

πŸ“¦ where this page comes from