From owner-svn-doc-projects@FreeBSD.ORG Sun Nov 24 13:41:26 2013 Return-Path: Delivered-To: svn-doc-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C384863B; Sun, 24 Nov 2013 13:41:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A44092189; Sun, 24 Nov 2013 13:41:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAODfQFR011075; Sun, 24 Nov 2013 13:41:26 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAODfQIt011074; Sun, 24 Nov 2013 13:41:26 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201311241341.rAODfQIt011074@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 24 Nov 2013 13:41:26 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-projects@freebsd.org Subject: svn commit: r43229 - projects/zfsupdate-201307/en_US.ISO8859-1/books/handbook/zfs X-SVN-Group: doc-projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-projects@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for doc projects trees List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2013 13:41:26 -0000 Author: bcr Date: Sun Nov 24 13:41:26 2013 New Revision: 43229 URL: http://svnweb.freebsd.org/changeset/doc/43229 Log: Add a section about reviewing the zpool history. With section id help from: gjb Modified: projects/zfsupdate-201307/en_US.ISO8859-1/books/handbook/zfs/chapter.xml Modified: projects/zfsupdate-201307/en_US.ISO8859-1/books/handbook/zfs/chapter.xml ============================================================================== --- projects/zfsupdate-201307/en_US.ISO8859-1/books/handbook/zfs/chapter.xml Sun Nov 24 01:14:03 2013 (r43228) +++ projects/zfsupdate-201307/en_US.ISO8859-1/books/handbook/zfs/chapter.xml Sun Nov 24 13:41:26 2013 (r43229) @@ -688,6 +688,84 @@ errors: No known data errors + + Displaying recorded Pool history + + ZFS records all the commands that were issued to + administer the pool. These include the creation of datasets, + changing zfs properties or that a disk has been replaced in + the pool. This is useful to review how a pool was created and + which user did a specific action at what point in time. The + history is not kept in a log file, but is a part of the pool + itself. That is the reason why the history cannot be altered + after the fact unless the pool is destroyed. The command to + review this history is aptly named zpool + history: + + &prompt.root; zpool history +History for 'tank': +2013-02-26.23:02:35 zpool create tank mirror /dev/ada0 /dev/ada1 +2013-02-27.18:50:58 zfs set atime=off tank +2013-02-27.18:51:09 zfs set checksum=fletcher4 tank +2013-02-27.18:51:18 zfs create tank/backup + + The command output shows in it's basic form a timestamp + followed by each zpool or + zfs command that was executed on the pool. + Note that only commands that altered the pool in some way are + being recorded. Commands like zfs list are + not part of the history. When there is no pool name provided + for zpool history then the history of all + pools will be displayed. + + The zpool history can show even more + information when the options -i or + -l are provided. The option + -i displays user initiated events as well + as internally logged ZFS events. + + &prompt.root; zpool history -i +History for 'tank': +2013-02-26.23:02:35 [internal pool create txg:5] pool spa 28; zfs spa 28; zpl 5;uts 9.1-RELEASE 901000 amd64 +2013-02-27.18:50:53 [internal property set txg:50] atime=0 dataset = 21 +2013-02-27.18:50:58 zfs set atime=off tank +2013-02-27.18:51:04 [internal property set txg:53] checksum=7 dataset = 21 +2013-02-27.18:51:09 zfs set checksum=fletcher4 tank +2013-02-27.18:51:13 [internal create txg:55] dataset = 39 +2013-02-27.18:51:18 zfs create tank/backup + + The other more detailed history display can be invoked by + using the -l command. This will show the + log records in long format, which includes more information + like the user name who issued the command and the hostname on + which the change was made. + + &prompt.root; zpool history -l +History for 'tank': +2013-02-26.23:02:35 zpool create tank mirror /dev/ada0 /dev/ada1 [user 0 (root) on :global] +2013-02-27.18:50:58 zfs set atime=off tank [user 0 (root) on myzfsbox:global] +2013-02-27.18:51:09 zfs set checksum=fletcher4 tank [user 0 (root) on myzfsbox:global] +2013-02-27.18:51:18 zfs create tank/backup [user 0 (root) on myzfsbox:global] + + This output clearly shows that the root + user created the mirrored pool (consisting of + /dev/ada0 and + /dev/ada1). In addition to that, the + hostname (myzfsbox) is also shown in the + commands following the pool's creation. The hostname display + becomes important when the pool is exported from the current + and imported on another system. The commands that are issued + on the other system can clearly be distinguished by the + hostname that is recorded for each command. + + Both options to the zpool history + command can be combined together to give the most detailed + information possible for any given pool. The pool history can + become a valuable information source when tracking down what + actions were performed or when it is needed to provide more + detailed output for debugging a ZFS pool. + + Performance Monitoring