moving MTD partitions

David Woodhouse dwmw2 at infradead.org
Wed Apr 30 09:04:00 EDT 2003


On Wed, 2003-04-30 at 14:57, Thomas Gleixner wrote:
> On Wednesday 30 April 2003 13:29, J B wrote:
> > "The basic question is if it is feasible to resize (smaller or larger) a
> > jffs2 filesystem / mtd block device over flash and maintain the existing
> > contents. Copying the contents out and then back again is not an option
> > (not enough space)."
> 
> First answer is no.
> On second thought could be a possibility to do so. 

Well, making it _larger_ is trivial. Just extend the partition with
empty erase blocks, and they'll get used.

Making it smaller is of course more of a problem -- you need to force
garbage collection until there's at least one block which is completely
free, then unmount, move the last block of the fs into the newly-freed
block, reduce the size by one block and remount it. Repeat.

You used to be able to force GC by repeatedly sending SIGHUP to the
kernel's GC daemon process, but I think Thomas is right that you can't
do that any more and you have to hack it. You'd probably do better to do
it offline with a special tool. 

-- 
dwmw2




More information about the linux-mtd mailing list