All,
I assume this issue is pretty old given the time ZFS has been around. I have
tried searching the list but could not get understand the structure of how
ZFS actually takes snapshot space into account.
I have a user walter on whom I try to do the following ZFS operations
bash-3.00# zfs get quota store/catB/home/walter
NAME                    PROPERTY  VALUE                   SOURCE
store/catB/home/walter  quota     14G                     local
bash-3.00# zfs set quota=4G store/catB/home/walter
cannot set property for ''store/catB/home/walter'': size is less
than current
used or reserved space
This obviously means that the user+snapshots have used space more than 4G,
so I do
bash-3.00# df -kh .
Filesystem             size   used  avail capacity  Mounted on
store/catB/home/walter
                        14G   3.8G   1.0G    80%    /store/catB/home/walter
Now here it shows that out of 14G, roughly around 4G is used and 1G is
available, this means around 9G is taken by snapshots.
So to get the snapshot list
bash-3.00# zfs list -r store/catB/home/walter
store/catB/home/walter at base-20080315-232213   118K      -  13.0G  -
store/catB/home/walter at base-20080316-232417      0      -  13.0G  -
store/catB/home/walter at base-20080317-232308      0      -  13.0G  -
store/catB/home/walter at base-20080318-232752   118K      -  13.0G  -
store/catB/home/walter at base-20080319-232329   118K      -  13.0G  -
Layman''s method would be to try and total the space it lists against
each
snapshot, but its not the case ZFS calculates. So I go on deleting the
snapshots, until the last one.
 bash-3.00# zfs list -r store/catB/home/walter
NAME                                          USED  AVAIL  REFER  MOUNTPOINT
store/catB/home/walter                       13.0G  1.00G  3.82G
/store/catB/home/walter
store/catB/home/walter at base-20080319-232329  9.18G      -  13.0G  -
And now I see that the last snapshot is showing the correct missing size.
The difficult I have now is to find out how to get this size without
destroying the snapshots. Every user is assigned a fixed quota, and when
snapshots are enabled it eats into the quota space, totalling all the
snapshots really does not give the exact space taken by snapshots.
Lets take the case of a different user. I am using a script downloaded over
the net.
zfs get -rHp used store/catB/home/peter|\
nawk ''/@/ && $2 == "used" { tot++; total_space+=$3 ;\
        if ( $3 == 0 ) { empty++ }} \
END { printf("%d snapshots\n%d empty snapshots\n%2.2f G in %d
snapshots\n",
tot,
        empty, total_space/(1024^3), tot - empty ) }''
55 snapshots
17 empty snapshots
0.42 G in 38 snapshots
bash-3.00# df -kh .
Filesystem             size   used  avail capacity  Mounted on
store/catB/home/peter
                       8.0G   2.6G   3.6G    43%    /store/catB/home/peter
This should be 2.6+3.6=6.2+.42= 6.8 say approx=7, but its still 1G short.
can anyone point me in the direction of finding the silent space taken by
snapshots?
Thanks,
--Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20080320/18554615/attachment-0001.html>
On Thu, Mar 20, 2008 at 03:12:01PM -0700, Walter Faleiro wrote:> Layman''s method would be to try and total the space it lists against each > snapshot, but its not the case ZFS calculates. So I go on deleting the > snapshots, until the last one.Yes. This has been discussed before. There doesn''t seem to be any way to display that information. ''USED'' only shows data unique to that snapshot. There''s no equivalent to the NetApp displays of "used by this and older snapshots". I don''t know how difficult it would be to create such a display.> The difficult I have now is to find out how to get this size without > destroying the snapshots. Every user is assigned a fixed quota, and when > snapshots are enabled it eats into the quota space, totalling all the > snapshots really does not give the exact space taken by snapshots.No, not when some blocks are in multiple snapshots, but no longer in the live filesystem. Because you are dealing with snapshots and quotas, you may also be interested in the separation of snapshots from the quota considerations of the parent filesystem: <http://opensolaris.org/os/community/arc/caselog/2007/555/> -- Darren Dunham ddunham at taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. >
Wade.Stuart at fallon.com
2008-Mar-20  23:41 UTC
[zfs-discuss] Snapshots silently eating user quota
zfs-discuss-bounces at opensolaris.org wrote on 03/20/2008 05:12:01 PM:> All, > I assume this issue is pretty old given the time ZFS has been > around. I have tried searching the list but could not get understand > the structure of how ZFS actually takes snapshot space into account. >Snapshot space recording does not take into account any data that overlaps more than one snapshot -- but does affect quota usage metrics. There was an change request put in to disable snaps affecting quota limits -- not sure if it went anywhere. -Wad
On Thu, Mar 20, 2008 at 06:41:42PM -0500, Wade.Stuart at fallon.com wrote:> > There was an change request put in to disable snaps affecting quota limits > -- not sure if it went anywhere. >This went back into snv_77 with: 6431277 want filesystem-only quotas It is available as the ''refquota'' property. - Eric -- Eric Schrock, Fishworks http://blogs.sun.com/eschrock
Cindy.Swearingen at Sun.COM
2008-Mar-21  17:06 UTC
[zfs-discuss] Snapshots silently eating user quota
The file system only quotas and reservations feature description starts here: http://docs.sun.com/app/docs/doc/817-2271/gfwpz?a=view cs Eric Schrock wrote:> On Thu, Mar 20, 2008 at 06:41:42PM -0500, Wade.Stuart at fallon.com wrote: > >>There was an change request put in to disable snaps affecting quota limits >>-- not sure if it went anywhere. >> > > > This went back into snv_77 with: > > 6431277 want filesystem-only quotas > > It is available as the ''refquota'' property. > > - Eric > > -- > Eric Schrock, Fishworks http://blogs.sun.com/eschrock > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
On Thu, 20 Mar 2008, Eric Schrock wrote:> This went back into snv_77 with: > > 6431277 want filesystem-only quotas > > It is available as the ''refquota'' property.Any fresh news on when this might be available in Solaris 10? I''m working on a prototype of a file server for our campus, quota management is going to be rather confusing to say the least without that feature. -- Paul B. Henson | (909) 979-6361 | http://www.csupomona.edu/~henson/ Operating Systems and Network Analyst | henson at csupomona.edu California State Polytechnic University | Pomona CA 91768