Actual usage of files in ubifs

Artem Bityutskiy dedekind1 at gmail.com
Mon Sep 11 08:44:09 PDT 2017


On Mon, 2017-09-11 at 17:18 +0200, Ricard Wanderlof wrote:
> On Mon, 11 Sep 2017, Richard Weinberger wrote:
> 
> > On Mon, Sep 11, 2017 at 11:47 AM, Ricard Wanderlof
> > <ricard.wanderlof at axis.com> wrote:
> > > 
> > > Is there a (simple) way to find out exactly how much space each
> > > specific
> > > file uses in an ubifs fils system?
> > > 
> > > I looked into running mkfs.ubifs with some form of option to give
> > > me the
> > > info, the closest I got was -g 3 which output a lot of sizes but
> > > it was
> > > not obvious exactly what they meant.
> > > 
> > > I suppose it would be fully possible to add code to mkfs.ubifs to
> > > output
> > > this information, as it surely must be there at some point, since
> > > it
> > > selects the compression algorithm on a file per file basis,
> > > debending on
> > > the amount of compression acheived for each algorithm.
> > 
> > Well, how exactly should it be?
> > I guess you want more than the compressed size on flash.
> > Do you also want to know how much bytes a file occupies in the
> > index
> > tree and the inode itself?
> > This is non-trivial.
> 
> Good point. I was solely thinking along the lines of how much space
> the 
> actual file occupied, not considering metadata. That would be a good 
> starting point. I'm guessing that for moderate file sizes the
> metadata 
> would be relatively small compared to the file itself?

I would think a "slow" version of this would not be that hard to
implement - walk the index and sum up node sizes. Subtract header sizes
if you do not want metadata.

I am not sure what would be the API? Do other FSes implement something
like this?



More information about the linux-mtd mailing list