What's new

User NVRAM Save/Restore Utility (R26.2)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Status
Not open for further replies.
You are in the right place :)

Haven't seen this one before. You mention 'changing the userid to admin'....did you copy the program files over where the admin username was changed to something else?

Please post the output of

ls -l /mnt/ASUS (those are small letter 'L')

so we can see the owner and group of the files.

Oh good and thanks for swift reply.

When I first embarked on getting the utility installed earlier this week my userid on the router was not the default (admin) so I went once around the install / backup loop with that userid; I got the errors same as posted, I believe. The Quick Start guide mentions the possibility of errors if the userid has been changed "which can be ignored", but these errors looked pretty hard to me, so I changed the userid to admin and repeated everything - the result seems to be the same with both userid :eek:

Here is the output:

admin@RT-AC66U:/tmp/home/root# ls -l /mnt/ASUS
-rwxrwxrwx 1 admin root 13359 Jun 16 00:19 QuickStart-linux.txt
-rwxrwxrwx 1 admin root 13629 Jun 16 00:19 QuickStart-win.txt
drwxrwxrwx 4 admin root 4096 Jul 15 20:56 jffs-20150715-0870
-rwxrwxrwx 1 admin root 3003 Jun 16 00:19 jffs-restore.sh
-rwxrwxrwx 1 admin root 44192 Jul 15 20:55 nvram-all-20150715-0870.txt
-rwxrwxrwx 1 admin root 3945 Jun 16 00:19 nvram-excp-merlin.sh
-rwxrwxrwx 1 admin root 17674 Jun 16 00:19 nvram-merlin.ini
-rwxrwxrwx 1 admin root 74432 Jul 15 20:56 nvram-restore-20150715-0870.sh
-rwxrwxrwx 1 admin root 2456 Jun 16 00:19 nvram-restore.sh
-rwxrwxrwx 1 admin root 1495 Jun 16 00:19 nvram-sample.ini
-rwxrwxrwx 1 admin root 12075 Jun 16 00:19 nvram-save.sh
-rwxrwxrwx 1 admin root 14017 Jul 15 20:56 nvram-usr-20150715-0870.txt
-rwxrwxrwx 1 admin root 142 Jul 15 20:56 nvram-util.log
 
the result seems to be the same with both userid :eek:

That looks right, owner is admin in group root. One more to check would be the parent directory for the mount points which should have the same admin/root info for ASUS.

ls -l /tmp/mnt

Have to ask....did you reboot the router after changing the username?
Do you have Samba sharing enabled? Did you change any of the user permissions on the Samba setup page?

Other than I'm at a loss....maybe some other linux expert has an idea?
 
That looks right, owner is admin in group root. One more to check would be the parent directory for the mount points which should have the same admin/root info for ASUS.

ls -l /tmp/mnt

Have to ask....did you reboot the router after changing the username?
Do you have Samba sharing enabled? Did you change any of the user permissions on the Samba setup page?

Other than I'm at a loss....maybe some other linux expert has an idea?

Please feel free to ask any good questions - I am no more than a dabbler in any of these arts so if there is a mistake to be made its entirely reasonable to think that I may have made it :oops:

Check parent directory:
admin@RT-AC66U:/tmp/home/root# ls -l /tmp/mnt
drwxrwxrwx 3 admin root 4096 Jul 15 20:56 ASUS

Did I reboot:
Not explicitly, just updated the page, waited for the timer and logged back in with new credentials as requested. Taking the hint, now rebooted and attempted to change permissions on the scripts again with the same result as before.
admin@RT-AC66U:/tmp/mnt/ASUS# chmod 755 ./*.sh
chmod: ./jffs-restore.sh: Operation not permitted
chmod: ./nvram-excp-merlin.sh: Operation not permitted
chmod: ./nvram-restore-20150715-0870.sh: Operation not permitted
chmod: ./nvram-restore.sh: Operation not permitted
chmod: ./nvram-save.sh: Operation not permitted

Samba sharing:
Not turned on and don't believe it ever has been.

If nothing else emerges maybe I will upgrade anyway and see if anything is different with a later firmware (currently Merlin 376.48_3) and let folks here know the result.

Thanks again for the help anyway.
Chris
 
You should be fine moving on....all the script permissions are actually correct.

It's just a mystery why you can't execute the chmod. One more question, what is the format of the memory stick (NTFS, ext3, FAT, etc). ? Most come formatted as FAT, I'm wondering if there is something there....I typically reformat them to NTFS for my use.
 
Yes, I thought so, but I am concerned about the errors on the backup files; is there a way to test the restore scripts ability to use them?

The stick is FAT32; if it would make sense, I am OK to format to NTFS and try again.
 
I doubt that chmod works on FAT32, which has no concept of user permissions or ownership.
 
I doubt that chmod works on FAT32, which has no concept of user permissions or ownership.

Of course you are right. I realised how dumb I was being a couple of hours after writing "FAT32". Thanks to you and john9527 for helping me find what was right in front of me.
 
Will this util work with a netgear r7000 running merlin fw? n66u > r7000?

I would say it would be stretching it to think it would.

But by saving it from the RT-N66U you will have a record of settings that you could copy and paste to the new router.
 
Will this util work with a netgear r7000 running merlin fw? n66u > r7000?
Hmmm....interesting question. I think most of XVortex's changes were in dealing with differences in the CFE/bootloader and removing things that would be a license violation.

So...since I don't save things related to the bootloader, and if you run in migrate mode which won't restore anything that doesn't have already have a default value set....it might work.

Maybe @XVortex can comment on other changes he may have made to the meaning/definiton of the nvram vars.
 
I gave it a go and it seems to have worked at first quick glance, no errors reported, vpn settings, ip, dhcp look ok. l'll swap the routers out tomorrow and do some testing, thanks!
 
Thanks john9527.

Your utility/scripts came in very handy today when I upgraded from Merlin's 54 to 55.

Everything went well and it saved quite a lot of time.

The hesitation and frustrations in upgrading firmwares would be
negligible with your helpful utility/tool.

Just out of curiosity, I just wanted to check whether the USB HealthScanner option available in the External USB Disk Status page is stored in the nvram?

For example I have a scheduled health scan
Frequency Week Time
Weekly Sun 12

Disk scan has been scheduled : 12:00 on Sunday Weekly
All disk activity will stop while scanning is in progress.

The above values are lost after a reboot or firmware upgrade or
usb disk mount/unmount.
 
John9527,
I just wanted to say thank you for your script. I heard of it a while back (asking for a mass DHCP entry feature) but never got around to test it.
Today, I finally took the plunge and tried a factory reset with a backup/restore from your script.
The instructions contained in the ZIP file are very easy to follow and everything went smoothly!

So thank you very much for your script, as it makes having to do a factory reset a very easy process!
B.
 
Thanks john9527.

Your utility/scripts came in very handy today when I upgraded from Merlin's 54 to 55.

Everything went well and it saved quite a lot of time.

The hesitation and frustrations in upgrading firmwares would be
negligible with your helpful utility/tool.

Just out of curiosity, I just wanted to check whether the USB HealthScanner option available in the External USB Disk Status page is stored in the nvram?

For example I have a scheduled health scan
Frequency Week Time
Weekly Sun 12

Disk scan has been scheduled : 12:00 on Sunday Weekly
All disk activity will stop while scanning is in progress.

The above values are lost after a reboot or firmware upgrade or
usb disk mount/unmount.
Hmm....I didn't have the Disk Utility options as part of the save, I'll add them in the next release. But, I'm more interested in them being lost after a reboot. When I tested on my fork code, I found that there was an ASUS bug in indexing for the USB id's, such that the schedule was being saved incorrectly and made it look like the settings were lost. I wrote a fix for the next fork release for that.

As far as @RMerlin latest code, the indexing function was changed from the fork, so I'm not sure if it has the same bug or not.
 
Next release has been posted....thanks to everyone for their feedback!

LATEST RELEASE: Release 20
3-August-2015
nvram-save-r20.zip
Download http://1drv.ms/16pENHc
===============================

Version 20 (3-August-2015)

Program Changes
  • All scripts can now be run from other than the current working directory
  • Ensure CR are stripped from custom strings
  • Update Merlin/Fork unique vars in exception processing
INI file Changes
  • Add missing wireless Protected Management Frame var
  • Add missing mode Settings vars (may be redundant, but added for safety)
  • Add missing Disk Utility vars
  • Add support for AC3200 third radio
  • Add support for some future firmware features :) - thanks to RMerlin
  • Update Merlin/Fork unique vars

Full Changelog history is available in the download directory
 
Next release has been posted....thanks to everyone for their feedback!

LATEST RELEASE: Release 20
3-August-2015
nvram-save-r20.zip
Download http://1drv.ms/16pENHc
===============================

Version 20 (3-August-2015)

Program Changes
  • All scripts can now be run from other than the current working directory
  • Ensure CR are stripped from custom strings
  • Update Merlin/Fork unique vars in exception processing
INI file Changes
  • Add missing wireless Protected Management Frame var
  • Add missing mode Settings vars (may be redundant, but added for safety)
  • Add missing Disk Utility vars
  • Add support for AC3200 third radio
  • Add support for some future firmware features :) - thanks to RMerlin
  • Update Merlin/Fork unique vars

Full Changelog history is available in the download directory


Thanks john9527

A quick question, how do you guys upload the new version to USB? not familar with SSH command, it is so annoying unplug and plug my USB when a new version comes out
 
Thanks john9527
A quick question, how do you guys upload the new version to USB? not familar with SSH command, it is so annoying unplug and plug my USB when a new version comes out
Hi,

I use the famous "copy/paste secrete way" to update to a new version... :rolleyes:

If you share your USB drive via Samba, you can simply copy the new version into your NVRAM save folder and have fun (via Telnet or SSH to execute it). :D

With kind regards
Joe :cool:
 
Hi,

I use the famous "copy/paste secrete way" to update to a new version... :rolleyes:

If you share your USB drive via Samba, you can simply copy the new version into your NVRAM save folder and have fun (via Telnet or SSH to execute it). :D

With kind regards
Joe :cool:

I can only see my USB root folder by enabling "Allow guest login" which i dont really want.
Is there any other way?
 
I'm not sure if anyone wants a daily/weekly/etc backup mechanism but this is what I use.

I add the script to /jffs/scripts/init-start (it adds a cru job after boot but before my sda1 drive is mounted so it doesn't backup things on every boot but sticks to the schedule defined). It can also be run adhoc if you need to because when you try to run it, the sda1 mount point will exist. :)


Code:
xxxx@rt-ac68u:/jffs/scripts# cat init-start
#!/bin/sh
/jffs/scripts/systembackup.sh
Code:
xxxx@rt-ac68u:/jffs/scripts#  cat /jffs/scripts/systembackup.sh
#!/bin/sh

UTIL=nvram-util
BLOC=/mnt/sda1/$UTIL
BKUP=$BLOC/backup
RETENTION=35

CRUNAME=$UTIL
cru l | grep $CRUNAME >/dev/null || cru a $CRUNAME "0 6 * * * $0 $*"

#exit if directory doesn't exist or not mounted.
[[ -d "$BLOC" ]] || exit 1
[[ -d "$BKUP" ]] && rm -rf $BKUP
[[ -d "$BKUP" ]] || mkdir $BKUP
cd "$BLOC"

/mnt/sda1/nvram-util/nvram-save.sh -clk -b
mv "$BKUP" "$BKUP.$(date +"%F_%T")"

#careful here.  You do not want this running if ntp hasn't synced.
#nothing older than 190 days incase ntp didn't sync yet.
find $BLOC -name "backup.20*" -mtime +$RETENTION -mtime -180 -exec rm -rf {} \;


exit 0
 
Last edited:
I enable the ftp service in servers centre to upload the files, make sure wan and anon access are disabled.

Also v20 has an issue but I already reported to john so hopefully he fixes it quickly, its only a minor one.
 
Status
Not open for further replies.

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top