Migration to new storage device (new mount points)

I’m currently in the process of migrating to a new NAS, it’s time to move away from the Synology ecosystem. Although they’ve now rolled back their stance on non-Synology drives for the 2025 NAS models, that was enough to turn me off. I’ve ended up moving to TerraMaster and Unraid.

When I previously moved from Synology to a newer Synology, the NFS mount point changed from nfs://IPADDRESS/volume1/ to /volume2/ and in order to deal with that (as my understanding is you can’t just edit sources.xml as there’s also references in the SQL DB?) I stopped mediacenter, added the following to advancedsettings.xml (and gave the new NAS the same IP, but presumably I could have just given a new IP as well), then started mediacenter:

<pathsubstitution>
                <substitute>
                        <from>nfs://IPaddress/volume1/</from>
                        <to>nfs://sameIPaddress/volume2/</to>
                </substitute>
        </pathsubstitution>

As I’m just about to setup the new Unraid NAS, presumably I’d follow the same process? Or, is there a better way?

The only other alternative I’m aware of is to export the library and then add the new source (either same as the original way, or via autofs?) and then add a flag to advancedsettings.xml and import the library so the watched status markers transfer across.

Is there anything I’m missing?

Also, I’m taking a full backup anyway and I noticed that in my home dir there’s not just .kodi but also .kodi-vero now as well (the latter is very small and was quick to download). I can’t see anything in .kodi-vero that I’d need/want to backup, but happy to be corrected if wrong.

I’ve setup Unraid now, but I can’t get SMB or NFS to show up (NFS preferred I guess, for ease of use in updating advancedsettings.xml for pathsubstitution).

NFS has been configured as per https://forums.unraid.net/topic/142835-612-nfs-share-guide-for-maclinux-connection/ but the IP doesn’t show up in Kodi, only the IP of the old NAS. I’ve tried setting the NFS share as both private (with a rule as per the above thread as well as also trying OSMCIPADDRESS(async,no_subtree_check,rw,sec=sys,insecure,anongid=100,anonuid=99,root_squash) and OSMCIPADDRESS(async,no_subtree_check,rw,sec=sys,insecure,anongid=100,anonuid=99,no_root_squash)) as well as public. The IP of that NAS doesn’t show up in the NFS list regardless.

For SMB, if I try and add a network location (using either IP or hostname) and putting in user/pass, plus the share name ‘data’, it just says “Error: Connection refused”. I can connect to the SMB share via a Windows machine.

I wrote a comprehensive guide on path substitution you can find here…

If your using SMB you may have to either manually edit ~/.kodi/userdata/passwords.xml to add/update credentials or else just add a new video source location (Videos>files>add videos>browse>add network location>) which will add credentials as part of that process.

I can’t help you out with the NFS stuff as I’ve no personal experience with that.

Step one check connectivity and your NFS shares.

  1. Login OSMC via SSH, Accessing the command line - General - OSMC
  2. run showmount -e <IP of the unraid>

Post the output here

Indeed, thank you. I’ve already re-IP’d the previous NAS and updated the hostname (although was always connecting NFS using IP rather than hostname) and that continues to work.

On the Syno, I had a share setup for each folder e.g., TV, Movies etc. In NFS that shows up as /IP/volumeX/TV for example.

On my new Unraid setup, I’ve gone for a single share (data) so if/when I get either NFS up and going or SMB, my path substitution would still just be /IP/usr/mnt/data (or similar) and the sub folders in there would match the previous ‘share’ names on the Synology.

I did try add the new share via SMB also, entering the user/pass and it just zonked out each time.

osmc = .100
NAS01 = .22
NAS02 = .25

Running from osmc, the output is:

~$ showmount -e 192.168.0.22
Export list for 192.168.0.22:
/mnt/user/data 192.168.0.100

Running from NAS01, the output is:

:~# showmount -e 192.168.0.22
Export list for 192.168.0.22:
/mnt/user/data 192.168.0.100

Running from osmc, against the old NAS (which is still working as I updated the pathsubstitution) the output is:

:~$ showmount -e 192.168.0.25
rpc mount export: RPC: Unable to receive; errno = Connection refused

This makes no sense.

