Matthew Stevenson
2009-Aug-14 16:19 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Please can someone take a look at the attached file which shows the output on my machine of zfs list -r -t filesystem,snapshot -o space rpool/export/home/matt The USEDDS figure of ~2GB is what I would expect, and is the same figure reported by the Disk Usage Analyzer. Where is the remaining 13.8GB USEDSNAP figure coming from? If I total up the list of zfs-auto snapshots it adds up to about 4.8GB, which leaves about 11GB unaccounted for. Please can someone tell me where I''m going wrong and how I can find out what is using all that extra space? Thanks, Matt -- This message posted from opensolaris.org -------------- next part -------------- matt at opensolaris:~$ zfs list -r -t filesystem,snapshot -o space rpool/export/home/matt NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD rpool/export/home/matt 5.73G 16.0G 13.8G 2.15G 0 0 rpool/export/home/matt at zfs-auto-snap:monthly-2009-04-27-17:53 - 155M - - - - rpool/export/home/matt at zfs-auto-snap:monthly-2009-05-28-08:03 - 90.6M - - - - rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-28-20:59 - 2.45G - - - - rpool/export/home/matt at zfs-auto-snap:monthly-2009-07-05-13:43 - 544M - - - - rpool/export/home/matt at zfs-auto-snap:weekly-2009-07-20-18:23 - 1.03G - - - - rpool/export/home/matt at zfs-auto-snap:weekly-2009-07-28-08:01 - 191M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-02-22:00 - 7.18M - - - - rpool/export/home/matt at zfs-auto-snap:monthly-2009-08-04-20:49 - 386K - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-04-21:00 - 251K - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-04-22:00 - 49.9M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-07-08:00 - 42.6M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-08-13:16 - 39.5M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-08-14:00 - 28.6M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-08-15:00 - 26.7M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-08-16:00 - 50.6M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-08-17:00 - 2.72M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-10-20:00 - 3.48M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-10-21:00 - 48.6M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-10-22:00 - 8.83M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-17:52 - 243K - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-18:00 - 165K - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-19:00 - 45.4M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-20:00 - 38.5M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-21:00 - 38.7M - - - - rpool/export/home/matt at zfs-auto-snap:frequent-2009-08-11-21:45 - 6.00M - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-11-22:00 - 6.91M - - - - rpool/export/home/matt at zfs-auto-snap:frequent-2009-08-11-22:15 - 8.27M - - - - rpool/export/home/matt at zfs-auto-snap:frequent-2009-08-11-22:30 - 7.69M - - - - rpool/export/home/matt at zfs-auto-snap:daily-2009-08-12-07:32 - 0 - - - - rpool/export/home/matt at zfs-auto-snap:hourly-2009-08-12-07:32 - 0 - - - - rpool/export/home/matt at zfs-auto-snap:weekly-2009-08-12-07:32 - 0 - - - - rpool/export/home/matt at zfs-auto-snap:frequent-2009-08-12-07:45 - 3.87M - - - -
Richard Elling
2009-Aug-14 16:40 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
On Aug 14, 2009, at 9:19 AM, Matthew Stevenson wrote:> Please can someone take a look at the attached file which shows the > output on my machine of > zfs list -r -t filesystem,snapshot -o space rpool/export/home/matt > > The USEDDS figure of ~2GB is what I would expect, and is the same > figure reported by the Disk Usage Analyzer. Where is the remaining > 13.8GB USEDSNAP figure coming from? If I total up the list of zfs- > auto snapshots it adds up to about 4.8GB, which leaves about 11GB > unaccounted for. > > Please can someone tell me where I''m going wrong and how I can find > out what is using all that extra space?This can get a little bit confusing, especially if you are unsure of the definitions. Cindy did a good job of explaining these in the ZFS Administration Guide. Rather than me copy-n-pasting here, take a look at Cindy''s explanation and see if that answers your question. http://opensolaris.org/os/community/zfs/docs/zfsadmin.pdf -- richard
Matthew Stevenson
2009-Aug-18 07:37 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
The guide is good, but didn''t tell me anything I didn''t already know about this area unfortunately. Anyway, I freed up a big chunk of space by first deleting the snapshot which was reported by zfs list as being the largest (2GB). Doing zfs list after this deletion revealed that several of the numbers had changed - all of a sudden a snapshot that was a couple of hundred MB turned into 5GB, so I deleted that as well. So there must be basically lots of references to data that hide themselves from the surface and can''t really be found using zfs list. Is there another tool that helps to visualize disk space usage and references to data, or could one potentially be made? E.g. I regained my disk space by trial and error, but if there had been some kind of visual tool that made it easy to see that "if I delete that snapshot, then that one, I will get 7GB back", that would have been really handy. Thanks, Matt -- This message posted from opensolaris.org
Fajar A. Nugraha
2009-Aug-18 08:15 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
On Tue, Aug 18, 2009 at 2:37 PM, Matthew Stevenson<no-reply at opensolaris.org> wrote:> So there must be basically lots of references to data that hide themselves from the surface and can''t really be found using zfs list."zfs list -t all" usually works for me. Look at "USED" and "REFER" My understanding is like this: REFER -> how much data that fs/snapshot refers to, usually the same as (or close to) "df" output for fs. USED -> how much data that fs (including its snapshot) uses, or how much data that particular snapshot uses which is not also in the previous snapshot. You might also be interested in the output of "zfs get usedbysnapshots,usedbydataset,usedbychildren dataset_name"> Is there another tool that helps to visualize disk space usage and references to data, or could one potentially be made? E.g. I regained my disk space by trial and error, but if there had been some kind of visual tool that made it easy to see that "if I delete that snapshot, then that one, I will get 7GB back", that would have been really handy.The "usedbysnapshots" property shohuld give an idea how much space will be regained if you delete all snapshots. It''s somewhat new property (starting zpool v13, I think). -- Fajar
Matthew Stevenson
2009-Aug-18 09:09 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Hi, thanks for the info. Can you have a look at the attachment on the original post for me? Everything you said is what I expected to see in the output there, but a lot of the values are blank where I hoped they would at least be able to tell me a breakdown of the USEDSNAP figure As far as I know I''m using zpool version 13 (it might be higher - I didn''t upgrade it manually, but I don''t know if the updates from /dev repository would have triggered an upgrade at any point) Thanks, Matt -- This message posted from opensolaris.org
Fajar A. Nugraha
2009-Aug-18 09:36 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
On Tue, Aug 18, 2009 at 4:09 PM, Matthew Stevenson<no-reply at opensolaris.org> wrote:> Hi, thanks for the info. > > Can you have a look at the attachment on the original post for me? > > Everything you said is what I expected to see in the output there, but a lot of the values are blank where I hoped they would at least be able to tell me a breakdown of the USEDSNAP figureWell, I see USEDSNAP 13.8 GB for the dataset, so if you delete ALL snapshots you''d probably be able to get that much. As for "which snapshot to delete to get most space", that''s a liitle bit tricky. See rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-28-20:59, which has USED 2.45G? If I understand correctly, it roughly means rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-28-20:59 and rpool/export/home/matt at zfs-auto-snap:monthly-2009-07-05-13:43 has about 2.45G of difference. Note that the space is probably shared/refered to by the previous snapshots as well. This means: - Deleting rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-28-20:59 only probably won''t save you lots of space, as the used space would probably be moved to rpool/export/home/matt at zfs-auto-snap:monthly-2009-05-28-08:03 - Deleting all snapshot on and prior to rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-28-20:59 could give you at least 2.45G space. It''s somewhat rough guess, but that''s the best interpretation I can come up with.> > As far as I know I''m using zpool version 13 (it might be higher - I didn''t upgrade it manually, but I don''t know if the updates from /dev repository would have triggered an upgrade at any point)The system will be capable of new version, but the pool will not upgrade itself automatically. -- Fajar
Matthew Stevenson
2009-Aug-18 12:47 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
> Well, I see USEDSNAP 13.8 GB for the dataset, so if you delete ALL > snapshots you''d probably be able to get that much.I agree, it''s just hard to see how...> As for "which snapshot to delete to get most space", > that''s a liitle > bit tricky. See > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > 8-20:59, which > has USED 2.45G? If I understand correctly, it roughly > means > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > 8-20:59 and > rpool/export/home/matt at zfs-auto-snap:monthly-2009-07-0 > 5-13:43 has > about 2.45G of difference.That''s what I thought too, but by that logic I''d have thought that if you add up all the "differences", you''d get the total USEDSNAP figure of 13.8GB, but you don''t - it only adds up to around 5GB.> > This means: > - Deleting > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > 8-20:59 > only probably won''t save you lots of space, as the > used space would > probably be moved to > rpool/export/home/matt at zfs-auto-snap:monthly-2009-05-2 > 8-08:03 > - Deleting all snapshot on and prior to > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > 8-20:59 could > give you at least 2.45G space.Yes, that''s exactly what happened - the used data all moved to another snapshot, and deleting that snapshot freed it all up (I guess that must have been the point at which I first wrote the large files, or whatever). It seems that the more you start to delete things, the easier it is to see where the total USEDSNAP figure is coming from. It''s almost like it can''t tell you where the figure is coming from ahead of time - it requires you to take more actions before it can give you a more accurate figure. I''m sure there must be a way to find out though... Thanks, Matt -- This message posted from opensolaris.org
Thomas Burgess
2009-Aug-18 13:33 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
it''s pretty simple, if i understand it correctly. When you add some blocks to zfs... xxxxxxxxxxx then take a snapshot xxxxxxxxxxxx (snapshot of x) the disk has the space of the x''s and the snapshot does''t take up any space yet then you add more to the drive and maybe take another snapshot xxxxxxxxxxxx dddddddd (snapshot of x) (+ difference) (snapshot of d) each time you change stuff thats part of all the data sets the snapshots grow (it keeps track of the DIFFERENCES) so they start off small but grow larger....then, if you DELETE something from your current filesystem it "falls" to the snapshot....i hope i am explaining it well...but when you think about it like this it''s easy to see how this can happen On Tue, Aug 18, 2009 at 8:47 AM, Matthew Stevenson <no-reply at opensolaris.org> wrote:> > Well, I see USEDSNAP 13.8 GB for the dataset, so if you delete ALL > > snapshots you''d probably be able to get that much. > > I agree, it''s just hard to see how... > > > As for "which snapshot to delete to get most space", > > that''s a liitle > > bit tricky. See > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > > 8-20:59, which > > has USED 2.45G? If I understand correctly, it roughly > > means > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > > 8-20:59 and > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-07-0 > > 5-13:43 has > > about 2.45G of difference. > > That''s what I thought too, but by that logic I''d have thought that if you > add up all the "differences", you''d get the total USEDSNAP figure of 13.8GB, > but you don''t - it only adds up to around 5GB. > > > > > This means: > > - Deleting > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > > 8-20:59 > > only probably won''t save you lots of space, as the > > used space would > > probably be moved to > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-05-2 > > 8-08:03 > > - Deleting all snapshot on and prior to > > rpool/export/home/matt at zfs-auto-snap:monthly-2009-06-2 > > 8-20:59 could > > give you at least 2.45G space. > > Yes, that''s exactly what happened - the used data all moved to another > snapshot, and deleting that snapshot freed it all up (I guess that must have > been the point at which I first wrote the large files, or whatever). It > seems that the more you start to delete things, the easier it is to see > where the total USEDSNAP figure is coming from. > > It''s almost like it can''t tell you where the figure is coming from ahead of > time - it requires you to take more actions before it can give you a more > accurate figure. I''m sure there must be a way to find out though... > > Thanks, > Matt > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090818/b6de0028/attachment.html>
Matthew Stevenson
2009-Aug-18 16:04 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
I do understand these concepts, but to me that still doesn''t explain why adding the size of each snapshot together doesn''t equal the size reported by zfs list in USEDSNAP. I''m clearly missing something. Hmmm... -- This message posted from opensolaris.org
Richard Elling
2009-Aug-18 16:15 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
On Aug 18, 2009, at 9:04 AM, Matthew Stevenson wrote:> I do understand these concepts, but to me that still doesn''t explain > why adding the size of each snapshot together doesn''t equal the size > reported by zfs list in USEDSNAP.Here is the pertinent text from the ZFS Admin Guide. usedbysnapshots Read-only property that identifies the amount of space that is consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset''s snapshots were destroyed. Note that this is not simply the sum of the snapshots'' used properties, because space can be shared by multiple snapshots. The property abbreviation is usedsnap. Could you offer an alternative or clarifying statement? -- richard
Thomas Burgess
2009-Aug-18 16:21 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
dude, i just explained it =) ok...let me see if i can do better... if you have a file that''s 1 gb , in zfs you have those blocks added. on a normal filesystem when you edit the file or add to it, it will erase the old file and add a new one over it (more or less). on zfs, you have the blocks added just liek when you first add them on antoher system, but when you edit it and change it, it doesn''t erase the file and add the "changed" file, it adds JUST what is different. because of this, both "copies" of the file exist (the old one + blocks referencing what has changed) now, a snapshot, is a point in time COPY of what THIS looks like....so, when files CHANGE, snapshots GROW, not always BASED on the size of the files, but on the size of how different things are...does this make more sense? then when you DELETE a file or something, all of those original changes are still referenced in snapshots....so the more snapshots you have, and the MORE things change, the MORE SPACE you''re going to take up.... On Tue, Aug 18, 2009 at 12:04 PM, Matthew Stevenson < no-reply at opensolaris.org> wrote:> I do understand these concepts, but to me that still doesn''t explain why > adding the size of each snapshot together doesn''t equal the size reported by > zfs list in USEDSNAP. > > I''m clearly missing something. Hmmm... > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090818/2855d7cd/attachment.html>
Matthew Stevenson
2009-Aug-18 17:52 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Ha ha, I know! Like I say, I do get COW principles! I guess what I''m after is for someone to look at my specific example (in txt file attached to first post) and tell me specifically how to find out where the 13.8GB number is coming from. I feel like a total numpty for going on about this, I really do, but despite all the input I still don''t see an answer to this basic question. I promise this will be my last post querying the subject! Thanks Matt -- This message posted from opensolaris.org
Thomas Burgess
2009-Aug-18 18:28 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
If you understand how copy on write works and how snapshots work then the concept of the extra space should make perfect since. If you want a mathmatic formula for how to figure it out i would have to say that it would be based on how DIFFERENT the data is between snapshots AND how MUCH data it is....but it''s not always a 10 gb file + 10 gb file = 20 gb...that is simply NOT how ZFS or snapshots WORK. Really, If you think about it, it makes perfect sense....and it''s not always as black and white as you''d like it to be. On Tue, Aug 18, 2009 at 1:52 PM, Matthew Stevenson <no-reply at opensolaris.org> wrote:> Ha ha, I know! Like I say, I do get COW principles! > > I guess what I''m after is for someone to look at my specific example (in > txt file attached to first post) and tell me specifically how to find out > where the 13.8GB number is coming from. > > I feel like a total numpty for going on about this, I really do, but > despite all the input I still don''t see an answer to this basic question. > > I promise this will be my last post querying the subject! > > Thanks > Matt > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090818/ef36f62d/attachment.html>
Robert Milkowski
2009-Aug-20 22:25 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Matthew Stevenson wrote:> Ha ha, I know! Like I say, I do get COW principles! > > I guess what I''m after is for someone to look at my specific example (in txt file attached to first post) and tell me specifically how to find out where the 13.8GB number is coming from. > > I feel like a total numpty for going on about this, I really do, but despite all the input I still don''t see an answer to this basic question. > > I promise this will be my last post querying the subject! > >The problem is how do you account for data which is referenced by more than one snapshot? Which snapshot would you "charge" then? The used property only tells you how much *unique* data is being held by snapshot (so the data is not referenced by any other snapshot or filesystem). If some data is referenced by more than one snapshot it is accounted as used for a file system for lack of better way of presenting it to user. The usedbysnap property represents the amount of storage to be regained if all snapshots were removed. Lets say you created 1GB file: /pool/file1. Now you created snapshot: zfs snapshot pool at snap1 so far the snapshot does not consume any data. now create another 1GB file: /pool/file2 and create another snapshot: zfs snapshot pool at snap2 Notice that file1 is referenced by both snapshots while file2 is referenced only by snap2. Now remove file1 from the filesystem. Because both snapshots reference it against which one should you report 1GB of usage? In such a case the 1GB will be charged against main filesystem only. If you remove file2 used space will be charged against filesystem and snap2 as it is only snap2 which references to it so there is no confusion as what it should be charged against. Example: milek at r600:~# zfs create rpool/test milek at r600:~# mkfile 10m /rpool/test/file1 milek at r600:~# zfs snapshot rpool/test at snap1 milek at r600:~# mkfile 10m /rpool/test/file2 milek at r600:~# zfs snapshot rpool/test at snap2 milek at r600:~# zfs list -r -t all rpool/test NAME USED AVAIL REFER MOUNTPOINT rpool/test 20.0M 93.0G 20.0M /rpool/test rpool/test at snap1 17K - 10.0M - rpool/test at snap2 0 - 20.0M - milek at r600:~# rm /rpool/test/file1 milek at r600:~# zfs list -r -t all rpool/test NAME USED AVAIL REFER MOUNTPOINT rpool/test *20.1M * 93.0G *10.0M * /rpool/test rpool/test at snap1 17K - 10.0M - rpool/test at snap2 17K - 20.0M - milek at r600:~# milek at r600:~# rm /rpool/test/file2 milek at r600:~# zfs list -r -t all rpool/test NAME USED AVAIL REFER MOUNTPOINT rpool/test 20.1M 93.0G 19K /rpool/test rpool/test at snap1 17K - 10.0M - rpool/test at snap2 10.0M - 20.0M - milek at r600:~# Since file2 is referenced uniquely only by snap2 it is reported as used space of snap2. file1 is referenced by both snapshots so its 10MB is charged against filesystem only as it is not clear which snapshot should heave represent it. Usedbysnashot should point to ~20MB: milek at r600:~# zfs get usedbysnapshots rpool/test NAME PROPERTY VALUE SOURCE rpool/test usedbysnapshots 20.0M - milek at r600:~# So going back to your case (I haven''t read you attachment but I think I got it right): all your snapshots are using 13.8GB as that much data is being referenced by them but no longer by filesystem (so data was modified or deleted from the filesystem). Now some of that data is referenced by multiple snapshots so it is not clear against which one it should be reported. Some of data is being uniquely referenced by only a one snapshot so such data is easy to be represented as being used by that specific snapshot. I hope it is clear now... -- Robert Milkowski http://milek.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090820/d370a656/attachment.html>
Matthew Stevenson
2009-Aug-21 20:22 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Thank you very much, this explains it perfectly. I had been coming to the conclusion that the shared data must be what accounts for the "missing" space, but previously my thinking/expectation was that it would be "charged" against the snapshot in which the shared data first appeared. Doing that would probably bring its own complications too though I suppose, so I can see why the decision was made to lump it all together in the "usedbysnapshots" figure rather than complicate the zfs command output further. It does lead to another question though: is there a way to see how much data is shared between any two given snapshots? Thanks again, Matt -- This message posted from opensolaris.org
Al Hopper
2009-Aug-22 16:43 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
On Thu, Aug 20, 2009 at 5:25 PM, Robert Milkowski <milek at task.gda.pl> wrote:> Matthew Stevenson wrote: > > Ha ha, I know! Like I say, I do get COW principles! > > I guess what I''m after is for someone to look at my specific example (in txt file attached to first post) and tell me specifically how to find out where the 13.8GB number is coming from. > > I feel like a total numpty for going on about this, I really do, but despite all the input I still don''t see an answer to this basic question. > > I promise this will be my last post querying the subject! > > > > The problem is how do you account for data which is referenced by more > than one snapshot? Which snapshot would you "charge" then? The used property > only tells you how much *unique* data is being held by snapshot (so the data > is not referenced by any other snapshot or filesystem). If some data is > referenced by more than one snapshot it is accounted as used for a file > system for lack of better way of presenting it to user. The usedbysnap > property represents the amount of storage to be regained if all snapshots > were removed. > > Lets say you created 1GB file: /pool/file1. > Now you created snapshot: zfs snapshot pool at snap1 > > so far the snapshot does not consume any data. > > now create another 1GB file: /pool/file2 > and create another snapshot: zfs snapshot pool at snap2 > > Notice that file1 is referenced by both snapshots while file2 is referenced > only by snap2. > > Now remove file1 from the filesystem. Because both snapshots reference it > against which one should you report 1GB of usage? In such a case the 1GB > will be charged against main filesystem only. If you remove file2 used space > will be charged against filesystem and snap2 as it is only snap2 which > references to it so there is no confusion as what it should be charged > against. > > Example: > > > milek at r600:~# zfs create rpool/test > milek at r600:~# mkfile 10m /rpool/test/file1 > milek at r600:~# zfs snapshot rpool/test at snap1 > milek at r600:~# mkfile 10m /rpool/test/file2 > milek at r600:~# zfs snapshot rpool/test at snap2 > > milek at r600:~# zfs list -r -t all rpool/test > NAME USED AVAIL REFER MOUNTPOINT > rpool/test 20.0M 93.0G 20.0M /rpool/test > rpool/test at snap1 17K - 10.0M - > rpool/test at snap2 0 - 20.0M - > > milek at r600:~# rm /rpool/test/file1 > > milek at r600:~# zfs list -r -t all rpool/test > NAME USED AVAIL REFER MOUNTPOINT > rpool/test *20.1M * 93.0G *10.0M * /rpool/test > rpool/test at snap1 17K - 10.0M - > rpool/test at snap2 17K - 20.0M - > milek at r600:~# > > milek at r600:~# rm /rpool/test/file2 > > milek at r600:~# zfs list -r -t all rpool/test > NAME USED AVAIL REFER MOUNTPOINT > rpool/test 20.1M 93.0G 19K /rpool/test > rpool/test at snap1 17K - 10.0M - > rpool/test at snap2 10.0M - 20.0M - > milek at r600:~# > > Since file2 is referenced uniquely only by snap2 it is reported as used > space of snap2. > file1 is referenced by both snapshots so its 10MB is charged against > filesystem only as it is not clear which snapshot should heave represent it. > > Usedbysnashot should point to ~20MB: > > milek at r600:~# zfs get usedbysnapshots rpool/test > NAME PROPERTY VALUE SOURCE > rpool/test usedbysnapshots 20.0M - > milek at r600:~# > > > > > So going back to your case (I haven''t read you attachment but I think I got > it right): all your snapshots are using 13.8GB as that much data is being > referenced by them but no longer by filesystem (so data was modified or > deleted from the filesystem). Now some of that data is referenced by > multiple snapshots so it is not clear against which one it should be > reported. Some of data is being uniquely referenced by only a one snapshot > so such data is easy to be represented as being used by that specific > snapshot. > > > I hope it is clear now... > > -- > Robert Milkowski > http://milek.blogspot.com > - >Kudos: Very nicely written Robert! :) Perhaps we can add this to the ZFS FAQs Regards, Al Hopper Logical Approach Inc,Plano,TX al at logical-approach.com Voice: 972.379.2133 Timezone: US CDT OpenSolaris Governing Board (OGB) Member - Apr 2005 to Mar 2007 http://www.opensolaris.org/os/community/ogb/ogb_2005-2007/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20090822/2910eb1d/attachment.html>
Robert Milkowski
2009-Aug-25 20:03 UTC
[zfs-discuss] What''s eating my disk space? Missing snapshots?
Matthew Stevenson wrote:> It does lead to another question though: is there a way to see how much data is shared between any two given snapshotsonly if these are the only two snapshots (and no clones) as then the difference in a total used space for all snapshots (two of them) and a sum of their per snapshot usage is amount of data which is not share among them - everything else is. With more snapshots there is no easy way of getting such data. -- Robert Milkowski http://milek.blogspot.com