Feature #1645

add ZFS "written" and "written@..." properties

Added by Matthew Ahrens about 6 years ago. Updated about 6 years ago.

Status:ResolvedStart date:2011-10-14
Priority:NormalDue date:
Assignee:Matthew Ahrens% Done:

0%

Category:-
Target version:-
Difficulty:Medium Tags:needs-triage

Description

Add a new property, "written", and dynamic property family, "written@<snapshot>", to determine how much space was written to a filesystem or snapshot relative to a previous snapshot.

manpage changes:

written

The amount of referenced space written to this dataset
since the previous snapshot.

written@snapshot

The amount of referenced space written to this dataset
since the specified snapshot. This is the space that is
referenced by this dataset but was not referenced by the
specified snapshot.

The snapshot may be specified as a short snapshot name
(just the part after the @), in which case it will be
interpreted as a snapshot in the same filesystem as
this dataset. The snapshot be a full snapshot name
(filesystem@snapshot), which for clones may be a
snapshot in the origin's filesystem (or the origin of
the origin's filesystem, etc).

examples:

$ zfs list -t all -o name,used,written
NAME                                                             USED  WRITTEN
...
rpool/versions/2011.08.11.00/running                             299M      31K
rpool/versions/2011.08.11.00/running/svc                        37.0M        0
rpool/versions/2011.08.11.00/running/svc@2011.08.12.00          4.53M    14.4M
rpool/versions/2011.08.11.00/running/svc@2011.08.15.00          4.53M    9.04M
rpool/versions/2011.08.11.00/running/svc@2011.08.19.00              0    13.5M
rpool/versions/2011.08.11.00/running/var                         262M        0
rpool/versions/2011.08.11.00/running/var@2011.08.12.00          79.6M    81.5M
rpool/versions/2011.08.11.00/running/var@2011.08.15.00          80.3M    94.6M
rpool/versions/2011.08.11.00/running/var@2011.08.19.00              0    85.6M

$ zfs get -r written@2011.08.12.00 rpool/versions/2011.08.11.00/running     
NAME                                                    PROPERTY               VALUE                  SOURCE
rpool/versions/2011.08.11.00/running                    written@2011.08.12.00  -                      -
rpool/versions/2011.08.11.00/running/svc                written@2011.08.12.00  18.0M                  local
rpool/versions/2011.08.11.00/running/svc@2011.08.12.00  written@2011.08.12.00  0                      local
rpool/versions/2011.08.11.00/running/svc@2011.08.15.00  written@2011.08.12.00  9.04M                  local
rpool/versions/2011.08.11.00/running/svc@2011.08.19.00  written@2011.08.12.00  18.0M                  local
rpool/versions/2011.08.11.00/running/var                written@2011.08.12.00  99.9M                  local
rpool/versions/2011.08.11.00/running/var@2011.08.12.00  written@2011.08.12.00  0                      local
rpool/versions/2011.08.11.00/running/var@2011.08.15.00  written@2011.08.12.00  94.6M                  local
rpool/versions/2011.08.11.00/running/var@2011.08.19.00  written@2011.08.12.00  99.9M                  local

History

#1 Updated by Matthew Ahrens about 6 years ago

  • Assignee set to Matthew Ahrens

#2 Updated by Eric Schrock about 6 years ago

  • Status changed from New to Resolved

changeset: 13509:04570f5cbeca
tag: tip
user: Matthew Ahrens <>
date: Sat Nov 05 17:34:13 2011 -0700

description:
1644 add ZFS "clones" property
1645 add ZFS "written" and "written@..." properties
1646 "zfs send" should estimate size of stream
1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots
1708 adjust size of zpool history data
Reviewed by: Richard Lowe <>
Reviewed by: George Wilson <>
Approved by: Gordon Ross <>

modified:
usr/src/cmd/truss/codes.c
usr/src/cmd/zfs/zfs_main.c
usr/src/cmd/zoneadmd/Makefile
usr/src/common/zfs/zfs_prop.c
usr/src/lib/libzfs/Makefile.com
usr/src/lib/libzfs/common/libzfs.h
usr/src/lib/libzfs/common/libzfs_dataset.c
usr/src/lib/libzfs/common/libzfs_impl.h
usr/src/lib/libzfs/common/libzfs_sendrecv.c
usr/src/lib/libzfs/common/libzfs_util.c
usr/src/lib/libzfs/common/mapfile-vers
usr/src/man/man1m/zfs.1m
usr/src/uts/Makefile.uts
usr/src/uts/common/fs/zfs/bpobj.c
usr/src/uts/common/fs/zfs/dmu_send.c
usr/src/uts/common/fs/zfs/dsl_dataset.c
usr/src/uts/common/fs/zfs/dsl_deadlist.c
usr/src/uts/common/fs/zfs/dsl_deleg.c
usr/src/uts/common/fs/zfs/dsl_pool.c
usr/src/uts/common/fs/zfs/spa_history.c
usr/src/uts/common/fs/zfs/sys/dmu.h
usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
usr/src/uts/common/fs/zfs/sys/dsl_deleg.h
usr/src/uts/common/fs/zfs/zap_micro.c
usr/src/uts/common/fs/zfs/zfs_ioctl.c
usr/src/uts/common/sys/fs/zfs.h
added:
usr/src/lib/libzfs/common/libzfs_iter.c
removed:
usr/src/lib/libzfs/common/libzfs_graph.c

#3 Updated by Rich Lowe about 6 years ago

  • Status changed from Resolved to In Progress

Backed out by r13511 commit:4bd28e91c699

Broke snapshots, BEs, possibly other things.

#4 Updated by Eric Schrock about 6 years ago

  • Status changed from In Progress to Resolved

changeset: 13524:f0e12b33f77c
tag: tip
user: Matthew Ahrens <>
date: Thu Nov 17 10:14:36 2011 -0800

description:
1644 add ZFS "clones" property
1645 add ZFS "written" and "written@..." properties
1646 "zfs send" should estimate size of stream
1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots
1708 adjust size of zpool history data
Reviewed by: Richard Lowe <>
Reviewed by: George Wilson <>
Reviewed by: Albert Lee <>
Approved by: Garrett D'Amore <>

modified:
usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c
usr/src/cmd/truss/codes.c
usr/src/cmd/zfs/zfs_main.c
usr/src/common/zfs/zfs_prop.c
usr/src/lib/libbe/common/be_create.c
usr/src/lib/libzfs/Makefile.com
usr/src/lib/libzfs/common/libzfs.h
usr/src/lib/libzfs/common/libzfs_dataset.c
usr/src/lib/libzfs/common/libzfs_impl.h
usr/src/lib/libzfs/common/libzfs_sendrecv.c
usr/src/lib/libzfs/common/libzfs_util.c
usr/src/lib/libzfs/common/mapfile-vers
usr/src/man/man1m/zfs.1m
usr/src/uts/Makefile.uts
usr/src/uts/common/fs/zfs/bpobj.c
usr/src/uts/common/fs/zfs/dmu_send.c
usr/src/uts/common/fs/zfs/dsl_dataset.c
usr/src/uts/common/fs/zfs/dsl_deadlist.c
usr/src/uts/common/fs/zfs/dsl_deleg.c
usr/src/uts/common/fs/zfs/dsl_pool.c
usr/src/uts/common/fs/zfs/spa_history.c
usr/src/uts/common/fs/zfs/sys/dmu.h
usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
usr/src/uts/common/fs/zfs/sys/dsl_deleg.h
usr/src/uts/common/fs/zfs/zap_micro.c
usr/src/uts/common/fs/zfs/zfs_ioctl.c
usr/src/uts/common/sys/fs/zfs.h
added:
usr/src/lib/libzfs/common/libzfs_iter.c
removed:
usr/src/lib/libzfs/common/libzfs_graph.c

Also available in: Atom