DHCP Server Setup and JFFS on USB

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
bootit
DD-WRT Novice


Joined: 15 Oct 2024
Posts: 20

PostPosted: Sun Oct 20, 2024 14:33    Post subject: DHCP Server Setup and JFFS on USB Reply with quote
Router Model
Asus RT-AC5300
Firmware Version
DD-WRT v3.0-r58568 (10/15/24)
Kernel Version
Linux 4.4.302-rt232-st56 #12481 SMP Tue Oct 15 05:05:13 +07 2024 armv7l

Hi, I have added an 8GB USB2.0 pen drive on the Router USB port.

Question 1: Have I correctly enabled JFFS on the pen drive for storing DHCP Clients?

The services/services/DHCP Server Setup/Use JFFS2 for Client Lease DB = (Not mounted)

I followed DDWRT USB storage support.doc from https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=308273
In the article it says:

"Before enabling storage for Client Lease DB into JFFS2 flash storage, JFFS2 support must be enabled. JFFS2 Support is located on the Administration / Management tab." However, the post says "Either you enable JFFS2 on the Administration/Management page and thus create a rewritable part of your NVRAM or use an USB stick as a drive (which is the recommended way).

Do not do both otherwise you can not write to JFFS.

To use USB storage and mount JFFS on your USB stick see the attached document.

There are builds which only let you write to your USB stick after you disabled the previously enabled JFFS2 when you erase nvram and put all your settings in manually, if you have to do that then get a more recent build.

Action taken and is this correct?
administration/management/JFFS2 Support = enable and DD-WRT reports Total / Free Size
100.66 MB / 98.17 MB

services/services/DHCP Server Setup/
Use JFFS2 for Client Lease DB = tick,
Use NVRAM for Client Lease DB = remains unticked so as not to use both as warned.

Now for storage services
I followed DDWRT USB storage support.doc from https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=308273

I now have 3 partitions that auto mounted
2.5GB FAT32 Labelled "File_Share" FAT32 for cross system copying if you pull the drive
2.5GB EXT2 Labelled "jffs" for autodetect on label by DD-WRT EXT4 do not use as more writes for journaling
2.5GB EXT Labelled "opt" for autodetect on label by DD-WRT
Code:
Disk Space /tmp/mnt/sda1
0%
12.0K / 2.5G

Disk Space /opt
0%
2.0K / 2.4G

Disk Space /jffs
0%
2.0K / 2.4G

--- /dev/sda
Block device, size 7.500 GiB (8053063680 bytes)
DOS/MBR partition map

Partition 1: 2.000 TiB (2199023255040 bytes, 4294967295 sectors from 1)
Type 0xEE (EFI GPT Protective)
GPT partition map, block size 512 bytes, 128 entries
Disk size 7.500 GiB (8053063680 bytes, 15728640 blocks of 512 bytes)
Disk GUID 40E6E841-9145-B603-9039-7A506491ED00

Partition 1: 2.499 GiB (2683305984 bytes, 5240832 blocks of 512 bytes from 2048)
Type Basic Data (GUID A2A0D0EB-E5B9-3344-87C0-68B6B72699C7)
Partition Name "Basic data partition"
Partition GUID 35630A00-9065-89DA-C92A-DB016AC61400
Windows NTLDR boot loader
FAT32 file system (hints score 5 of 5)
Volume size 2.494 GiB (2678046720 bytes, 653820 clusters of 4 KiB)

Partition 2: 2.500 GiB (2684354560 bytes, 5242880 blocks of 512 bytes from 5242880)
Type Basic Data (GUID A2A0D0EB-E5B9-3344-87C0-68B6B72699C7)
Partition Name "Basic data partition"
Partition GUID 81670A00-503E-31DB-C922-DB0102CF1400
Ext2 file system
Volume name "jffs"
UUID D17F3BDB-C922-DB01-503E-31DBC922DB01 (NCS)

--- /dev/sda1
Block device, size 2.499 GiB (2683305984 bytes)
Windows NTLDR boot loader
FAT32 file system (hints score 5 of 5)
Volume size 2.494 GiB (2678046720 bytes, 653820 clusters of 4 KiB)
/dev/sda1 mounted to /tmp/mnt/sda1

--- /dev/sda2
Block device, size 2.500 GiB (2684354560 bytes)
Ext2 file system
Volume name "jffs"
UUID D17F3BDB-C922-DB01-503E-31DBC922DB01 (NCS)
Volume size 2.500 GiB (2684354560 bytes, 2621440 blocks of 1 KiB)
/dev/sda2 mounted to /jffs

--- /dev/sda3
Block device, size 2.499 GiB (2683305984 bytes)
Ext2 file system
Volume name "opt"
UUID E6EFEF15-CA22-DB01-A02F-EC15CA22DB01 (DCE, v13)
Volume size 2.499 GiB (2683305984 bytes, 2620416 blocks of 1 KiB)
/dev/sda3 mounted to /opt

I enabled
ProFTPD
Samba with file sharing config

