On Mon, Jan 9, 2017 at 8:55 AM, Dan McDonald <[email protected]> wrote:

> An OmniOS user recently pinged us about missing snapshots.
>
> Turns out, one can remove .zfs/snapshot/<name> and the snapshot deletion
> DOES NOT APPEAR in the zpool's history.
>

It does appear in "zpool history -i" (internal):

# touch /test/fs/.zfs/snapshot/a
# zpool history test | tail -2
2017-01-09.19:18:27 [txg:8333] snapshot test/fs@a (172)

Only /sbin/zfs and /sbin/zpool log their CLI arguments, and only these are
printed by "zpool history" without -i.  Using libzfs / libzfs_core directly
will also not log the CLI arguments (not sure what that would mean) so you
won't see them by default.

Also FYI, the [txg:XXXX]-type log records are the only ones that are 100%
reliable; the others (CLI-type and ioctl-type) may not be present if the
program crashes or the system loses power before they are logged.  The
default output (CLI-type records) are intended for casual use rather than
debugging or forensics.

--matt


>
> >
> > I wrote, about our mysteriously disappearing snapshots:
> >> [...] For example, is there some way where snapshots can be removed
> >> without that being logged in 'zpool history'?
> >
> > The answer to my question turns out to be 'yes'. If you do:
> >       rmdir <fs>/.zfs/snapshot/<snapshot-name>
> >
> > and ZFS accepts this, there is no entry made in 'zpool history'; the
> > snapshot is silently deleted.
>
>
> Turns out, it's not the only .zfs/ directory operation that doesn't leave
> an audit trail:
>
> > It turns out that you can also make snapshots with mkdir and they
> > don't show up in zpool history either, so probably both issues should
> > be raised and fixed as one.
> 
> In spite of this user's older OmniOS, I see this on OmniOS-bloody, so I
> know it's not fixed.
> 
> Should I file a bug?  Were I not deep in migration issues (death of
> Python2.6 and BSD Loader), I might have tackled this myself.  I'm happy to
> file a bug or do whatever is appropriate.
> 
> Thanks,
> Dan
> 



-------------------------------------------
openzfs-developer
Archives: https://www.listbox.com/member/archive/274414/=now
RSS Feed: https://www.listbox.com/member/archive/rss/274414/28015062-cce53afa
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=28015062&id_secret=28015062-f966d51c
Powered by Listbox: http://www.listbox.com

Reply via email to