[OpenIndiana-discuss] How to let find 'see' .zfs directories

Timothy Coalson tsc5yc at mst.edu
Thu Mar 20 17:56:49 UTC 2014

On Thu, Mar 20, 2014 at 9:55 AM, Harry Putnam <reader at newsguy.com> wrote:

> Timothy Coalson <tsc5yc at mst.edu> writes:
> > There is the "snapdir" property, which when set to "hidden" will prevent
> > things from knowing that the .zfs directory is there from a directory
> > listing - note, however, that changing it to show the directory may cause
> > GNU find to behave strangely whenever it looks at the root of a zfs
> > filesystem (including over nfs) if you don't turn off a particular
> > optimization based on link counts (I believe you need to use -noleaf) -
> the
> > .zfs directory isn't counted in the link counts, so it may think it is
> done
> > finding subdirectories before it actually is.
> >
> > You could instead test for the existence of the .zfs directory in all
> > folders, with some kind of "find . -type d -exec 'test -d {}/.zfs'"
> > construct (I have not tested that line).  The scripts I use with
> snapshots
> > use a lot of "zfs list -H -o name" ("-d 1 -t snapshot" is useful with a
> > filesystem) and "zfs get -Hp", other solutions might give false positives
> [...]
> Thanks for the input.   What is supposed to happen using your last cmd
> above?
> I wasn't sure what property I should be getting so tried:
>    zfs get all -Hp p2/rmh
> Not sure how you meant to use that... not seeing particularly usefull
> output here.

Sorry, its for a somewhat different purpose than your current task, it is
useful for getting the different space usage amounts in bytes:

$zfs get -Hp referenced rpool/export/home/tim
rpool/export/home/tim   referenced      1562218496      -

I use it with "written at ..." and do some math to get more detailed reporting
of how space is used by snapshots.


More information about the OpenIndiana-discuss mailing list