From: Kai Krakow <hurikhan77+btrfs@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Tool to calc. 4k / 16k utilization / overhead
Date: Sat, 23 Jun 2012 12:43:20 +0200 [thread overview]
Message-ID: <87jgb9-ie3.ln1@hurikhan.ath.cx> (raw)
In-Reply-To: CAELiMBOxo+R+A-wcHmxJsVpOaf+DRS4AG91ENnYTiNBQJKvXXA@mail.gmail.com
Hi!
Why don't you just use "du -B 4096 -sh /path/to/fs" vs.
"du -B 16384 -sh ..."?
Subtracting both results is the overhead of the one vs. the other.
But to answer your request for the formula, its:
blocks = (long)((file_size + block_size - 1) / block_size)
occupied_size = blocks * block_size
But this does not tell you the real on-disk occupation because it takes the
logical file size of the files into account. But files may be sparse or
compressed which sheds a complete different light on the problem.
I'd go with "du" command because it takes this into account.
Regards,
Kai
Sandra Schlichting <littlesandra88@gmail.com> schrieb:
> Hi all,
>
> When having a non-btrfs fs and want to migrate to btrfs, it is hard to
> know which sector size to choose in terms of disk utilization and
> speed.
>
> So I would like to make a script that scans the non-btrfs fs's
> directory structure to find all file sizes and calculate how much
> space these would take on btrfs 4k and 16k sector size.
>
> Can anyone help me with a formulae to calculate this for a file?
>
> It doesn't have to be exact, just enough to make a decision between 4k and
> 16k.
>
> Best regards,
> Sandra
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2012-06-23 10:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-23 9:15 Tool to calc. 4k / 16k utilization / overhead Sandra Schlichting
2012-06-23 10:43 ` Kai Krakow [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jgb9-ie3.ln1@hurikhan.ath.cx \
--to=hurikhan77+btrfs@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).