Displaying ZFS Storage Pool Command History

Use the zpool history command to display the log of zfs and zpool command use. The log records when these commands were successfully used to modify pool state information or to troubleshoot an error condition.

Note the following information about the history log:

  • You cannot disable the log. The log is saved persistently on disk and is preserved across system reboots.

  • The log is implemented as a ring buffer. The minimum size is 128 KB. The maximum size is 32 MB.

  • For smaller pools, the maximum size is capped at 1 percent of the pool size, where the size is determined at pool creation time.

  • Because the log requires no administration, you do not need to tune the log size or its location.

The following example shows the zfs and zpool command history on the pool system1.

$ zpool history system1
2012-01-25.16:35:32 zpool create -f system1 mirror c3t1d0 c3t2d0 spare c3t3d0
2012-02-17.13:04:10 zfs create system1/test
2012-02-17.13:05:01 zfs snapshot -r system1/test@snap1

Use the -l option to display a long format that includes the user name, the host name, and the zone in which the operation was performed. For example:

$ zpool history -l system1
History for 'system1':
2012-01-25.16:35:32 zpool create -f system1 mirror c3t1d0 c3t2d0 spare c3t3d0
[user root on host1:global]
2012-02-17.13:04:10 zfs create system1/test [user root on host1:global]
2012-02-17.13:05:01 zfs snapshot -r system1/test@snap1 [user root on host1:global]

Use the -i option to display internal event information that can be used for diagnostic purposes. For example:

$ zpool history -i system1
History for 'system1':
2012-01-25.16:35:32 zpool create -f system1 mirror c3t1d0 c3t2d0 spare c3t3d0
2012-01-25.16:35:32 [internal pool create txg:5] pool spa 33; zfs spa 33; zpl 5;
uts host1 5.11 11.1 sun4v
2012-02-17.13:04:10 zfs create system1/test
2012-02-17.13:04:10 [internal property set txg:66094] $share2=2 dataset = 34
2012-02-17.13:04:31 [internal snapshot txg:66095] dataset = 56
2012-02-17.13:05:01 zfs snapshot -r system1/test@snap1
2012-02-17.13:08:00 [internal user hold txg:66102] <.send-4736-1> temp = 1 ...