* help request, jffs2 fs files get lost @ 2011-05-01 11:35 Angelo Dureghello 2011-05-02 6:55 ` Ricard Wanderlof 0 siblings, 1 reply; 5+ messages in thread From: Angelo Dureghello @ 2011-05-01 11:35 UTC (permalink / raw) To: linux-mtd Hi all, i am looking for some help on an issue with jffs2: i can create jffs2 fs, mount, store edit/write some files, unmount, but in a next mount i find no more files/dirs. MTD probe detect correctly my flash, the chip allows erase sectors of 4KB, or blocks of 64KB. MTD shows correctly a 0x1000 erase size. / # / # cat /proc/mtd dev: size erasesize name mtd0: 00010000 00001000 "Colilo (64K)" mtd1: 002f0000 00001000 "Kernel+ROMfs (3008K)" mtd2: 00100000 00001000 "JFFS2 (1024K)" <--- want to use this partition only as jffs2 to store non volatile data mtd3: 0009d000 00001000 "ROMfs" 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 Then i just mount/umount the device, but i get often the issue decribed. Any help is really appreciated. many thanks angelo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: help request, jffs2 fs files get lost 2011-05-01 11:35 help request, jffs2 fs files get lost Angelo Dureghello @ 2011-05-02 6:55 ` Ricard Wanderlof 2011-05-02 8:43 ` angelo [not found] ` <4DBE6BCD.3050400@gmail.com> 0 siblings, 2 replies; 5+ messages in thread From: Ricard Wanderlof @ 2011-05-02 6:55 UTC (permalink / raw) To: Angelo Dureghello; +Cc: linux-mtd@lists.infradead.org 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 -- Ricard Wolf Wanderlöf ricardw(at)axis.com Axis Communications AB, Lund, Sweden www.axis.com Phone +46 46 272 2016 Fax +46 46 13 61 30 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: help request, jffs2 fs files get lost 2011-05-02 6:55 ` Ricard Wanderlof @ 2011-05-02 8:43 ` angelo [not found] ` <4DBE6BCD.3050400@gmail.com> 1 sibling, 0 replies; 5+ messages in thread From: angelo @ 2011-05-02 8:43 UTC (permalink / raw) To: linux-mtd@lists.infradead.org; +Cc: Ricard Wanderlof 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> ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4DBE6BCD.3050400@gmail.com>]
* Re: help request, jffs2 fs files get lost [not found] ` <4DBE6BCD.3050400@gmail.com> @ 2011-05-02 8:58 ` Ricard Wanderlof 2011-05-02 9:16 ` angelo 0 siblings, 1 reply; 5+ messages in thread From: Ricard Wanderlof @ 2011-05-02 8:58 UTC (permalink / raw) To: angelo; +Cc: linux-mtd@lists.infradead.org On Mon, 2 May 2011, angelo wrote: > 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. > > sorry, was just 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) Out of curiosity, what exactly is the type of flash you are using? /Ricard -- Ricard Wolf Wanderlöf ricardw(at)axis.com Axis Communications AB, Lund, Sweden www.axis.com Phone +46 46 272 2016 Fax +46 46 13 61 30 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: help request, jffs2 fs files get lost 2011-05-02 8:58 ` Ricard Wanderlof @ 2011-05-02 9:16 ` angelo 0 siblings, 0 replies; 5+ messages in thread From: angelo @ 2011-05-02 9:16 UTC (permalink / raw) To: linux-mtd@lists.infradead.org; +Cc: Ricard Wanderlof On 02/05/2011 10:58, Ricard Wanderlof wrote: > > On Mon, 2 May 2011, angelo wrote: > >> 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. >> >> sorry, was just 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) > > Out of curiosity, what exactly is the type of flash you are using? > > /Ricard Hi Ricard, thanks again for help the flash chip is an SST 39VF2301B, word programmable, tot 4MB, 4KB sector size, 64K block size, it is very similar to an AMD 16bit data bus width flash. It seems to be correctly detected from jedec probe, but through CFI queries probably ... physmap platform flash device: 00400000 at ffc00000 physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000bf Chip ID 0x00235d number of CFI chips: 1 ... /proc # cat /proc/mtd dev: size erasesize name mtd0: 00010000 00001000 "Colilo (64K)" mtd1: 002f0000 00001000 "Kernel+ROMfs (3008K)" mtd2: 00100000 00001000 "JFFS2 (1024K)" mtd3: 0009d000 00001000 "ROMfs" This is a suspected sequence of MTD commands i find in dmesg: ... MTD_ioctl MTD_ioctl MTD_ioctl MTD_ioctl MTD_ioctl MTD_ioctl MTD_close MTD_open MTD_write MTD_close Node totlen on flash (0xffffffff) != totlen from node ref (0x00000074) MTD_open <-- jffs2 fs disapperaed from here MTD_read MTD_read ... many thanks, angelo ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-02 9:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-01 11:35 help request, jffs2 fs files get lost Angelo Dureghello
2011-05-02 6:55 ` Ricard Wanderlof
2011-05-02 8:43 ` angelo
[not found] ` <4DBE6BCD.3050400@gmail.com>
2011-05-02 8:58 ` Ricard Wanderlof
2011-05-02 9:16 ` angelo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox