OpenWrt Forum Archive

Topic: openwrt on an external USB stick with jffs2 filesystem - possible?

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm just experimenting with an ASUS wl-500g Deluxe router.

It can use an external USB stick, and according to UsbStorageHowto on http://wiki.openwrt.org/UsbStorageHowto - it is possible to boot from the USB stick.

Unfortunately, "4.2. How do I boot from the USB device" describes how to boot from an ext3-formatted USB device.

As originally openwrt uses jffs2 as its primary image, I thought it would be best to use jffs2 on an external USB device (to gain some space).

How can I format an external USB device with jffs2 filesystem (and use it as root as a next step)?

I tried playing with mkfs.jffs2 on my PC, but I'm not sure how to create a filesystem and put it for example on a 256 MB USB-stick.

Any ideas?

JFFS2 for Journaling Flash Filesystem 2, as its name is self-explanatory, is for flash memory. So please use an appropriate filesystem

RItalMan wrote:

JFFS2 for Journaling Flash Filesystem 2, as its name is self-explanatory, is for flash memory. So please use an appropriate filesystem

In that case, I suppose this trick might work:

1) format USB-stick with some (ext2, ext3, fat?) filesystem,
2) create a jffs2 image on your PC, the size of which would match the size of the USB-stick
3) put the USB stick to the router, and mount the image

In that case the "init" script described on UsbStorageHowto would have to be modified a bit to mount such an image first.

Is my thinking correct?

Hmm, I guess that the thinking is correct, but it would be impossible to do so on these tiny routers.

It appears that to mount a jffs2 image that is 256 MB big you would need 256 MBs of RAM...

Hi there,
I use OpenWGT for my WGT634U ^^,
and this thingy can actually boot from the usb stick, which is kinda cool!
^.^
Ok, I have formated my 128Mb Stick with ext3,
which works perfectly.

How they do that, I dunno, check their source?

Nico

Yeah I know, booting form a ext3-formatted USB stick is easy, just read the documentation smile

What I want to do is to squeeze some more data from a USB-stick and to use a compressed filesystem.

Unfortunately, there is only one filesystem taht supports compression in Linux: jffs2.

There is also "compFUSEd" - http://parallel.vub.ac.be/~johan/compFUSEd/ - with that you can use compression on any filesystem.

It uses FUSE, and there is a fuse module for openwrt - so I wonder if compFUSEd could be built for openwrt?

The discussion might have continued from here.