Share files on 2 vero+'s

https://paste.osmc.tv/rawifezoko

https://paste.osmc.tv/yebiwelana

I would recommend removing the <name>MyVideos</name> line from your advancedsettings.xml file. It is not needed and can be problematic.

I would also just manually edit the ~/.kodi/userdata/sources.xml files so the “video” sections both look like this…

<video>
    <default pathversion="1"></default>
    <source>
        <name>Auto-mounted drives</name>
        <path pathversion="1">/media/</path>
        <allowsharing>true</allowsharing>
    </source>
    <source>
        <name>BEDROOM-MOVIES</name>
        <path pathversion="1">/media/Vero128Gb/movies/</path>
        <allowsharing>true</allowsharing>
    </source>
    <source>
        <name>BEDROOM-TV</name>
        <path pathversion="1">/media/Vero128Gb/tv/</path>
        <allowsharing>true</allowsharing>
    </source>
</video>

This can be done in Kodi but this way is a lot less ambiguous and easier than walking through the GUI. The code above would require you to make two folders on your SD card titled “movies” and “tv”. The name is not important so edit that how you like. It is important that you seperate your media in this manner as it is required for adding to a library.

I am a bit confused generally on if you have ever actually setup a library in Kodi, and if you plan on actually using one. A 128GB SD card is not a lot of room. As you couldn’t get UPnP working I wonder if this was because you didn’t have a library to start with and that is required for that to work. You have a MySQL setup but that also only works with a library. If your only goal is have a folder to dump files into temporarily, play them and then delete, then this extra work is unneeded.

1 Like

No way would I store media on the SD cards.

There are lots of other cooks with advice. Pick one and follow their advice. I wouldn’t use samba. I’d use NFS. While I use autofs too, systemd has a newer method that behaves like autofs, but only requires editing the fstab. The main nice thing about it is that directories will be created as needed. systemd.mount and systemd.automount are the manpages for instructions.
I haven’t used the systemd method, but plan to give it a try. Should work with cifs too, but I haven’t tried that either.

It behave similar but not identical.
Autofs seems more robust for times were the server disappear and reappear.

The systemd team seem to ignore issues that have long been handled by the previous solutions for many different areas.
Read they treat the last 2 fstab fields as true/false, ignoring the 0, 1, 2 specific settings for specific purposes.

Have now had some time available to do this.
If I go to System/media/library I now have BEDROOM-MOVIES and BEDROOM-TV but they show files on the vero128Gb (DAVESOSMC) vero not the bedroom one. Same if I go into auto mounted drives just the Vero128Gb one there. There is also BEDROOMOSMC Folder there which has the 128Gb drive there but if I select this I get file exists message.

Lets take a step back and just clarify exactly what you are doing so you should be able to troubleshoot this with a bit more ease.

Running a shared MySQL database without dealing with path substitution requires all machines to point to the same place. If you add for example “Zone Troopers” to your library on the first machine, and the path to that file is /media/Vero128Gb/movies/Zone Troopers (1985).mkv then the second computer has to be able to go to the exact same file path and find that same file.

On the first machine this is already taken care of as /media/Vero128Gb/is being auto generated as that is where the system is mounting the SD card. We don’t need anything else done here other than to be running the SMB Server.

On the second machine we need to add a mount so when you go to /media/Vero128Gb/ it pulls up that folder on the first machine. You were given instructions for this earlier in this thread. At this point you should be able to go to /media/Vero128Gb/ on either machine and see the exact same thing.

Once you have gotten the above out of the way you then add sources in Kodi pointing to /media/Vero128Gb/movies/ and /media/Vero128Gb/TV/ setup your scrapers and scan. You are required to do this setup only on one machine if you wish to only update your library from one machine. If you add the sources to the second machine it will allow updating the library from that machine as well.

Darwindesign, thanks for your help, but although I may have been given instructions about adding a mount, I seem unable to follow them, and as I’m now extremely confused I will give this a rest and transfer files using a memory stick and maybe try again later.

I understand that, and that is why I posted what I did. It seemed to me from just skimming over this thread that you may not have fully understood the what and why of everything you were doing which would make figuring out where something went wrong very challenging. I think if you went back over everything step by step with an understanding of what exactly your trying to accomplish at each step you could get it sorted.

Also realise there is already quite a bit of information to be found by searching this forum. Two of particular interest to you are probably…