In regards to showmount for .22 I can’t understand why it’s showing there’s nothing on NAS02 when it is responding over the existing NFS path /192.168.0.25/volume2/. I have validated that by going to Files/Videos/TV on Kodi, and it shows what is on NAS02 (old NAS) and not what is on NAS01 (new NAS, where I’ve placed just a couple of files initially so it’s obvious which is which).

On the old NAS (NAS02), this is what it’s currently exporting (and what osmc sees just fine).

:/$ showmount -e 192.168.0.25
Export list for 192.168.0.25:
/volume2/TV     192.168.0.101,192.168.0.100
/volume2/Photos 192.168.0.101,192.168.0.100
/volume2/Music  192.168.0.101,192.168.0.100
/volume2/Movies 192.168.0.101,192.168.0.100

What do you get when you run
showmount -e 192.168.0.25 on NAS01?

Also would you consider to use autofs to mount the NAS instead of Kodi mounting?

Can’t connect, as I’d expect to be the case (as the NFS permissions on NAS02 accept from only .100 (primary osmc) and .101 (additional node - not currently in use).

:~# showmount -e 192.168.0.25
rpc mount export: RPC: Unable to receive; errno = No route to host

From osmc, it does the same - even though the NFS mount is working (as I just played a video from it), which I can’t wrap my head around!

osmc:~$ showmount -e 192.168.0.25
rpc mount export: RPC: Unable to receive; errno = No route to host

Alright, I fixed the showmount issue for .25, rebooting the NAS did that. I guess with all the IP address changes it got a bit confused.

:~$ showmount -e 192.168.0.25
Export list for 192.168.0.25:
/volume2/Photos 192.168.0.101,192.168.0.100
/volume2/TV     192.168.0.101,192.168.0.100
/volume2/Music  192.168.0.101,192.168.0.100
/volume2/Movies 192.168.0.101,192.168.0.100

So, that’s one mystery solved, but unfortunately not the one that’s impacting me migrating to the new NAS.

That’s a wrong expectation. Showmount will always work regardless of the limit of IPs in the export.

Well for that my only help I can offer is move to autofs

That’s what I was thinking might be the solution, too.

Is that going to handle/deal with my change from a share per media type e.g., Movies, Music, Photos and TV to a single share i.e., data given it’ll just present the mount point in the pathsubstitution tag in advancedsettings.xml?

From:
nfs://192.168.0.22/volume1/
Old to:
nfs://192.168.0.25/volume2/
New to:
nfs://192.168.0.22/mnt/usr/data/

What’s the best way for me to try and connect to the new NFS mount using autofs and if/when I backup and need to restore, or migrate to a new Vero device for example, will the autofs config save/move as part of that?

Well it’s kind of unrelated. Autofs will first just establish a connect between your Vero and the NAS. If you on the NAS currently only have one export then it will use that one export

How you then point your sources to the different sunfolders and if you want to use path substitute is another topic.

Read this guide

Autofs config is in etc and can be included in a backup.
And actually if used from day 1 it makes moving NAS much simpler.

My original RPi this install is migrated from was over a decade ago (2 or 3 RPis, and now Vero V).

I’ve done the autofs config, but it’s not working.

osmc@osmc:~$ ls -lah /mnt/nas01/data/
ls: cannot access '/mnt/nas01/data/': No such file or directory

When I run the command to do the troubleshooting the output is as follows when trying to browse over my 2nd SSH session:

handle_packet: type = 5
handle_packet_missing_direct: token 5, name /mnt/nas01/data, request pid 4935
attempting to mount entry /mnt/nas01/data
lookup_mount: lookup(file): looking up /mnt/nas01/data
lookup_mount: lookup(file): /mnt/nas01/data -> 192.168.0.22:/mnt/usr/data
parse_mount: parse(sun): expanded entry: 192.168.0.22:/mnt/usr/data
parse_mount: parse(sun): gathered options:
parse_mount: parse(sun): dequote("192.168.0.22:/mnt/usr/data") -> 192.168.0.22:/mnt/usr/data
parse_mount: parse(sun): core of entry: options=, loc=192.168.0.22:/mnt/usr/data
sun_mount: parse(sun): mounting root /mnt/nas01/data, mountpoint /mnt/nas01/data, what 192.168.0.22:/mnt/usr/data, fstype nfs, options (null)
mount(nfs): root=/mnt/nas01/data name=/mnt/nas01/data what=192.168.0.22:/mnt/usr/data, fstype=nfs, options=(null)
get_nfs_info: called with host 192.168.0.22(192.168.0.22) proto 6 version 0x20
get_nfs_info: nfs v3 rpc ping time: 0.003638
get_nfs_info: host 192.168.0.22 cost 3638 weight 0
get_nfs_info: called with host 192.168.0.22(192.168.0.22) proto 17 version 0x20
get_nfs_info: nfs v3 rpc ping time: 0.003893
get_nfs_info: host 192.168.0.22 cost 3892 weight 0
prune_host_list: selected subset of hosts that support NFS3 over TCP
mount_mount: mount(nfs): calling mkdir_path /mnt/nas01/data
mount(nfs): calling mount -t nfs 192.168.0.22:/mnt/usr/data /mnt/nas01/data
>> mount.nfs: access denied by server while mounting 192.168.0.22:/mnt/usr/data
mount(nfs): nfs: mount failure 192.168.0.22:/mnt/usr/data on /mnt/nas01/data
dev_ioctl_send_fail: token = 5
failed to mount /mnt/nas01/data

On my old NAS (which is working) /etc/exports has:

NAS02:/$ sudo cat /etc/exports
/volume2/Photos 192.168.0.100(ro,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)
/volume2/Movies 192.168.0.100(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)
/volume2/Music  192.168.0.100(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)
/volume2/TV     192.168.0.100(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

On Unraid, I’ve now set the rule to:

192.168.0.100(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

NAS01 shows:

NAS01:~# cat /etc/exports
# See exports(5) for a description.
# This file contains a list of all directories exported to other computers.
# It is used by rpc.nfsd and rpc.mountd.

"/mnt/user/data" -fsid=100,async,no_subtree_check 192.168.0.100(rw,async,no_wdelay,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

I’ve also tried anonuid=99 as most forum posts for Unraid seem to use 99, rather than 1024 (which might be more of a Synology thing).

However, when I run debug mode on osmc, it still shows the same error.

If it also makes any difference, here are the perms on the new NAS.

root@nas01:/mnt/user/data# ls -al
total 0
drwxrwxrwx 1 nobody users 145 Oct 17 16:35 ./
drwxrwxrwx 1 nobody users  18 Oct 17 16:30 ../
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Apps/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Backup/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Misc/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Movies/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Music/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 Photos/
drwxrwxrwx 1 root   root   58 Oct 18 03:53 TV/
drwxrwxrwx 1 root   root    6 Oct 17 16:35 eBooks/
root@nas01:/mnt/user/data# cd TV
root@nas01:/mnt/user/data/TV# ls -al
total 2999580
drwxrwxrwx 1 root   root          58 Oct 18 03:53 ./
drwxrwxrwx 1 nobody users        145 Oct 17 16:35 ../
-rwxrw-rw- 1 james users 3071568079 Aug 13 23:09 Test File.mkv*
root@nas01:/mnt/user/data/TV#

To be honest not an unraid expert. But I guess must be related to the config of the share.
What I normally would try is configure a user on unraid with same uid/gid as the osmc user then no mapping is needed.

It seems to be more of an osmc issue, for example, I just tried to setup connection to the SMB share on the Synology (old NAS) from both Unraid (using the Unassigned Disks plugin) and then used the exact same hostname, credentials and path on Kodi (on osmc) as well. On OSMC, it says Error 2: share not available and on Unraid it connects and shows the full directory contents straight away.

Well that normally means that either something went wrong in the configuration or that there is an issue between OSMC and the NAS.

If you want to dig deeper I can give you some comments to check SMB.

That would be good, thanks, as I can access the shares on SMB on all other machines on the network, just not from the osmc one.

Let’s start with
sudo apt install smbclient
smbclient -L 192.168.0.25

I get stuck here, as I don’t have a user ‘osmc’ setup on the old NAS (0.25) as I’m using NFS to connect to it. Should I create a user on there for testing purposes?

osmc@osmc:~$ smbclient -L 192.168.0.25
Enter WORKGROUP\osmc's password: