I’ve now started using the following process whenever I upgrade the software on my AX3 and AX2:-
Export the script file of the current configuration
Download and install the upgraded software, reboot
Upgrade Routerboard (not reboot)
Reset to default configuration, keeping users, and run the script file during reboot
Given the many recommendations on this forum to netinstall in order to recover from any problems and inconsistencies between revisions of the software, I am wondering whether a netinstall of upgraded software would serve better than a reset of the default configuration after upgrade.
What benefits, if any, would netinstall provide over a simple reset to default?
Netinstall thoroughly removes all traces of old configuration (it seems that sometimes there are some invisible remnants which can cause unstable operation). Which includes possible malicious code in case of sophisticated hacker attack.
So when thinking about making a more radical change (currently that might be replacement of wireless driver with wifi-qcom driver, in the past this might be enabling IPv6), it’s benefitial to perform netinstall without keeping configuration (which essentially means going for default setup), reset to default config and build customized config based on defaults (contrary to what some tutorials in the wild indicate, it makes a solid foundation and most of times it’s not wise to ditch it).
Unfortunately netinstalling means loosing users and certificates … which makes it a bit unpopular.
We all don’t know how ROS looks behind the curtains. Several users reported being able to reclaim free disk space by using netinstall - what a reset configuration did not do. So my assumption is, ROS may leave behind some orphan files (temporary ones or abandoned configs, revisions, etc.) on upgrades. We can’t pull the curtains aside and access the filesystem directly and do the cleanup. There is also no cleanup command built into ROS. So the only option left is: netinstall. Formats disk and all garbage gone for sure.
@mkx@infabo
With respect, both of you appear to agree that confidence in the effectiveness of Netinstall is based upon empirical reports, and that nobody outside Mikrotik knows definitively the details of how it works.
My take on this is that both processes, Netinstall and “Reset to Default after Upgrade”, use exactly the same *.npk files in order to write new system and default configuration files to the HDD. In effect, Netinstall writes new files to the HDD and resets the system to default. The Upgrade process does exactly the same except the “reset to default” must be invoked manually.
It is unknown, in my view, whether either process actually deletes orphaned configuration files. The difference between the processes is that Netinstall provides a means of low-level access to the HDD where Upgrade cannot in some circumstances (e.g a change of user permissions or credentials by an outside actor). I am assuming that a reset to default (with new overwritten default configuration files) will deprecate any scripts installed malevolently.
Of course, I could be very wrong in my assumptions.
I think what netinstall does which reset won’t, is that it clears up some internal DB where RouterOs stores stuffs.
During an initial migration of RB4011 from Ros6 to Ros7 (years ago), there was some issue even though everything was apparently still working.
From time to time during one v7 update, RB4011 failed to reboot properly, but I simply initiated a reboot on my own.
Things were all ok except the tool/graph about HDD was failing with some I/O error.
Everything else was fully functioning.
I didn’t bother to do much as I was using RB4011 as main router.
Only recently I decided to netinstall RB4011 with latest v7.x and such issue with graph is now solved.
So something internally was broken and couldn’t be recovered until I ran netinstall.
Actually no at the time of seeing this “graph” issue.
The timeline of what happened to me was:
Initiated the migration from v6 to v7 at an early stage (Mikrotik did improve after some initial time)
got RB4011 mostly working on v7 except some routing item disappeared and few others
went back to v6 via backup
re-did migration to v7 which went fine at that point
everything was still working including graph
at some point in v7 during an update there was a rebooting issue and since then I had that graph issue
I didn’t try to reset the config at that point and didn’t want to initiate netinstall either.
All subsequent updates went always fine, even though I was still carrying that graph issue.
Which I decided to fix running netinstall and then I reapplied the old config (without importing it, but copy/paste block by block as needed)
No, they do not do the same. Upgrade doesn’t format flash space, it only replaces files on flash with ones in npk archive. It probably runs some post-install script which might remove some other files. But it may miss some “garbage”. As to what “reset to default” actually does, we’re both guessing. It may well be that it thoroughly wipes all the config (including possible config which is not visible through UIs, there are indications that there is some sometimes) and it may not. Netinstall, which formats flash space, definitely wipes everything (except for license and serial number).
It’s up to you, you can go with “reset to config” any time you want. But I’ll choose netinstall in such cases because I trust it does the job 100%. You asked for forum members’ opinions, you got opinions from @infabo and myself. I can’t understand why are you arguing these opinions the way you are doing it (starting with “With respect” indicates disagreement … but it’s opinion, it’s not stating facts).
In my opinion Netinstall does not just format the devices flash memory, it also re-partions the flash memory. I have no deeper knowledge of how ROS flash layout looks like but like any other OS based on Linux you have one or several partitions. There may be some for root, then for “etc” and so on. I highly assume, that ROS stores “user config” on a separate partition. When you use “/system/reset-configuration” it maybe just format this config-partition. But “garbage” on other “partitions” may still live on. so here is the difference maybe.
In the case one device ends up as a brick after an upgrade (or whatever reason), Netinstall is able to restore such devices. Just as long the bootloader is working (routerboot), Netinstall can access the device, “write flash layout”, format flash and then install ROS.
Situations where even Netinstall can’t help:
hardware defects
corrupted/broken bootloader (e.g. you pull power-plug during rooterboot firmware-upgrade)
Nope, partitions are not part of netinstall operations. If they exist, then netinstall will keep partitions and only reinstall the active partition. But AFAIK it won’t offer you to create partitions, that’s only possible from within running ROS. The rest is indeed distributed in different folders inside same partition and yes, probably different ways of changing ROS version do different things to different parts of file system.
Consider the difference by performing these two procedures on a “normal windows machine” after plugging in an USB stick:
right click on USB drive letter/icon inside file explorer and select “format”
take a list of file names and delete one by one
If the list of file names is complete, then you may reach the same result (USB stick with no files on it). If the list is not complete, then there may remain a few (visible) files on it, using up some space.
If there are hidden files on USB stick (some file systems, such as ext4 or NTFS, support notion of ‘hidden’ files), then the USB stick will appear to be empty, but not all space will be available.
But apparently users who installed OpenWRT were still able to switch back to ROS again. As far as I am aware OpenWRT always uses their own flash layout and does not re-use something from the vendor. So I would assume that Netinstall does “flash layouting” too. But I may be wrong.
I’m sorry that you thought that I was being argumentative. I had hoped to express respect for your opinion (hence “with respect”), whilst going on to explore in further detail my assumptions without believing that I had a monopoly on the facts.
In that context, you have stated with some authority that “Netinstall, which formats flash space, definitely wipes everything (except for license and serial number)”. Please may I ask how you know this because it’s not mentioned in any official documentation that I have found.
Again, I am not trying to be disrespectful - I’m seeking further knowledge for myself.
I don’t have a reference to back my claims. They are based on (rare) discussions where MT staffers did drop a bit of their wisdom. So you may choose to not believe in what I wrote and I won’t mind at all.
As far as I know (I’m mot OpenWRT user, but I did read some docs about installing OpenWRT on MT hardware a few years ago), there are two ways of running OpenWRT on MT hardware:
boot it from TFTP … this way nothing is actually written on device’s flash and reverting to ROS is as easy as rebooting device from flash
install it on flash. AFAIK in this case it’s recomended to backup certain parts of flash before installing OpenWRT. Reverting to ROS then possibly involves restoring that part of flash, followed by netinstall. The part of flash, which is backed up, contains ROS license. It seems that restoring part of flash part is not always needed so it serms that OpenWRT installation does try to avoid overwriting the vital part of flash.
So yes, there definitely is a way back to ROS, but not necessarily a trivial one.
I’m not entirely sure about what netinstall does to flash. It does format it. Yes, possibly it partitions it as well and possibly only if it can’t find existing active ROS partition (like after getting back from OpenWRT). But it definitely doesn’t touch licensing information, written on certain part of flash.