I really think there is something wrong with how space is being reported
by zfs list in terms of snapshots.

Stealing for the example earlier where a new file system was created, 10
1MB files were created and then do snap, remove a file, snap, remove a
file, until they are all gone and you are left with:
 
> bash-3.2# zfs list -r root/export/home/carton/t
> NAME                          USED  AVAIL  REFER  MOUNTPOINT
> root/export/home/carton/t    10.2M  26.6G    18K  
> /export/home/carton/t
> root/export/home/carton/[EMAIL PROTECTED]  1.02M      -  10.0M  -
> root/export/home/carton/[EMAIL PROTECTED]    18K      -  9.04M  -
> root/export/home/carton/[EMAIL PROTECTED]    18K      -  8.04M  -
> root/export/home/carton/[EMAIL PROTECTED]    18K      -  7.03M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  6.03M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  5.03M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  4.03M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  3.02M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  2.02M  -
> root/export/home/carton/[EMAIL PROTECTED]    17K      -  1.02M  -

So the file system itself is now empty of files (18K refer for overhead)
but still using 10MB because of the snapshots still holding onto all 10
1MB files.

By how I understand snapshots the oldest one actually holds the file
after it is deleted and any newer snapshot just points to what that
oldest one is holding.

So because the 0 snapshot was taken first it knows about all 10 files,
snap 1 only knows about 9, etc.

The refer numbers all match up correctly as that is how much data
existed at the time of the snapshot.

But the used seems wrong.

The 0 snapshot should be holding onto all 10 files so I would expect it
to be 10MB "Used" when it's only reporting 1MB used.  Where is the other
9MB hiding?  It only exists because a snapshot is holding it so that
space should be charged to a snapshot.  Since snapshot 1-9 should only
be pointing at the data held by 0 their numbers are correct.

To take the idea further you can delete snapshots 1-9 and snapshot 0
will still say it has 1MB "Used", so where again is the other 9MB?

Adding up the total "used" by snapshots and the "refer" by the file
system *should* add up to the "used" for the file system for it all to
make sense right?

Another way to look at it if you have all 10 snapshots and you delete 0
I would expect snapshot 1 to change from 18K used (overhead) to 9MB used
since it would now be the oldest snapshot and official holder of the
data with snapshots 2-9 now pointing at the data it is holding.  The
first 1MB file delete would now be gone forever.

Am I missing something or is the math to account for snapshot space just
not working right in zfs list/get?

Adam
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to