JFFS partition mix-up on USB-stick

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Jul 12, 2021 22:02    Post subject: JFFS partition mix-up on USB-stick Reply with quote
I recently exchanged my old Buffalo router WZR-HP-G300NH for a Netgear R7800.
I am used to keeping a table with reserved IPs on the JFFS partition and share it with SAMBA, so I can edit the reserved IPs table on my laptop.

In the new router I used the same USB-stick that I used in the old Buffalo router, but renamed the old JFFS partition with a name like Buffalo JFFS, and created a new one called just JFFS.

After this it became unclear which partition the router is using. After editing the table and restarting the router, the old file kept coming back as it were.

In the end I notice that *both* partitions with JFFS in their name were mounted as /jffs ...

Even after deleting the letters JFFS from the partition called Buffalo JFFS, making it just Buffalo, the new router kept mounting both Buffalo and JFFS partitions as /jffs (according to the GUI).
There was a comment in the GUI to the effect that it had been mounted earlier as JFFS ....

I had to actually delete the old Buffalo partition from the USB-stick to make sure only the right partition is mounted as JFFS and used for JFFS2.
Sponsor
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2037

PostPosted: Mon Jul 12, 2021 23:43    Post subject: Reply with quote
Do I understand correctly that you have usb mounted as /jffs and have JFFS2 Support enabled at .../Management.asp?

If so I am pretty sure that would not be recommended.
Read the comment by <Kong> in this thread:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=980273#980273

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad (1.1M blocked) + Blocklist Collection

pandemonium420
DD-WRT User


Joined: 21 Nov 2013
Posts: 65
Location: Cathedral City, CA, USA

PostPosted: Mon Jul 12, 2021 23:57    Post subject: Re: JFFS partition mix-up on USB-stick Reply with quote
Well I don't know if this applies to your issue, but I use to keep my static DHCP leases on my USB attached hard drive (SSD) and used the check box enable "use JFFS2 for client lease DB" (services/service tab) for a while on my r7800. There was a change a while back that has the hard drives spun up way later in the boot process in where that wouldn't be loaded correctly to assign those addresses at boot time because the drive wasn't available yet. I could only store in NVRAM. I was never able get it to work as it did before without some scripting. The R7800 has large NVRAM and I have 220 assigned addresses in NVRAM and it barely touches it, and I use the GUI to update those addresses. Its a pain in the ass, but if you get used to the quirks on that tab entering new or deleting isn't that bad. Meaning save after each update then apply at the end. Once router boots completely all JFFS/JFFS2 functions work, but when assigning addresses during the reboot it works better if stored in NVRAM instead of trying to get them to work later in the boot process.

Sorry if this doesn't apply to your situation.

_________________
Router/Version: Netgear R7800

File/Kernel: DD-WRT v3.0-r50671 std (10/26/22), Linux 4.9.330 #1313 SMP Wed Oct 26 05:13:03 +07 2022 armv7l




ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jul 13, 2021 7:12    Post subject: Reply with quote
bushant wrote:
Do I understand correctly that you have usb mounted as /jffs and have JFFS2 Support enabled at .../Management.asp?

If so I am pretty sure that would not be recommended.
Read the comment by <Kong> in this thread:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=980273#980273


Yes, you have understood correctly. I have and have had that for a long time. Every time when I tried without the JFFS2 support enabled, as I was repeatedly told, it never worked properly. That was many seasons and builds ago, though. I don't remember what went wrong there.
So, I kept it, as it seems to be working. I have no DLNA, just the leases file and the reserved IP file (per an additional dnsmasq setting).

I will try again, though. This router and LAN are only used by me ... and a bunch of servers, also for my own use. Nobody shouting when I 'break' it ...

I saw some write about a jffs partition in the flash memory. I don't know how to see if there is.
I logged in to the router and did a blkid. There were only the two partitions on the USB-stick (jffs and opt).
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jul 13, 2021 7:18    Post subject: Re: JFFS partition mix-up on USB-stick Reply with quote
pandemonium420 wrote:
Well I don't know if this applies to your issue, but I use to keep my static DHCP leases on my USB attached hard drive (SSD) and used the check box enable "use JFFS2 for client lease DB" (services/service tab) for a while on my r7800. There was a change a while back that has the hard drives spun up way later in the boot process in where that wouldn't be loaded correctly to assign those addresses at boot time because the drive wasn't available yet. I could only store in NVRAM. I was never able get it to work as it did before without some scripting. The R7800 has large NVRAM and I have 220 assigned addresses in NVRAM and it barely touches it, and I use the GUI to update those addresses. Its a pain in the ass, but if you get used to the quirks on that tab entering new or deleting isn't that bad. Meaning save after each update then apply at the end. Once router boots completely all JFFS/JFFS2 functions work, but when assigning addresses during the reboot it works better if stored in NVRAM instead of trying to get them to work later in the boot process.

