System reset vs Data protection

MihailK wrote:

If I find a solution, I’ll report.

I did.

Unfortunately, I’d never used Linux before (although I’m not a novice in programming), so I killed about a week looking for a path. But I found.

There are different ways to reach the goal. The several days I wasted were spent in trying to tune various Linux versions to work with Buildroot, being used in the firmware source code. The way was vain and absolutely needless. The quickest one is ssh access to MPW and direct editing of relevant files.

As I had installed Linux on an old laptop while seeking a solution, I was doing all the further actions from Linux. Given the Linux core of MPW, it seemed to be the most reasonable, safe and comfortable approach.

If you know nothing about operating systems, programming, scripts and so on, avoid doing things given under the spoiler below. I am not liable for any consequences for you. I am writing about something working with my device and I cannot guarantee it will work with yours.

By the way, my firmware version is 1.03.13.

So, if you know what you are doing, I shouldn’t explain how to get an access through ssh. When you have it got, you see all the file system of MPW.

 

Pay your attention to the following files:

  1. /sbin/Button_factoryRestore.sh — a script executed when both buttons are being held pressed for 10 seconds.
  2. /sbin/factoryRestore.sh — a script called from the previous script. Rewrites system files from an archive containing defaults and unlocks the USB port of the disk (locked or not). Take into account that this script runs both through button reset and through soft reset.
  3. /etc/default/factory.conf — the archive containing defaults. It's in TAR format. If you want to see or to edit its files, just rename 'factory.conf' to 'factory.conf.tar' and open it in appropriate archiver.
  4. /etc/saveconfigfiles.txt — a list of files updated from the archive.
  5. /etc/init.d/S49factory-restore — a command file creating the archive (/etc/default/factory.conf) from the current file system according to the list (/etc/saveconfigfiles.txt) if such an archive has not existed yet. Obviously, it's a procedure for the factory.
  6. /etc/nas/config/wifinetwork-param.conf — a file storing current wi-fi settings of MPW and the external net it is being connected to.
  7. /etc/nas/service_startup/ssh — a file storing current ssh setting (enabled or disabled).

 

I suppose, the information above is sufficient to select a solution. You can erase the content of the file (1) and it's more than enough: button reset will be off (I did not try!). You can also edit files in the 'factory.conf' archive directly. Or you can tune the system to follow your own desires more exquisitely.

As for me, I managed to tune this mechanism in such a way that button reset restores my own defaults (SSID, encryption type, encryption key, Drive Lock and some more options including remembered external wi-fi network settings) whereas soft reset works according to the manufacturer’s intentions. If you’d like to know details, don’t hesitate to ask. It’s not too hard although it would be much better if we got a handy interface from the firmware to do it.

I posted the request in the ideas section and hope WD won’t miss the opportunity to make such a solid device to be really perfect.

If you have any ideas to share, you are welcome. I guess, it could be useful to open a special topic for all issues and solutions (like a FAQ). The message is my 5 farthings for it.