× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Using OneDrive for NAS backup now that it's broken on the ReadyNAS

Sandshark
Sensei

Using OneDrive for NAS backup now that it's broken on the ReadyNAS

So the OneDrive capability of the ReadyNAS has broken.  If yours is still working, great, but others have found it has stopped working *there are a couple message threads here about it).  Mine worked a while after first reports of it stopping, then mine quit.  It seems that the implementation is too old and no longer meets the OneDrive security requirements.  Since it's not a separate App, there is no way I can determine to update the native capability.  And the ancient Debian distro might make it impossible even if it was separate.

 

Since I store all my files on the NAS, not on the PC that created them, I still need to sync the NAS Documents and Pictures shares to OneDrive.  There are a couple of things that work, but they work from a PC.  So, you'll need a PC that's "always on" (at least when you want to be able to sync).

 

One obvious method is to use a sync program running on the PC and point the source to the NAS (which may require a mapped drive for some programs) and the destination as your OneDrive folder on the PC (or a folder within a folder).  This has the disadvantage of running a separate program and having to rely on its scheduling.  Depending on the program, it may have an advantage of remembering your NAS credentials.  You may also be able to limit the direction as NAS to OneDrive only rather than bi-directional.

 

But I found a method I prefer more:  Create a symbolic link to the NAS share (or folder within a share).  OneDrive simply sees that as a "local" folder you want to sync, and does it's thing (slowly).  A disadvantage here is that you either have to have an open SMB session with the NAS (in which case it'll use the credentials you're connected with) or you have to put the credentials in the Windows Credentials Manager.  This has the advantage of simply running in the background.  A disadvantage may be that it's always bi-directional unless the NAS user's share access is limited. 

 

Since Documents and Pictures are already existing folders on OneDrive, I created a NAS

 folder then put Documents and Pictures links in that folder.

 

I've not actually tried creating a user with read-only access strictly for OneDrive use, so I'm not sure what will happen if you delete a file in OneDrive when you don't have the proper permission.  I know it won't get deleted on the NAS, but will the file show back up in OneDrive the next time it syncs?  I hope so.  Will any error be so severe it stops syncing? I hope not.  I'll give this a try once my files complete synchronizing.

 

FYI, I was unable to simply move existing files from the OneDrive folders previously  sync'ed to the NAS to the new ones created by the symbolic links.  If you do so, it treats them as separate files.  So if you use that method, you'll have to let it copy over all the files again.

Message 1 of 2
Sandshark
Sensei

Re: Using OneDrive for NAS backup now that it's broken on the ReadyNAS

OK, so I have now had time to explore how to set it up so that OneDrive has only read-only access to files on your NAS. This will create a somewhat one-way sync, but it has a limitation. If you delete a file via the web interface, it won't get deleted on the NAS, so it will show up in the linked folder on the PC. BUT, it won't re-sync and be put back on OneDrive. In fact, the sync process got stuck trying to delete files I deleted via the web on the PC/NAS and wouldn't move onto another task until I quit and re-started OneWeb.

 

If that limitation doesn't bother you, here's how to do it. If the information provided is insufficient for you to do it, you probably shouldn't be trying.

 

To have read/write access for general use of a NAS share but read-only for specific tasks requires that you use two different user names, each with different privileges. But Windows doesn't like that. Normally, Windows will allow two users in one session to connect, one connecting using the NAS name and another using the NAS IP address. But I don't like to reserve one of those for specific tasks. There is a trick that allows you to have more, though, and that's to create a duplicate NAS name using the Windows Hosts file (or as many as you want).

If your NAS does not have a permanent IP address, you will need to assign it one. That's best done by reserving an address in your router rather than setting a static IP in the NAS. Since how to do that differs for one router to the next, you'll have to Google how to do it. For the example below, I'm assuming the NAS is at 192.168.0.100.

Step one is to create that duplicate NAS name. You have to edit the hosts file in a specific way, see https://docs.rackspace.com/docs/modify-your-hosts-file . I'm going to call it AltNAS, so the hosts file entry will be:
     192.168.0.100    AltNAS
Afterward, reboot your computer.

Next, we need to go into the NAS GUI and create a group and user. I called the group BackupUsers and the user NASBackup with NASBackup having membership in BackupUsers only.

 

Next, go to each share you want BackupUser to be able to access and give him both file and network Read-Only access. Then, reset the File Access permissions for the share(s). Note that if you have any share privilages set up for Everyone, then NASBackup will have those privileges.

 

Next, we need to add NASBackup's credentials to the Windows credentials manager. See item 3 here: https://www.makeuseof.com/windows-enter-network-credentials. 

 

If you want to create a mapped drive letter for the share you are backing up, you can skip adding the credentials and just do the mapping checking the boxes to reconnect at log-on and use another account (remembering to use \\AltNAS in the source and NASBackup's credentials).

 

Now, it's time to see if it all worked. In the address bar of a Windows Explorer (not web browser) or in the search bar, type \\AltNAS (make sure you use backslashes, not forward ones). If it worked, you'll see a window displaying your NAS shares and you'll only have NASBackup's permissions within it. Check that you cannot open shares you didn't give NASBackup permission to and that you can open but can't write to ones where you gave him read-only access (unless you have some with Everyone access).

 

The last step is to put symbolic links to the folders (which can include a whole share) to be backed up to OneDrive in your local OneDrive folder (or a folder you create in it, as I did). You can Google how to do so, or use this handy extension: https://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html.

 

I found that this gives no special OneDrive error messages. If you try to write to or delete a file via the link in your OneDrive folder, it simply says you don't have permission. Even deleting a file via the web interface creates no error message, it just never re-syncs the deleted file.

 

Note that you can still have bi-directional sync for some folders together with this one-way sync for others. Just choose your normal user (or yet another special one) that has read/write privileges.

Message 2 of 2
Top Contributors
Discussion stats
  • 1 reply
  • 152 views
  • 0 kudos
  • 1 in conversation
Announcements