Sorry if this doesn't apply to your situation.


I find the table in the GUI pretty awful to use as I like to keep order and make changes whenever I set up something new on my LAN.
I know you can also enter the reserved IPs in the additional dsnmasq window, too, which would overcome the limitations of the GUI.
I suppose the GUI entries are translated into the equivalent lines in additional dnsmasq.


Now that you mentioned starup sequence problems, I remembered I have this in my startup commands, courtesy of egc:

logger -t --- "Start of $0 script."
# Delay procedure by egc - 13-09-2020
logger -t --- "Delay startup script execution until JFFS thumbdrive mounted "
i=0
until [[ -f /jffs/usb-is-mounted ]]; do
sleep 1
i=$((i+1))
# logger -t --- "i=$i"
if [[ $i -ge 35 ]]; then
logger -t --- "No JFFS thumbdrive mounted within $i seconds "
touch /jffs/usb-is-mounted
exit
fi
done
logger -t --- "$i seconds until JFFS thumbdrive mounted "
logger -t --- "Continue startup script execution "


This looks for a file usb-is-mounted on the thumbdrive jffs partition before continuing the startup script.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jul 13, 2021 7:49    Post subject: Reply with quote
So I just disabled JFFS2 support on the Admin management page and rebooted the router.
It made the Use JFFS2 for client lease DB option go away, as always before when I disabled the JFFS2 support.
For now everything is still at their usual reserved IP addresses, but not sure how it is going to behave in the long run.
dnsmasq.leases is still present on the thumbdrive, of course, but not sure if it will actually be updated there.
The thumbdrive jffs partition is still mounted as /jffs, and shared using samba as JFFS2.
So far so good.

If dnsmasq.leases on the thumbdrive is now just a relic and not updated, it is not that big a deal. It's the reserved IPs file that I like to update there and be used by dd-wrt.
Its use is 'mandated' by the additional dnsmasq setting:
conf-file=/jffs/Reserved_IPs.custom

It remains to be seen if that file is actually used by dd-wrt, or that it's just the servers remembering their IP or some other cacheing mechanism. It has sometimes been somewhat difficult to make a server adopt a new IP after I changed the reserved IP for it.

EDIT after a reboot or two:
It so appears the router doesn't store the dnsmasq.leases file on the /jffs thumbdrive now that the JFFS2 support is disabled. I renamed the old dnsmasq.leases file and the router didn't build a new one.
For the rest the router seems to work as usual. The LAN info page has all the usual information about the active and dhcp clients.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2037

PostPosted: Tue Jul 13, 2021 13:04    Post subject: Reply with quote
For years I have used conf-file=/jffs/dnsmasq.custom in Additional Dnsmasq Options.
/jffs on thumb drive labeled and mounted as jffs.

All changes made to dnsmasq.custom are accurately reflected in /tmp/dnsmasq.conf and correctly assigned by the router.

I have never used "Use JFFS2 for client lease DB" obviously as JFFS2 has never been mounted.

In any event I don't think any of this has anything to do with your original dilemma that you already have sorted.

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad (1.1M blocked) + Blocklist Collection

ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jul 13, 2021 21:24    Post subject: Reply with quote
bushant wrote:
In any event I don't think any of this has anything to do with your original dilemma that you already have sorted.


You're right of course, but I am nevertheless happy to finally see my mishandling of JFFS and JFFS2 support settings sorted as well.

The side effect of loosing the dnsmasq.leases file is more or less inconsequential (where did it go?).

Often after making changes to the reserved IP's it has been a struggle to get everything to their new addresses. There are several settings which influence what you see in the GUI and when. Hostnames disappear from the GUI. Lease time may have been set to a inordinate long time, which makes clients stick to the old IP. It has also been a revelation that the lease is renewed half way through the lease time and not at the end. Sometimes a server did not show up at all in the GUI after a change of the reserved IP and a reboot of the router, even though the server apparently has an IP, but since you don't know it, you cannot open a secure shell session to it either to restart it. Raspberry PI's don't have a shutdown button by design. All sorts of problems.
Understanding grows and I may be getting there slowly Wink
Next I will change the current samba share name of the jffs partition from JFFS2 to just JFFS, even if it's just symbolic.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum