DD-WRT:Journalling Flash File System/zh-cn

说明
日志型闪存文件系统 (JFFS/JFFS2) 是DD-WRT-enabled 设备中一块可反复写的区域.


 * 位于 /jffs.

内容存储：
 * 在DD-WRT设备的主的闪光灯直接在设备上（“/ JFFS”），或
 * mount --bind /storagelocation /jffs. 哪里 storagelocation 是
 * 离板补充闪光， SD/MMC mod, (/mmc/jffs).
 * 网络区域存储[NAS]或服务器. (//servername/sharename)
 * JFFS报告它自己的自由空间，共享或SD卡上的可用空间，在Web界面

种方案的实施例和数据:
 * 自定义配置文件
 * NoCat飞溅页和配置
 * ipkg (需要 JFFS. 看 ipkg.)
 * Web站点托管
 * 许多其他的东西.
 * 一定应用程序/ JFFS依赖的应用程序的JFFS，必须启用.

= 启用JFFS：创建 /jffs挂载点 =

前提条件
为使的JFFS你将需要一台路由器至少有4MB闪存，支持的JFFS，如迷你构建，这是最小的建立，以支持JFFS的JFFS分区，从而留下了大部分空间，你的构建必须留出至少324KB的组建，闪光的JFFS文件系统的结构无法使用的空间. V24 SP2之前的标准建立不再留有足够的空间为4MB设备上的JFFS使用Mini生成或Eko的专业基础之一.

''今天非常旧版本的一些Linksys路由器（不再生产多年）载有8MB的闪存和32MB的RAM，许多DD-WRT功能的设备包含4MB的快闪记忆体，从某些制造商的几个型号中含有较多的闪光灯（的La Fonera，华硕WL-500GP), 一些含有较少（2MB）. 看 支持的设备.

需要注意的是DD-WRT v24sp1的VPN构建JFFS中移除的功能，大概是由于JFFS和带宽监控，Brainslayer之间的冲突，. 看 此主题 了解更多信息.

在v24sp2感兴趣的用户可以选择：


 * 1) 使用建立VPN，MINI和MEGA以外仍然有JFFS
 * 2) 使用的是较旧的版本的DD-WRT
 * 3) 使用自定义生成，无论是自制或 dd-wrt.v24-10086_NEWD_openvpn_jffs_small.bin, 这是描述的 这里 失踪的“SNMP，所有的语言，一些GUI的风格和更多. ”.

注意的是，华硕WL500W

截至2009年10月7日，考虑以下事项，否则可能导致你的路由器砖：

Brainslayers大型FLASH的大小 - 7.33MB

Eko的大Flash容量 - 5.9MB

现在，错误只发生时，JFFS2启用路由器重新启动，所以你是安全的，如果你不使JFFS2.

全部可用的JFFS2大小为BS的构建是640KB淹没了内核，并导致了恐慌. 即使是使用命令mount存储设备 -o bind /mnt/jffs /jffs 仍然会导致内核崩溃.

Eko的JFFS2分区大小为1640KB+，允许更多的空间.

我测试了这个BS12996,12874和12533​​版本，并，部分砖砌我的路由器几次. （一个简单的电源断开30秒将允许它恢复）

但是Eko的构建完美的作品，并提供相同的功能，除了连接警告BS的.

有一件事我仍然不确定的是，为什么这个特定型号的华硕路由器是这个错误，但在平均时间，我建议使用Eko的大建设，直到dev的可以工作了..

闪存磨损：警告
请注意，不要经常变化的文件（即经常变化的日志文件）存储在Flash，因为这可能会导致闪存磨损，随着时间的推移.
 * 日志闪存文件系统是专门设计，以尽量减少频繁的覆盖.
 * 文件，这是读了很多次，但很少主闪光.
 * 使用提供的空间 SD/MMC mod 可更换的二级闪存存储的地方穿.

方向（正常）用户使用Web的GUI界面
''The steps to enable JFFS through the router web page are very specific. To avoid having to reset and reprogram your router, it's smart to make a backup here of your settings. If you follow these steps exactly, it should not lock up.''
 * 1) On the router web page click on Administration.
 * 2) Scroll down until you see JFFS2 Support section.
 * 3) Click Enable JFFS.
 * 4) Click Save.
 * 5) Wait couple seconds, then click Apply.
 * 6) Wait again. Go back to the Enable JFFS section, and enable Clean JFFS.
 * 7) Do not click "Save". Click Apply instead.  The router formats the available space.
 * 8) Wait till you get the web-GUI back, then disable "Clean JFFS" again.
 * 9) Click "Save".
 * 10) It may be wise to Reboot the router, just to make sure

（奇特的）是Linux的老手方向：CLI
从CLI输入以下命令： nvram set jffs_mounted=1 nvram set enable_jffs2=1 nvram set sys_enable_jffs2=1 nvram set clean_jffs2=1 nvram set sys_clean_jffs2=1 nvram commit reboot

