The act of appending to a file implies a change, at least to the last block of file data.
This would be quite small though, no? Mostly a metadata change? I think the OP was thinking that appending 10 gigs to a 10 gig file would show 10 or 20 gigs of 'used' in a snapshot.
This demonstrates the 'used' for snapshots when they share common data:
Use GUI to create dataset TEST:
Code:
root@nas nas1pool # zfs list nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 192K 9.23T 192K /mnt/nas2pool/test
Use GUI to create 1st snapshot:
Code:
root@nas nas1pool # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 192K 9.23T 192K /mnt/nas2pool/test
nas2pool/test@1-emptydataset 0 - 192K -
Put data on dataset: (compression disabled)
Code:
root@nas test # dd if=/dev/zero of=1gb bs=1m count=1k
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 0.397269 secs (2702807910 bytes/sec)
root@nas test # ls -lah
total 1048609
drwxr-xr-x 2 root wheel 3B Dec 30 13:19 .
drwxr-xr-x 13 root wheel 13B Dec 30 13:17 ..
-rw-r--r-- 1 root wheel 1.0G Dec 30 13:19 1gb
Use GUI to create 2nd snapshot:
Code:
root@nas test # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 1.00G 9.22T 1.00G /mnt/nas2pool/test
nas2pool/test@1-emptydataset 128K - 192K -
nas2pool/test@2-onegigofdata 0 - 1.00G -
Use GUI to create 3rd snapshot:
Code:
root@nas test # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 1.00G 9.22T 1.00G /mnt/nas2pool/test
nas2pool/test@1-emptydataset 128K - 192K -
nas2pool/test@2-onegigofdata 0 - 1.00G -
nas2pool/test@3-onegigofdata 0 - 1.00G -
Delete data:
Code:
root@nas test # rm 1gb
'USED' shows 0 because both snapshots share the deleted data:
Code:
root@nas test # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 1.00G 9.22T 1.00G /mnt/nas2pool/test
nas2pool/test@1-emptydataset 128K - 192K -
nas2pool/test@2-onegigofdata 0 - 1.00G -
nas2pool/test@3-onegigofdata 0 - 1.00G -
If we deleted all snapshots, we would reclaim 'usedbysnapshots':
Code:
root@nas test # zfs get usedbysnapshots nas2pool/test
NAME PROPERTY VALUE SOURCE
nas2pool/test usedbysnapshots 1.00G -
Use GUI to delete 2nd snapshot. The remaining snapshot (3rd) shows 'used' now because it's the only one refrencing the deleted data.
Code:
root@nas test # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 1.00G 9.22T 192K /mnt/nas2pool/test
nas2pool/test@1-emptydataset 128K - 192K -
nas2pool/test@3-onegigofdata 1.00G - 1.00G -
Use GUI to delete 3rd snapshot. Verify dataset disk usage has gone down:
Code:
root@nas test # zfs list -t all -r nas2pool/test
NAME USED AVAIL REFER MOUNTPOINT
nas2pool/test 320K 9.23T 192K /mnt/nas2pool/test
nas2pool/test@1-emptydataset 128K - 192K -
Code:
root@nas test # zfs get usedbysnapshots nas2pool/test
NAME PROPERTY VALUE SOURCE
nas2pool/test usedbysnapshots 128K -