help request, jffs2 fs files get lost

angelo angelo70 at gmail.com
Mon May 2 04:43:46 EDT 2011


On 02/05/2011 08:55, Ricard Wanderlof wrote:
>
> On Sun, 1 May 2011, Angelo Dureghello wrote:
>
>> So from uClinux, i try to prepare the jffs2 fs:
>>
>> # eraseall /dev/mtd2
>> erased 1024 Kibyte @ 0 -- 100% complete.
>>
>> cat /dev/mtd2    i see the flash has been cleared
>>
>> then i create a folder "backup" in /var with some files and try to 
>> crete the jffs2 fs:
>>
>> mkfs.jffs2 -d backup -o jffs2.img
>>
>> cp /deV/mtd2 jffs2.img
>
> If this is in fact what you're doing, you're overwriting your 
> jffs2.img file with the all-ff's contents of the newly erased 
> /dev/mtd2. Swap the two arguments instead.
>
> /Ricard

Hi Ricard,
sorry, was late and just appended a bad had-written text,

i generally do "cp jffs2.img /dev/mtd2", and after mounting mtdblock2 i 
see correctly the root tree.

I did some other tests:
if i mount the new created jffs2 and unmount it, nothing is lost.
If i mount it, open a file, append some text, close it and unmount, then 
at the next mount everything is disapperaed (checking mtd2, all is set 
to 0xff).

Saving modified files i notice a warning:
Writing files is also notice some MTD debug trace, maybe an error:
Node totlen on flash (0xffffffff) != totlen from node ref (0x00000074)


many thanks,
angelo


-- 

  .:.:.SYSAM.:.:.

   di Angelo Dureghello
     via San Nazario 149
       34151, Trieste, Italy
     ++39 340 7631990
   www.sysam.it  <http://www.sysam.it>





More information about the linux-mtd mailing list