注意：设备可能会重新启动/挂清洗后，可能需要很长的耐心等待.

警告

用户评论：我尝试了以前的命令下La Fonera路由器固件的V24 RC4和损坏了我的所有设置. 我不得不收回我单位的La Fonera闪烁页面上的程序. 我不知道如果这是一个错误或不适合的La Fonera这些命令. 请尝试使用上面的Web界面. 它为我工作.

要卸载 JFFS：

nvram set sys_enable_jffs2=0 nvram set sys_clean_jffs2=0 nvram set jffs_mounted=0 nvram commit reboot

之后，您可以删除这些变量 "nvram unset ".

添加一个1GB的闪存卡

 * Add the SD/MMC mod
 * up to (at least) 1GB storage using common swappable SD memory cards (built-in support with DD-WRT v2.4 and later).
 * create the folder /mmc/jffs
 * mkdir /mmc/jffs
 * Use the Mount Bind command to point /jffs to the storage card:
 * mount --bind /mmc/jffs /jffs
 * with v24 enable JFFS2 support (tab: Administration -> tab: Management -> section: JFFS2 Support)
 * or command nvram set sys_enable_jffs2=1
 * To use ipkg also create folder /jffs/tmp/ipkg
 * mkdir /jffs/tmp
 * mkdir /jffs/tmp/ipkg


 * For Windows: WinSCP can be used to transfer files to and from the router, eliminating the need to pull the card out and put it in a card reader on a PC.
 * For Linux, Mac OS X: Other SCP transfer applications exist.
 * Removed cards can be accessed natively in Linux or OS X, or on Windows with the Ext2FS driver ( or ).
 * On older firmware (v2.3), the limited JFFS space can be used to hold the drivers to load support for the SD card.

添加USB存储

 * Routers with USB storage like Linksys WRTSL54GS 1.0 or Asus WL-500g Premium 1.0 can have firmware with built-in USB support and then /jffs mounted on the USB device. To enable USB on these devices see: USB storage
 * V24 and later firmware: USB support is available within Mega and some Mini builds.


 * Using V24SP1 Mega on an Asus WL-500W with external USB HDD:


 * To mount the USB drive, and enable /jffs

mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt mkdir /mnt/jffs mount /mnt/jffs /jffs


 * Also enable JFFS2 support in either web-GUI (tab: Administration -> tab: Management -> section: JFFS2 Support)
 * or with the command

nvram set sys_enable_jffs2=1 mkdir /jffs/tmp mkdir /jffs/tmp/ipkg
 * To use ipkg also create folder /jffs/tmp/ipkg

CIFS（客户端桑巴）：存储“/ JFFS”内容远程
One option is to create a share on the network and mount it on the router at /jffs using CIFS. Exact steps at CIFS

Overview: nvram set sys_enable_jffs2=1
 * Enable JFFS in the web-GUI or put the following command in a Script or Startup Command.
 * Create a share on a CIFS-capable server called jffs.
 * Standard Microsoft Windows Shared Folder
 * Other operating systems may refer to SMB or Samba
 * In the Web GUI mount the CIFS share at /jffs.
 * Folder /jffs appears locally, while
 * Content actually saved remotely, on
 * NAS (Network Attached Storage)
 * Server (PC or some type of file server)


 * To use ipkg also create folder /jffs/tmp/ipkg
 * mkdir /jffs/tmp
 * mkdir /jffs/tmp/ipkg

Costs:
 * ! Setting up a NAS or Server only for router maybe not economical.
 * Equipment Costs: Requires existing NAS or PC Server
 * Electricity Costs: if entire Server is only serving router
 * Availability Demands: CIFS share must be available
 * 24/7, or whenever the DD-WRT Device is on, and
 * Storing JFFS Share on quality equipment is required (i.e. Raid, Power Backup)
 * ! Remote storage down means /jffs down, could mean DD-WRT Device down (increases the weak points).
 * Security Limitations: CIFS is limited to Microsoft's SMB protocol, offering up to only 128-bit security.
 * Poor Microsoft Protocol Security is not a problem if the LAN is physically and electronically protected from outside or inside intrusion (i.e. Guards, Guns, Locks, Dogs, Mines, Cameras, Firewalls)
 * LAN Connection Required: NAS cannot be wirelessly attached to DD-WRT Device.
 * Hassle: Using Microsoft Windows as the jffs Server
 * ! Symbolic links in /jffs may not work.
 * ! Rename (mv) commands on the /jffs mount may not work.

'''Most people only own an (inexpensive) Windows PC. A common Desktop PC does not a 24/7 Server make.'''

The following non-updated (as of 20080520) examples may be out of date:
 * CIFS was broken on many builds this update author tried. Although other people have reported it working - It may be a limitation of BusyBox CIFS when using NTLMv2 and 128-bit encryption.
 * (Mostly) only structural and spelling mistakes were corrected below (20080522)