I have done a backup then restored a previous backup from before I started trying to change all this. I did this because the system was extremely slow i think when reading the memory cards, to the point where it seemed to be locked up.
This has put the system back working. I have also renamed the memory cards as Lounge and Bedroom so as to avoid confusion and also if I ever get the sharing working I can put a bigger sd card in with the same name.
I have gone through the system files I changed to reflect the new names.
I have the following files in the shares files on both machines

/mnt/DAVESOSMC/Lounge -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.9/Lounge/

/mnt/BEDROOMOSMC/Bedroom -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.17/Bedroom/

/media/Lounge/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.9/Lounge/

When I go to system/Media/Videos Both machines had Bedroom-MOVIES and Bedroom-TV but which if I went into edit source pointed to /media/lounge/movies and /media/lounge/tv

Is there anything I missed or did wrong as still can’t add sources and its not auto mounting other Vero’s which I think it should.

While we normally recommend that you put the mounts in /mnt when using autofs, in your case you want the mounts to be in /media, since that’s where the USB mounts are. That way it’s in the same place in the filesystem on both Vero’s. The ultimate goal is to have /media/Lounge and /media/Bedroom to be exactly the same on both systems. So the bedroom autofs entry should be:

/media/Lounge/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://<IP of Lounge>/Lounge/

and the Lounge would be:

/media/Bedroom/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://>IP of Bedroom>/Bedroom/

I assume thats in the shares folder, in that case would they be the only entry in that file, i.e. I should delete the previous ones?
If so still can’t share the files.

Also on the DAVESOSMC vero in system/Media/Videos in auto mounted drives I now have a folder Bedroom but it won’t open or show content.
On the bedroom machine same location just the bedroom folder which does open

Your SD card gets mounted by the system to /media/[label] and Kodi will automatically add all folders found in /media to the “Videos” section of Kodi. You only need to add mounts for the remote machine. So…

Bedroom Vero
/media/bedroom (this is automatic)
/media/lounge (this you need to make the system mount for)

Lounge Vero
/media/lounge (this is automatic)
/media/bedroom (this you need to make the system mount for)

To test I would use the file manager in settings or just navigate in the terminal. Don’t start messing with the Kodi paths until after you have verified that all four paths are working and showing up where they should.

If you try to mount to a folder that already has something mounted to it then things will likely not work as you want.

Just to make sure I’m putting the files in
sudo nano /etc/auto.smb.shares

Bedroom = /media/Lounge/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.9/Lounge/

Lounge = /media/Bedroom/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.17/Bedroom/

if so not showing up with file manager

In file manager did you add the source? In file manager you click on “add source” then browse>root file system>media (you should be able to see them but don’t click on them) then click “OK” and then “OK”. You will now have the media folder in file manager that you can easily access and play thing from if you wish. Note that this is completely separate from sources and everything else in Kodi. Be aware that everything in Linux is case sensitive.

Thanks, got the source added, but when I click on it it says path not found or invalid, and the reported free space is wrong this is on both veros.

just to clarify, when you go to the file manager on the bedroom Vero the /media folder shows two folders, “Bedroom” and “Lounge” and you can access the former and get an error on the latter? Ditto on the lounge Vero but vice versa? Try using these in their respective places…

/media/Lounge -fstype=cifs,rw,username=osmc,password=osmc,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.9/Lounge/

/media/Bedroom -fstype=cifs,rw,username=osmc,password=osmc,iocharset=utf8,uid=osmc,gid=osmc ://192.168.0.17/Bedroom/

If that doesn’t work after the changes and rebooting both machines then post the output of…

sudo systemctl stop autofs
sudo automount -f -v -d

Excellent, Both machines play and delete files ok.
Thank you Darwindesign and (everybody else) for your patience.
:+1:
Would never have managed it without your guidance.
Just one last question does backup save these changes to the system files or do I need to back them up separately

The backup utility in the My OSMC add-on only backs up Kodi userdata. If you were to have to redo your system from scratch in the future you would need to setup the SMB server, MySQL, and autoFS again. If you think it would be an issue I would probably recommend just making a how-to file for yourself with your information in it.

Are you sorted with the MySQL part of your setup? Did you manage to make an advancedsettings.xml file (on both machines) that is pointing to the machine you installed it on?

Just a note in response to an earlier comment about maybe getting a larger SD card in the future. I would strongly suggest that if you are needing more room in the future a better option would be to get large external hard drive with its own power supply.