On Wed, Sep 26, 2012 at 10:28 AM, Edward Ned Harvey
(opensolarisisdeadlongliveopensolaris) <
opensolarisisdeadlongliveopensola...@nedharvey.com> wrote:

>  When I create a 50G zvol, it gets "volsize" 50G, and it gets "used" and "
> refreservation" 51.6G****
> ** **
> I have some filesystems already in use, hosting VM's, and I'd like to
> mimic the refreservation setting on the filesystem, as if I were smart
> enough from the beginning to have used the zvol.  So my question is ...***
> *
> ** **
> What's the extra 1.6G for?

It is for metadata -- the indirect blocks required to reference the 50G of

> ****
> And****
> If I have a filesystem holding a single VM with a single 2T disk, how
> large should the refreservation be?****
> ** **
> If it's a linear scale, it should be 2.064T refreservation.

For a filesystem, we can't exactly predict how much metadata will be needed
because it depends on how it is used (many small files vs few large files).
 For zvols, we can predict it exactly because we know it's just one big
object.  See zvol_volsize_to_reservation() for details.

Your case of a single large file can be treated like a zvol.  If your
filesystem has the same recordsize[*] (default is 128k) as the zvol's
volblocksize (default is 8k), then you can linearly scale that 3% with the
file size.  If you are using a different recordsize, you can linearly scale
the amount of metadata (larger recordsize -> less metadata).


[*] Note that the big file's recordsize is set when it is created, so what
matters is what the recordsize was when the file was created.  Changing the
recordsize property after it's created won't change the metadata layout of
the file.
zfs-discuss mailing list
  • [zfs-discuss] zvo... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
    • Re: [zfs-dis... Matthew Ahrens

Reply via email to