使用启动脚本：例1

 * 1) Read how to use Startup Scripts. Then place the following into your startup script to mount the JFFS partition:

umount /jffs #unmounts existing /jffs if existing mount.cifs ///jffs /jffs -o username= ,password= nvram set sys_enable_jffs2=1 # fake-enable JFFS. Enable but do not commit. Makes ipkg think jffs2 is enabled.

NOTE: Username is Guest when hosted on Windows XP & 'Simple File Sharing' is enabled - This is the default on Windows XP Home.

使用启动脚本：实例2
This method uses 2 scripts: The first will be started from /tmp/smbshare & mount the samba share under /jffs and start the other script. The second will be started from /jffs and unmount /tmp/sambashare.

Instructions:


 * 1) Enable CIFS (see also Jffs sharing in a Linux server).
 * 2) Create a script called "startup.smb.sh" on the share:

SMBSHARE=`nvram get samba_share` SMBUSER=`nvram get samba_user` SMBPASS=`nvram get samba_password` JFFS_SCRIPT=startup.jffs.sh export SMBLOG=/tmp/smblog echo "" > $SMBLOG cd / echo "umounting /jffs if necessary..." >> $SMBLOG umount /jffs >> $SMBLOG 2>&1 echo "mounting $SMBSHARE at /jffs..." >> $SMBLOG mount.cifs $SMBSHARE /jffs -o username=$SMBUSER,password=$SMBPASS >> $SMBLOG 2>&1 /jffs/$JFFS_SCRIPT & >> $SMBLOG 2>&1 4. create a script called "startup.jffs.sh" on the share: sleep 1 umount /tmp/smbshare nvram set sys_enable_jffs2=1 5. in the webinterface, enable CIFS with appropriate share/user/pass settings from step 2. 6. Apply Changes 7. reboot Now you should have the share configured in the web interface mounted at /jffs and should also be able to run 'ipkg' !
 * 1) !/bin/sh
 * 1) smb settings: same as the settings in the webgui
 * 2) change these to mount a different share than the current at /jffs
 * 1) script to start in /jffs once we're done mounting
 * 1) where to log what is happening
 * 1) ok, here we go... ;) #######
 * 1) make sure JFFS is unmounted.
 * 1) mount our smbshare at /jffs
 * 1) hand over startup to the JFFS part
 * 1) !/bin/sh
 * 1) wait a sec, just to be sure the smb startup script has quit
 * 1) unmount the smbshare, its identical to /jffs now anyway :)
 * 1) to enable ipkg, we fake JFFS enabled.
 * 2) since theres no commit, this wont actually create a /jffs at Startup.
 * 1) ready to do specific stuff, like starting services
 * 2) or other commands from /jffs
 * Enter "startup.smb.sh" as the script


 * NOTE: If you are a Linux newbie, and you have problems with file permissions, look at this


 * Script files must be saved in UNIX format, not DOS. Windows editors that can do this are UltraEdit. EditPadPro and Crimson Editor, are free.
 * WinSCP can be used to easily change the execute flags on the scripts.

使用启动脚本：例3
This method requires 2 shares available for DD-WRT, but allows you to have 2 different areas of storage for the router. Some might find it useful. It is an amalgamation of the previous 2 methods.

Things you need:


 * 2 writeable shares on an NAS or Server.

Procedure:

1. Enable CIFS

2. Create a shell script in the network share, as follows:

nvram set sys_enable_jffs2=1 # fake-enable JFFS umount /jffs # unmount /jffs if it exists mount.cifs /// /jffs -o username= ,password=
 * 1) !/bin/sh

3. Enter the name of the script in the CIFS-Samba startup script box in the Web Interface. 4. Apply changes. 5. Reboot

As an example network setup:


 * /tmp/smbshare located in a shared folder on the NAS called ddwrt, which contains scripts (including startup.sh containing the above commands), yet to be installed packages and other static data
 * /jffs located in a shared folder called jffs, which contains program data for installed packages

测试 ipkg
Log in to the CLI (via Telnet or SSH) and enter the following commands: cd /jffs mkdir -p /jffs/tmp/ipkg ipkg update ipkg list It is recommended that you reboot the router after running the above commands.

de:DD-WRT:Journalling Flash File System en:DD-WRT:Journalling Flash File System es:DD-WRT:Journalling Flash File System fr:DD-WRT:Journalling Flash File System it:DD-WRT:Journalling Flash File System pl:DD-WRT:Journalling Flash File System pt:DD-WRT:Journalling Flash File System ru:DD-WRT:Journalling Flash File System se:DD-WRT:Journalling Flash File System th:DD-WRT:Journalling Flash File System

zh-tw:DD-WRT:Journalling Flash File System