I can use Win10 File Explorer and WinSCP to access the router

Question 2: When looking at services/usb I get two jffs entries:

I am not sure if the answer lies in this article as I am not fully following it!
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=53368

Two JFFS mounts
Code:
Disk Info
Disk Space /jffs
0%
2.0K / 2.4G
Disk Space /tmp/mnt/sda1
0%
12.0K / 2.5G
Disk Space /opt
0%
3.0K / 2.4G
Disk Space /jffs
0%
2.0K / 2.4G

--- /dev/sda
Block device, size 7.500 GiB (8053063680 bytes)
DOS/MBR partition map
Partition 1: 2.000 TiB (2199023255040 bytes, 4294967295 sectors from 1)
Type 0xEE (EFI GPT Protective)
GPT partition map, block size 512 bytes, 128 entries
Disk size 7.500 GiB (8053063680 bytes, 15728640 blocks of 512 bytes)
Disk GUID 40E6E841-9145-B603-9039-7A506491ED00
Partition 1: 2.499 GiB (2683305984 bytes, 5240832 blocks of 512 bytes from 2048)
Type Basic Data (GUID A2A0D0EB-E5B9-3344-87C0-68B6B72699C7)
Partition Name "Basic data partition"
Partition GUID 35630A00-9065-89DA-C92A-DB016AC61400
Windows NTLDR boot loader
FAT32 file system (hints score 5 of 5)
Volume size 2.494 GiB (2678046720 bytes, 653820 clusters of 4 KiB)
Partition 2: 2.500 GiB (2684354560 bytes, 5242880 blocks of 512 bytes from 5242880)
Type Basic Data (GUID A2A0D0EB-E5B9-3344-87C0-68B6B72699C7)
Partition Name "Basic data partition"
Partition GUID 81670A00-503E-31DB-C922-DB0102CF1400
Ext2 file system
Volume name "jffs"
UUID D17F3BDB-C922-DB01-503E-31DBC922DB01 (NCS)
Volume size 2.500 GiB (2684354560 bytes, 2621440 blocks of 1 KiB)
Partition 3: 2.499 GiB (2683305984 bytes, 5240832 blocks of 512 bytes from 10485760)
Type Basic Data (GUID A2A0D0EB-E5B9-3344-87C0-68B6B72699C7)
Partition Name "Basic data partition"
Partition GUID A02FEC15-CA22-DB01-D017-F60A6591ED00
Ext2 file system
Volume name "opt"
UUID E6EFEF15-CA22-DB01-A02F-EC15CA22DB01 (DCE, v13)
Volume size 2.499 GiB (2683305984 bytes, 2620416 blocks of 1 KiB)
Partition 4: unused
/dev/sda not mounted Unsupported Filesystem
--- /dev/sda1
Block device, size 2.499 GiB (2683305984 bytes)
Windows NTLDR boot loader
FAT32 file system (hints score 5 of 5)
Volume size 2.494 GiB (2678046720 bytes, 653820 clusters of 4 KiB)
/dev/sda1 mounted to /tmp/mnt/sda1
--- /dev/sda2
Block device, size 2.500 GiB (2684354560 bytes)
Ext2 file system
Volume name "jffs"
UUID D17F3BDB-C922-DB01-503E-31DBC922DB01 (NCS)
Volume size 2.500 GiB (2684354560 bytes, 2621440 blocks of 1 KiB)
/dev/sda2 mounted to /jffs
--- /dev/sda3
Block device, size 2.499 GiB (2683305984 bytes)
Ext2 file system
Volume name "opt"
UUID E6EFEF15-CA22-DB01-A02F-EC15CA22DB01 (DCE, v13)
Volume size 2.499 GiB (2683305984 bytes, 2620416 blocks of 1 KiB)
/dev/sda3 mounted to /opt



DDWRT USB storage support.doc
 Description:
from https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=308273

Download
 Filename:  DDWRT USB storage support.doc
 Filesize:  509.5 KB
 Downloaded:  106 Time(s)

Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13879
Location: Netherlands

PostPosted: Sun Oct 20, 2024 15:46    Post subject: Reply with quote
Quote:
However, the post says "Either you enable JFFS2 on the Administration/Management page and thus create a rewritable part of your NVRAM or use an USB stick as a drive (which is the recommended way).


That really means do not enable JFFS2 and use an USB stick with JFFS together.

You can wear out your nvram so do not use JFFS2 if you can use an USB stick.

https://github.com/egc112/ddwrt/blob/main/DDWRT%20USB%20storage%20and%20NAS%20v3.pdf

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 7193
Location: Romerike, Norway

PostPosted: Sun Oct 20, 2024 17:08    Post subject: Reply with quote
Can you access any files at /jffs ?
bootit
DD-WRT Novice


Joined: 15 Oct 2024
Posts: 20

PostPosted: Mon Oct 21, 2024 4:32    Post subject: Can't see files in /JFFS Reply with quote
I browsed using SAMBA to \\DD-WRT\jffs which is the USB not the flash memory (nvram).
The directory is empty with a subdirectory \lost+found

