Gavin Maltby
2009-Mar-11 04:19 UTC
[zfs-discuss] usedby* properties for datasets created before v13
Hi, The manpage says Specifically, used = usedbychildren + usedbydataset + usedbyrefreservation +, usedbysnapshots. These proper- ties are only available for datasets created on zpool "version 13" pools. .. and I now realize that "created" at v13 is the important bit, rather than "created pre v13 and upgraded", and I see that for datasets created on a version prior to 13 show "-" for these properties (might be nice to note that in the manpage - I took "-" to mean zero for a while). Anyway, is there any way to retrospectively populate these statistics (avoiding dataset reconstruction, that is)? No chance a scrub would/could do it? Thanks Gavin
Matthew Ahrens
2009-Mar-12 18:39 UTC
[zfs-discuss] usedby* properties for datasets created before v13
Gavin Maltby wrote:> Hi, > > The manpage says > > Specifically, used = usedbychildren + usedbydataset + > usedbyrefreservation +, usedbysnapshots. These proper- > ties are only available for datasets created on zpool > "version 13" pools. > > .. and I now realize that "created" at v13 is the important bit, > rather than "created pre v13 and upgraded", and I > see that for datasets created on a version prior to 13 > show "-" for these properties (might be nice to note that > in the manpage - I took "-" to mean zero for a while). > > Anyway, is there any way to retrospectively populate these > statistics (avoiding dataset reconstruction, that is)? > No chance a scrub would/could do it?In theory one could add code to calculate these after the fact. A tricky part is differentiating between usedbydataset and usedbysnapshots for clones. In that case you would need to examine all block pointers in the clone. Those born after the origin are usedbydataset, and usedbysnapshots is whatever''s left over. Doing this while things are changing may be nontrivial. --matt