Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#97 closed defect (fixed)

jffs2 not marked clean; filesystem wiped each reboot

Reported by: mbm Owned by: developers
Priority: high Milestone:
Component: base system Version:
Keywords: Cc:


Just documenting a case of rc4's dirty flag not working properly -

00:25 < Leng> Has anyone run into a linksys wap w/openwrt that does not keep
              its admin password through reboots? Other settings seem to stick,
              but not the pw.
00:25 < [mbm]> Leng: check the filesystems .. sounds like you're running
00:32 < Leng> mbm, that looks to be the case. I am just unsure as to how I got
              the wrt into this state.
00:32 < Leng> Another linksys with the same squashfs config keeps the pw
00:33 < Leng> /dev/mtdblock/4 is mounted as / with jffs2
00:34 < [mbm]> Leng: wap54g? that explains it ..
00:34 < Leng> wrt54gsv4
00:34 < Leng> The other is the same version/model
00:35 < Leng> It looks like firstboot is being called every time.
00:35 < [mbm]> Leng: hmm .. make sure you didn't set the no_root_swap nvram var
00:35 < Leng> Not set
00:36 < [mbm]> ok .. then try this - "mtd unlock linux; jffs2root --clean"
00:36 < Leng> "Partition marked as clean"
00:36 < [mbm]> now see if it keeps jffs2 over a reboot
00:37  * Leng reboots.
00:38 < Leng> Whoa.
00:38 < Leng> I touched a file in /etc and it stayed.
00:39  * Leng sets a password and reboots.
00:40 < Leng> [mbm]: Thanks!

For the curious -

The jffs2 data is kept immediately after the firmware in flash. Prior to rc4, the jffs2 partition was only formatted if it wasn't mountable. This created a problem when the firmware images got larger and started to overlap with the previous location of the jffs2 partitions; if any valid data was found on the partition it would mount, but would then crash attempting to read the filesystem. In rc4, a new mechanism was introduced where a flag in the firmware would tell OpenWrt if the jffs2 partition needed to be formatted or not, and once formatted the flag would be changed from dirty to clean. Unfortunately, some devices never seem to set the flag to clean, resulting in firstboot running each bootup.

To manually set the flag to clean - "mtd unlock linux; jffs2root --clean"

Attachments (1)

config.bin (26.6 KB) - added by sarabek81@… 5 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 Changed 12 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

Changed 5 years ago by sarabek81@…

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.