ColinTaylor
Part of the Furniture
Don't sort it. You'll see why if you examine the output.nvram show 2>/dev/null | sort > dir/nvram.txt
Don't sort it. You'll see why if you examine the output.nvram show 2>/dev/null | sort > dir/nvram.txt
Oh really? Never needed to "restore" it, so....Don't sort it. You'll see why if you examine the output.
You are certainly braver than me!I still have the original nvram-save.sh script. While it does save the nvram and jffs fine I haven't tried to restore yet (hnd).
Have I just volunteered to be a Guinea pig?
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.02.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
The backupmon.cfg file just contains settings that BACKUPMON uses. When you restore the jffs.tar file, you will restore everything under your /jffs directory structure... so yeah, I suppose so, as @ColinTaylor mentioned, that some values are stored there... not everything!Thanks for another quick update. Your the goat
Correct me if I'm wrong - when restoring then .cfg file, isn't nvram also restored?
Or maybe when restoring jffs folder?
Because on backup, inside jffs folder, there's a folder called "nvram" which have every nvram values divided by files.
I've being doing this for a long time. Only the backup command, not the import.I now understand what @maghuro is getting at... @ColinTaylor -- could you please give us your expert opinion on this?
If you use the command "nvram save nvbackup.cfg", and back this .cfg file up... could you then theoretically wipe your router completely, format it, reinitialize it, and restore back to your original point using this .cfg file to "nvram restore nvbackup.cfg", and restore the jffs + ext USB backups? Everything should be back in place as it was before you reset everything... I would think yes, right?
If that's the case, we may have a complete solution to restore a router from scratch!!I've being doing this for a long time. Only the backup command, not the import.
Usually I restore it directly from the "Advanced_SettingBackup_Content.asp" page, router web GUI. Restore it, then restore jffs (optionally USB ext also), and all done.
TheIf you use the command "nvram save nvbackup.cfg", and back this .cfg file up... could you then theoretically wipe your router completely, format it, reinitialize it, and restore back to your original point using this .cfg file to "nvram restore nvbackup.cfg", and restore the jffs + ext USB backups? Everything should be back in place as it was before you reset everything... I would think yes, right?
nvram save
file contains a complete set of nvram variables, including what you see in /jffs/data
on an HND router, but excluding the duplicate "stub" variables seen in nvram show
. The only officially supported way of updating nvram variables is through nvram restore
or nvram set
. As a jffs backup contains /jffs/data
I regard it as part of a matching set with the nvram save
file. While restoring /jffs/data
from a tar backup is usually OK it's not an officially supported method (AFAIK) and is potentially dangerous for the reasons I previously stated. It's also pointless if you've just done an nvram restore
as you're replacing one set of files with identical files. There's also nothing to say that Asus won't change the way it uses /jffs/data
in the future so you're on your own there.Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?Thenvram save
file contains a complete set of nvram variables, including what you see in/jffs/data
on an HND router, but excluding the duplicate "stub" variables seen innvram show
. The only officially supported way of updating nvram variables is throughnvram restore
ornvram set
. As a jffs backup contains/jffs/data
I regard it as part of a matching set with thenvram save
file. While restoring/jffs/data
from a tar backup is usually OK it's not an officially supported method (AFAIK) and is potentially dangerous for the reasons I previously stated. It's also pointless if you've just done annvram restore
as you're replacing one set of files with identical files. There's also nothing to say that Asus won't change the way it uses/jffs/data
in the future so you're on your own there.
But to answer your question directly, "would everything be back in place as it was before"? Yes it would. In fact this is how I backup and restore my router (using the GUI options). The problem, as I mentioned before, is if you do out-of-sync restores of the whole of /jffs.
Correct. But the main concern would not be the backup but how the restore was done.Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?
It depends on where you're starting from. It's a bit of a chicken and egg situation in any case. Personally I would use only the GUI options for restoring NVRAM (which forces an immediate reboot) and JFFS. I don't care much about my USB drive as there's nothing important on there but I would restore that last after temporarily disabling JFFS custom scripts and configs.So, the correct order of restoration would be:
1.) /jffs
2.) ext USB
3.) nvram.cfg restore
4.) reboot
That should guarantee a pretty solid restore, correct?
I'm glad I have an AC86U that I can format and blow away to test this out... Thanks again for your advice!It depends on where you're starting from. It's a bit of a chicken and egg situation in any case. Personally I would use only the GUI options for restoring NVRAM (which forces an immediate reboot) and JFFS. I don't care much about my USB drive as there's nothing important on there but I would restore that last after temporarily disabling JFFS custom scripts and configs.
Been doing that order for a long time, no issues.Thanks @ColinTaylor! Since all of these files (/jffs, ext USB and the nvram.cfg) would all be backed up simultaneously, chances would seem pretty low that there would be an out-of-sync condition, correct?
So, the correct order of restoration would be:
1.) /jffs
2.) ext USB
3.) nvram.cfg restore
4.) reboot
That should guarantee a pretty solid restore, correct?
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/BACKUPMON/master/backupmon-1.1.sh" -o "/jffs/scripts/backupmon.sh" && chmod 755 "/jffs/scripts/backupmon.sh"
I did think of that, but as it defaults to reboot unattended operations would see it as automatic anyway. I get the point though, there really shouldn't be an option.@Viktor Jaep FYI. The reboot immediately after restoring the nvram should be mandatory not optional.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!