MTD copy on JFFS2

Jörn Engel joern at wohnheim.fh-wedel.de
Wed Oct 2 21:19:46 EDT 2002


On Tue, 1 October 2002 06:12:21 -0700, Sriram Neelakandan Iyer wrote:
> i have 2 jffs2 partitions(over mtd) used for storing
> config files.
> I need to copy all the files from one partition to
> another, and the destination mtd partition is larger
> than the source mtd partition.(i cannot mount the
> second partition as jffs2 before the data is copied)
> 
> As of now i run mkfs.jffs2 over the source jffs2
> directory and copy to ramfs and then erase the
> destination partition and i do a mtd-write over the
> destination partition.
> 
> But mkfs.jffs2 needs libz and both of them occupy
> about 87K of space.
> 
> So i plan to do a plain mtd-copy ,i.e 
> 1. first unmount source jffs2,
> 2. read over the source mtd-char-device and 
> 3. dump it back to the second mtd-partition. 

Should work, as long as both partitions have the same erase block
size, the target partition is not smaller and was erased before 3.

> Will jffs2 be able to mount the second partition
> without trouble?

On first mount you will get some messages about missing erase markers,
jffs2 will erase all new blocks. About as dangerous as a collision in
ethernet. :)

Jörn

-- 
Good warriors cause others to come to them and do not go to others.
-- Sun Tzu




More information about the linux-mtd mailing list