ubi resize shrink volume

Richard Weinberger richard at sigma-star.at
Mon Sep 18 06:29:19 PDT 2017


Am Montag, 18. September 2017, 14:32:56 CEST schrieb Jaap de Jong:
> >> Sorry for the confusion.
> >> Yes, I want to shrink of a not-mounted UBIFS preferably in u-boot.
> >> In the posts I read it should not be that hard to do, so I was wondering
> >> if anyone had taken the effort to implement this...
> > 
> > Nope. So far nobody cared enough about this feature.
> > Please note that many other major filesystems alos don't support this.
> > Such das XFS.
> 
> Well we do care!
> Any thoughts to share? We could use some help...
> My first impression was that the size of the partition was just a
> maximum number of PEBs to use for it,
> so lowering that value would just set a new limit and whatever PEBs were
> used for that specific partition
> was under control of the wear-levelling algorithms. But apparently it is
> more complicated.

Well, on UBI level it is easy.
On UBIFS you need to do more.

Think about the situation where you have N LEBs where M are in use by UBIFS 
and you reduce the volume size to X.
Assuming that all existing files can fit into X LEBs, therefore X >= M.
Now you have to find all UBIFS data structures that have a reference to a LEB 
(> X) that is now outside of the new volume size. You have move data around 
patch all references.

Thanks,
//richard

-- 
sigma star gmbh - Eduard-Bodem-Gasse 6 - 6020 Innsbruck - Austria
ATU66964118 - FN 374287y



More information about the linux-mtd mailing list