How do I check the use of \jffs in NVRAM (/dev/mtdblock/4)?

BusyBox v1.37.0 (2024-10-15 05:06:40 +07) built-in shell (ash)

0;root@DD-WRT: ~root@DD-WRT:~# df | grep jffs
/dev/mtdblock/4 2538747 3 2407672 0% /jffs
/dev/sda2 2538747 3 2407672 0% /jffs
0;root@DD-WRT: ~root@DD-WRT:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 26112 26112 0 100% /
none 512 0 512 0% /dev
/dev/mtdblock/4 2538747 3 2407672 0% /jffs
/dev/sda1 2615280 12 2615268 0% /tmp/mnt/sda1
/dev/sda3 2537723 3 2406700 0% /opt
/dev/sda3 2537723 3 2406700 0% /tmp/proftpd/users/ftp/ftp
/dev/sda3 2537723 3 2406700 0% /tmp/proftpd/users/ftp/ftp
/dev/sda3 2537723 3 2406700 0% /tmp/proftpd/users/ftp/ftp
/dev/sda2 2538747 3 2407672 0% /jffs
/dev/sda3 2537723 3 2406700 0% /tmp/proftpd/users/ftp/ftp
0;root@DD-WRT: /devroot@DD-WRT:/dev# cd /dev/mtdblock
0;root@DD-WRT: /dev/mtdblockroot@DD-WRT:/dev/mtdblock# ls
0 1 2 3 4
0;root@DD-WRT: /dev/mtdblockroot@DD-WRT:/dev/mtdblock# cd /4
-sh: cd: can't cd to /4: No such file or directory

Router Name
DD-WRT
Router Model
Asus RT-AC5300
Firmware Version
DD-WRT v3.0-r58568 std (10/15/24)
Kernel Version
Linux 4.4.302-rt232-st56 #12481 SMP Tue Oct 15 05:05:13 +07 2024 armv7l
bootit
DD-WRT Novice


Joined: 15 Oct 2024
Posts: 20

PostPosted: Tue Oct 29, 2024 10:42    Post subject: Reply with quote
bootit wrote:
egc wrote:
Just connect WAN<>LAN and set the test router on another subnet that is all


I changed the subnet and the Internet broke on the router. I reset the router and erased the NVRAM and JFFS on USB used for DHCP. I began from scratch with the subnet and it is working.

JFFS on USB for DHCP seems problematic when you make any major changes. I seem to break the router with unbound. Now from a fresh reset I break it on a subnet change (unbound was never present). Then I break it by adding Entware. There is something odd about JFFS on USB for DHCP!

I think Alozaros comment on another related post sums it up ...
Once you erase the nvram do not load your old config, but rebuild settings manually...its a general rule to not load settings from different builds or settings that may contain crap...
"
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1308091#1308091


I am adding this method to erase NVRAM and JFFS on USB so newcomers dont break the router!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13879
Location: Netherlands

PostPosted: Tue Oct 29, 2024 11:23    Post subject: Reply with quote
👍
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 7391
Location: UK, London, just across the river..

PostPosted: Tue Oct 29, 2024 12:34    Post subject: Reply with quote
Client Lease DB into JFFS although it seems tempting this is a bad idea..and should be only used with caution, lots of understanding, in case of enormous long list of clients and only from trained/skilled administrators... otherwise people come back with tons of questions and it could be not always working as it should... Cool

Instead for adding static clients to the router DNSmasq Infrastructure>Additional Options box you can use this format--->

dhcp-host=xx:xx:xx:xx:xx:xx,MI6-Ops-PC,192.168.1.101,infinite

xx:xx:xx:xx:xx:xx is the client mac address you have to add, client names must not contain spaces/intervals or some extra/special symbols, infinite is the time factor you can replace it with any other time(in minutes format).. you can copy/paste those to there from txt file or PDF and save&apply after, that is how many of us are adding static clients... Razz
you can even add 2 mac addresses to one/same IP but those must not be connected at the same time...

_________________
Atheros
TP-Link WR1043NDv2 -DD-WRT 66272 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPNCli
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 -OpenWRT Kong 25.12
Netgear XR500 -DD-WRT 66325 GTW/SmDNS-Quic,AD-Blk,Forced DNS,AP&Net Isolation,x2VLAN,Vanilla
Netgear R7800 --DD-WRT r66345 Gateway/DNSCryptv2,AD-Block,Forced DNS,AP&Net Isolation,x4VLAN,IPset Firewall,Vanilla,VPN cli
Netgear R9000 --DD-WRT 66280 Gateway/SmDNS-Quic,AD-Block,AP Isolation,Firewall,Forced DNS,Vanilla
Dynalink DL-WRX36-DDWRT 66325
Broadcom
Netgear R7000 --DD-WRT 66272 GTW/DNScrypt-proxy2/AD-Block,IPset Firewall,Forced DNS,x4VLAN,VPN cli
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC 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 can attach files in this forum
You can download files in this forum