Maurilio Longo
2008-Mar-10 11:56 UTC
[zfs-discuss] zfs snapshots sometimes don''t report correct used space
Hi, I''m using Tim Foster''s zfs automatic snapshot to keep copies of a zfs filesystem. I keep 30 days, seven weeks and 12 months, these snapshots get created at 00:00 every day and when a new week starts (or a new month) there are two or three snapshots that start at the same time. Using zfs list I see that when more than one snapshot starts at the same time, the USED column of the report shows no space occupied, while, when just a single snapshot is done, I can see how much space is being used. Snaphots are ok, I mean, if I go inside one of the 0 byte used one I can see that the files are ok and their content is what they really contained at that point in time, so it seem just a ''cosmetic'' problem. Here his zfs list on that filesystem -----------8<--------------------------------- # zfs list NAME USED AVAIL REFER MOUNT POINT nas 262G 879G 11,2G /nas nas/nwserv 13,0G 879G 6,86G /nas/ nwserv nas/nwserv at zfs-auto-snap:daily-2008-02-27-00:00:00 519M - 6,99G - nas/nwserv at zfs-auto-snap:daily-2008-02-28-00:00:00 491M - 7,02G - nas/nwserv at zfs-auto-snap:daily-2008-02-29-00:00:00 0 - 6,91G - nas/nwserv at zfs-auto-snap:weekly-2008-02-29-00:00:00 0 - 6,91G - nas/nwserv at zfs-auto-snap:daily-2008-03-01-00:00:00 0 - 6,93G - nas/nwserv at zfs-auto-snap:monthly-2008-03-01-00:00:00 0 - 6,93G - nas/nwserv at zfs-auto-snap:weekly-2008-03-01-00:00:00 0 - 6,93G - nas/nwserv at zfs-auto-snap:daily-2008-03-02-00:00:00 241M - 6,94G - nas/nwserv at zfs-auto-snap:daily-2008-03-03-00:00:00 242M - 6,94G - nas/nwserv at zfs-auto-snap:daily-2008-03-04-00:00:00 538M - 6,96G - nas/nwserv at zfs-auto-snap:daily-2008-03-05-00:00:00 499M - 6,74G - nas/nwserv at zfs-auto-snap:daily-2008-03-06-00:00:00 519M - 6,80G - nas/nwserv at zfs-auto-snap:daily-2008-03-07-00:00:00 514M - 6,81G - nas/nwserv at zfs-auto-snap:daily-2008-03-08-00:00:00 0 - 6,80G - nas/nwserv at zfs-auto-snap:weekly-2008-03-08-00:00:00 0 - 6,80G - nas/nwserv at zfs-auto-snap:daily-2008-03-09-00:00:00 256M - 6,85G - ----------->8--------------------------------- As you can see, when there is a weekly or monthly snapshot used space is 0. Is this a known issue? Best regards. Maurilio. PS. nas/nwserv is compressed and has atime=off # zfs get all nas/nwserv | grep local nas/nwserv compression on local nas/nwserv atime off local nas/nwserv snapdir hidden local nas/nwserv com.sun:auto-snapshot:weekly true local nas/nwserv com.sun:auto-snapshot:monthly true local nas/nwserv com.sun:auto-snapshot:daily true local # This message posted from opensolaris.org
Casper.Dik at Sun.COM
2008-Mar-10 12:09 UTC
[zfs-discuss] zfs snapshots sometimes don''t report correct used space
>Here his zfs list on that filesystem > >-----------8<--------------------------------- ># zfs list >NAME USED AVAIL REFER MOUNT >POINT >nas 262G 879G 11,2G /nas >nas/nwserv 13,0G 879G 6,86G /nas/ >nwserv >nas/nwserv at zfs-auto-snap:daily-2008-02-27-00:00:00 519M - 6,99G - >nas/nwserv at zfs-auto-snap:daily-2008-02-28-00:00:00 491M - 7,02G - >nas/nwserv at zfs-auto-snap:daily-2008-02-29-00:00:00 0 - 6,91G - >nas/nwserv at zfs-auto-snap:weekly-2008-02-29-00:00:00 0 - 6,91G - >nas/nwserv at zfs-auto-snap:daily-2008-03-01-00:00:00 0 - 6,93G - >nas/nwserv at zfs-auto-snap:monthly-2008-03-01-00:00:00 0 - 6,93G - >nas/nwserv at zfs-auto-snap:weekly-2008-03-01-00:00:00 0 - 6,93G - >nas/nwserv at zfs-auto-snap:daily-2008-03-02-00:00:00 241M - 6,94G - >nas/nwserv at zfs-auto-snap:daily-2008-03-03-00:00:00 242M - 6,94G - >nas/nwserv at zfs-auto-snap:daily-2008-03-04-00:00:00 538M - 6,96G - >nas/nwserv at zfs-auto-snap:daily-2008-03-05-00:00:00 499M - 6,74G - >nas/nwserv at zfs-auto-snap:daily-2008-03-06-00:00:00 519M - 6,80G - >nas/nwserv at zfs-auto-snap:daily-2008-03-07-00:00:00 514M - 6,81G - >nas/nwserv at zfs-auto-snap:daily-2008-03-08-00:00:00 0 - 6,80G - >nas/nwserv at zfs-auto-snap:weekly-2008-03-08-00:00:00 0 - 6,80G - >nas/nwserv at zfs-auto-snap:daily-2008-03-09-00:00:00 256M - 6,85G - >----------->8--------------------------------- > >As you can see, when there is a weekly or monthly snapshot used space is 0. > >Is this a known issue?Why do you think it''s an issue in the first place? The space allocated for a snapshot is the amount of data freed after it was created which is not also allocated elsewhere. The way this appears to work is that the space is counted towards the most recently created snapshot which the data is shared with. No data is freed when that snapshot is destroyed. Casper
Casper.Dik at Sun.COM
2008-Mar-10 14:44 UTC
[zfs-discuss] zfs snapshots sometimes don''t report correct used space
>So, every next day, I see how much data changed since the day before, but I >can''t see this info when more than one snapshot gets executed. > >Hope this clarifies my issue a little bit.I understand, but i don''t think the accounting is meant to be that way; it''s more or less "if you remove this data, at most X data will be freed". If you remove one of the non-0 sized snapshots, it will show more space allocated toward the now 0 sized snapshots. It seems that zfs will only count data toward one snapshot. Casper