Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am newbie to this. I have got dd-wrt , installed and configured in my router.

dd-wrt version : DD-WRT v24-sp2 (08/07/10) router version : D-Link DIR 600

I am trying setup bandwidth usage monitoring script in it.

Is there any way , I can store details in router , without getting deleted on reboot ?

I mean is there some kind of persistent storage I can get ?


share|improve this question
As far as I remember, DD-WRT splits the flash into part for the read-only partition with the system that gets loaded into RAM and decompressed and then used and a small part used for settings storage that could be written to. You could try using that for as storage space. The problem comes up if you need to install an additional program to the router to do the monitoring because there will be little space left. When I had such a problem, in the end I had to move to OpenWRT which doesn't use read-only filesystem. – AndrejaKo Jan 20 '12 at 8:19

There should be nvram (i.e. non-volatile ram).

nvram show            # list all variables
nvram get name        # get variable
nvram set name=value  # set variable
nvram unset name      # delete variable
nvram commit          # save changes to flash
share|improve this answer

As Mika said: nvram is the name of the persistent storage. Unfortunately, it is not a file system. The file system of DD-WRT (at least the small ones) is a combination of squashfs and ramfs and is populated at boot time from values stored in nvram.

When you go to Administration->Commands, you can enter a script and save it as a Custom Script (bottom of the page). You can use this feature to implement several use cases, provided that they are all in this single script. I made something like this:

case "$1" in
    #here is code which turns off wlan after 30 mins of inactivity

    ifconfig $wlanIF up
    touch /tmp/wlan-online0

    echo "$0 {wificontrol|wifi[on]}"

Then, I run the script on command line:

/tmp/ wifion

And as a cron job (Administration->Management):

*/4 * * * * root /tmp/ wificontrol

I know, this is not a very nice solution, but it works. Tested on my v24-sp2 (rev 14896)

share|improve this answer

Usually there is some space you can use. For example read this answer: In my WAG200G I formated mtd2 or mtd3 for my purpose. But you need to be sure which flash block you can use otherwise you can turn your device to a brick.

share|improve this answer

There is a small space that you can use. I don't know exactly because I didn't look up your router's specs. When you set a cron job you are writing to the filesystem are you not? I would SSH in and check out the /var directory. If you have a usb port you could place your log files there. Just be sure in your script to delete the logs once they get a certain size or your router will die.

This might interest you or this forum thread.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .