Correct format for the path to my Network Drive?
Added by GS Hodg over 9 years ago
I'd like to setup the recording capabilities with TVHeadend and don't know the correct format to enter for the path to the folder where I want to store the recordings.
My TVHeadend, and tuner, are on OpenElec (on an Asus Chromebox).
I have a Network Drive which stores all the media I play on Kodi. It's a Western Digital MyBookLive. Streaming video and music from this to Kodi works OK. Now I'd like my PVR Records to be saved onto this same drive.
The shared folder is called Public, and beneath it I have Public/Videos and Public/Music.
I've now added another folder Public/LiveRecordings - what's the correct format of path to put in TvHeadend to write to this folder?
Thanks in advance
Replies (26)
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
I suspect that you'll need to mount the remote shared folder over NFS so that it appears as a local directory on the OE box. Kodi gets away with it because if has its own NFS and SMB clients, so you can navigate to our shared folders from within the application, but that's not normal behaviour for most applications.
Soooo.... you'll need to issue a mount command from the OE command line, and connect the remote (NAS) filesystem to the local (Chromebook) filesystem, e.g.
mount -t cifs -o username=USERNAME,password=PASSWD //IP.OF.NETWORK.DRIVE/Public/LiveRecordings $HOME/LiveRecordings
(this assumes that LiveRecordings is exported - if not, you'd mount Public instead. It also assumes CIFS/SMB, but that depends on how you're exporting. And it assumes you have the mountpoint - $HOME/LiveRecordings - already created).
This would connect your LiveRecordings share to the OE filesystem in your home directory, and tvh can thus get to it as /storage/LiveRecordings.
You obviously don't want to do this every time you start the machine, so you also need to look into autostart.sh to perform this command every time you start up.
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
Should have thought about this first... more information here...
http://wiki.openelec.tv/index.php/Mounting_network_shares
Looks like the autostart.sh stuff has changed in more recent OE versions - or expanded, anyway.
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
!Thank you Prof Yaffle
I've tried following the wiki guide, without success. Perhaps you can spot what I'm doing wrong?
As I'm not familiar with Linux I followed the steps in the 'Old Method'.
After restart, the autostart.sh file IS present, but I don't think the mapping has been created correctly as I cannot see a folder called 'Liverecordings' either via the windows PC, or in Kodi when I look in folder 'storage'.
The exact contents of the autostart.sh file are:
#!/bin/sh
(sleep 30;
mount -t nfs IPADDRESS:/Public/LiveRecordings /storage/LiveRecordings -o nolock;
)&
I know the IPADDRESS of the network drive is correct (and it's a static IP address, as is the IP address of OpenElec). The path of the folder as seen in windows explorer is attached as a screenshot.
Any ideas, what I'm doing wrong?
Picture1.png (44.3 KB) Picture1.png | |||
Picture1.png (44.3 KB) Picture1.png | |||
networkdrivemap.png (59.5 KB) networkdrivemap.png |
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
I also tried the following in autostart.sh:
#!/bin/sh
(sleep 30;
mount -t cifs - o username=admin,password=admin,rw //IPADDRESS/Public/LiveRecordings /storage/LiveRecordings;
)&
and
#!/bin/sh
(sleep 30;
mount -t cifs - o username=admin,password=admin,rw //IPADDRESS/MYBOOKLIVE/Public/LiveRecordings /storage/LiveRecordings;
)&
with a reboot after each change. Nothing seems to mount the network drive. Windows explorer view of the network drive (MYBOOKLIVE) and OPENELEC attached
Help!
openelec.png (201 KB) openelec.png |
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
and it gets worse!
Not only can I still not map the drive above, but now having reset OpenElec back to initial settings I seem to have lost all my TVHeadend backend settings - all the Channels that I had spent ages mapping channel logos to, and disabling the channels that were not of interest - hours of work yesterday :-(
So now I have 2 questions:
1. what am I doing wrong to map the network drive
2. can I get back all the backend setup I already had? If not, how do I back it up once I have re set it all back?
Help!
RE: Correct format for the path to my Network Drive? - Added by Ulrich Buck over 9 years ago
1. what am I doing wrong to map the network drive
I think you need to create your traget mount directory "LiveRecordings" under /storage. I cannot see it in your screen shot.
To verify that the mount works first log on to your OE box via ssh http://wiki.openelec.tv/index.php/OpenELEC_FAQ#How_do_i_use_SSH.3F, create your traget mount directory, and issue your mount command.
You should now see the contents of your network drive with "ls -l /storage/LiveRecordings". In any case it will help to be somewhat familiar with Linux.
2. can I get back all the backend setup I already had?
Since you reset OpenElec back to initial settings you (apparently) also deleted your Tvheadend settings. I do not think you can have them back.
how do I back it up once I have re set it all back?
Use the Backup/Restore tool in the OpenELEC Setting add-on, and place the backup file in a secure location, see http://wiki.openelec.tv/index.php/OpenELEC_Configuration_Addon
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Thanks Ulrich Buck!
Yes I was sure I had a backup of Kodi on USB, but it seems not :-(
OK, so with a clean build of OpenElec I am again trying to mount these drive so I can save files onto my WD Mybooklive network hard drive. Following Ulrich's advice, I have SSH'd to the OpenELec as root/openelec and created just one new folder "Zips"
I have then tried to map three folders from OpenElec to the mybooklive, the contents of the autostart.sh are:
#!/bin/sh
(sleep 30;
mount -t nfs IPADDRESS:/Public/Kodi Recordings /storage/Recordings -o nolock;
mount -t nfs IPADDRESS:/Public/Kodi Backups /storage/Backup -o nolock;
mount -t nfs IPADDRESS:/Public/Kodi Zip Files /storage/Zips -o nolock;
)&
I then tested it by using Kodi interface to make a backup - and expected to see that backup file on the mybooklive. See the attached screenshot - the backup file IS present on the OpenElec, but NOT present on the mybooklive - so I conclude that the mounting didn't work.
Any ideas what I'm doing wrong now?
openelecthu.png (1.23 MB) openelecthu.png |
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
As Ulrich said, test the mount commands from the command line - it's easier than rebooting all the time. Once they're working, then put them in autostart.
I suspect the fact you have spaces in the paths isn't helping - "KodiBackups" is probably better than "Kodi Backups", as the script may be getting confused and looking for "Public/Kodi" instead.
Knowing how they're exported from the WD box would help... it's possible that the folder isn't really called what you think it is, or the path may be different. I'll have a Google and see if I can find anything.
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
Hmmm, nothing that I can find.
All I can suggest is to check what's being shared - if you're actually exporting 'Public' then you need to mount 'Public', not the subdirectories, i.e. have a local directory /storage/MyBook and than mount Public onto that, giving you /storage/MyBook/Kodi Backups, /storage/MyBook/Kodi Recordings, and so on.
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Thank you Prof Yaffle,
I'm now doing the command line test as you suggested.
I've removed the spaces from the folder names on the network drive as you suggested.
I've created a folder "public" on the openelec as you suggested.
Please see the attached screenshot showing the command line entry, trying to map:
Public/KodiRecordings to storage/recordings
and
Public to storage/public
I've learnt a fair bit these last few days (ssh'ing to openelec and Linux command lines were new) but still I haven't managed to tell openelec to save to the network drive - it's now getting really frustrating! Kodi READS from this network drive no problem, I just want to also WRITE to it - to save PVR recordings.
Can you spot what I'm doing wrong?
p.s. this is the network drive I'm using: http://www.wdc.com/wdproducts/library/UM/ENG/4779-705058.pdf
openelecfri1.png (486 KB) openelecfri1.png |
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Success!
It looks like the correct format for the syntax is:
mount -t nfs IPADDRESS:/nfs/Public/KodiRecordings /storage/recordings -o nolock;
mount -t nfs IPADDRESS:/nfs/Public/KodiBackups /storage/backup -o nolock;
(Note the /nfs/ between the ipaddress and the shared folder)
I've tested it by doing a backup within Kodi, and yes I see the backup tar file on the network drive :-)
I have a question though - I also see the tar file in the storage/backup folder of the openelec. Is this just a link to the actual file on the network drive, or it it ALSO stored locally on openelec - obviously my aim is for it to be on the network drive only. Is there a way I can check this?
Many thanks for to Prof Yaffle and Ulrich Buck for your help.
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
Read the error messages closely...
When you issued
mount 192.168.0.4:/Public/<subdirectory> /storage/<local>
... you got 'bad file descriptor'. To me, that means that one of /Public/<subdirectory> or /storage/<local> doesn't exist - probably the former - as above, I think you're sharing Public, not the subdirectories within that, and you can't mount something that isn't shared.
You then have the 'permission denied' messages, which are almost certainly related to how it's exported from the WD box. I haven't dug completely through the manual, but make sure you have something set that defines universal R/W access or some clearly-named account that has the right level of permission (whether that's admin or something else). If your Public share is, well, public, then it suggests that no user credentials are required; if it's private, then you need to define a specific user as which you'll then mount that directory.
In the third mount command, you have the path wrong and the syntax wrong: you're trying to mount //<IP>/<directory> instead of <IP>:/<directory>, and you're trying to mount it to storage/<local> instead of /storage/local
I think you're probably heading for something like:
mount -t nfs -o username=admin,rw 192.168.0.4:/Public /storage/public -o nolock
... or some variation, depending on what options you need in order to correctly connect.
PS on the Kodi angle, Kodi is browsing the network and mounting the share within the application - it has its own NFS and SMB clients. So, you can see from that what the path to the share is: when you first browse the network in Kodi, it'll name the device (MyBookLive) and list the available shares - that's the level at which you need to mount, not below.
PPS you also don't say if Kodi is using SMB or NFS. The WD manual doesn't seem to go into detail, so I assume it defaults to sharing using both protocols - in which case, you could try mounting as -t cifs (i.e. SMB) instead of -t nfs.
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
Bugger - messages crossed - okay, you're there. I did see one example that had that 'nfs' in the path, but nothing authoritative.
The file you see on the OE box is the remote file (or should be). When the system goes into /storage/backup, it's actually now on the NAS instead, so that file is the only copy.
You can check by rebooting and not mounting the share (or issuing a umount command). The /storage/backup directory will now appear empty, as you're looking at the local mount mount and not the remote directory - but the NAS will still have the file. Issue the mount command again, and the local directory will be replaced by the remote one, so /storage/backup will now appear to contain the remote files.
Glad you made it, though!
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Many thanks again.
Now having wiped my setup whilst resolving the above, I'm trying to get TvHeadend set up again and am struggling with channel icons. Last time (2 weeks ago) when I first set it up, I couldn't get my head around the picons/channel icons and ended up manally editting every channel to point to a url for it's logo - very time consuming. As I'm starting again I'd like to do it smarter and work out how to add them en-masse - but can't get it to work.
Here's what I've done so far:
1. Download picons and saved them to my network drive, folder: Public/KodiPicons
2. Mounted this network folder to the openelec box using the successful mount command we worked out above, namely: mount -t nfs IPADDRESS:/nfs/Public/KodiPicons /storage/picons -o nolock;
3. In TvHeadend webpage setup, used the following option: Configuration > General > Picon > Picon path and entered "file:///storage/picons"
But the channel logos are not loaded. Any idea what I'm doing wrong now?
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
First guess is that tvheadend was running before you mounted the drive, so it saw /storage/picons as a blank directory. Restarting the tvheadend process, or finding out how to delay it on startup (as you want everything to happen after the mount - autostart.sh with the sleep should fix that, though), should eliminate that.
Next would be to check Configuration -> Channel/EPG -> Channels and see if the correct picon paths are listed next to your channels. You should find picon://<file>.png or similar.
Next would be to check read access and/or the system log file, see if there's anything in there about file not found/404 or similar.
Next would be to reset the icons for a/a set of/all of the channels and see if the picon is then picked up.
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Once again, many thanks Prof Yaffle.
Off topic from the original post, but how do I re-arrange the channel order to my liking?
I've tried doing so in the frontend in Kodi> System > Settings > Live TV > Channel Manager but even though I click "Apply Changes Now" no changes ever 'stick'. I presume the Kodi settings are being over-rided by TVHeadend settings, but I cannot find what to do to get the channel order I'd like. Any suggestions?
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
In Kodi, you may have 'synchronise channel number with backend' or similar set - in which case, you will get the Kodi settings over-ridden as you see.
So, either sort the channel numbers to your liking in the backend, or make sure this setting isn't on (or settings like it, I can't remember off the top of my head) and then re-arrange to your heart's content on the Kodi side.
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Thanks - I didn't have the settings level on 'advanced' - now do and can see that option :-)
However the channel manager on Kodi Settings>LiveTV menu doesn't work. But I CAN re-arrange them with a contextual menu when in TV so that will have to do.
But if I wanted to do it in the backend, how would I do that?
RE: Correct format for the path to my Network Drive? - Added by Prof Yaffle over 9 years ago
Kodi shows them in numeric order by channel number, I think. So just go to Configuration -> Channel/EPG -> Channels and change the channel number (obviously, you can't have two channels with the same number, so there'll be some shuffling). Reset the PVR database in Kodi and all should be good.
You may have to use the 'use backend channel numbers' option (perhaps in Expert, if not in Advanced )
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Now we've correctly mapped the network drive for recordings, I'd like to know how to do 'pausing Live TV' (timeshift).
I naively assumed it would be there once the recording facility was working, and can't find any settings for it either in TVheadend web control pages, or in Kodi.
RE: Correct format for the path to my Network Drive? - Added by Ulrich Buck over 9 years ago
There is a timeshift tab in the Tvheadend web interface.
You might want to read here http://forum.kodi.tv/showthread.php?tid=186130
I do not think timeshift is working properly. Hope someone will prove me wrong.
timeshift.jpg (105 KB) timeshift.jpg |
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Thanks Ulrich - I hadnt seen that tab.
Pausing work OK - but as with the comment in that thread you linked to, fast forwarding doesn't work (e.g. speeding through the adverts after resuming after pause) which was the behaviour I'd expect, and it's very unstable after pausing even without fastforward or rewind; just pausing once and playing again will lead to crashing several minutes later!
But now I have another problem related to recordings - NO recordings are showing in the Kodi recordings tab - even though the recordings ARE correctly being recording onto the Network Drive. I've rebooted Kodi (on an OpenELEC system) but the recordings do not show up in the list.
Any ideas, on why the recording aren't showing?
RE: Correct format for the path to my Network Drive? - Added by Ulrich Buck over 9 years ago
No idea why NO recordings are showing in the Kodi recordings tab.
Do you see your recordings in the Tvheadend web interface? Refer to https://tvheadend.org/projects/tvheadend/wiki/DVR_Log
If your recordings do not show up in the Tvheadend web interface Kodi will not be able to show them either.
RE: Correct format for the path to my Network Drive? - Added by GS Hodg over 9 years ago
Yes I could see them in the backend web interface, but not in Kodi - despite several reboots. That's was the case for several days.
Now, recordings ARE showing in Kodi - and I've no idea what changed!
Thanks for replying.
RE: Correct format for the path to my Network Drive? - Added by Peter miller over 9 years ago
I spent days getting this to work - omsc running on Raspi 2 with Network Hard drive connected to Netgear router no passwords on hard drives.
This worked to manually mount
sudo mount -t cifs -o user=<youruser>,password=<yourpassword>,sec=ntlmv2 //192.168.1.3/USB_Storage/recordedtv /home/osmc/recordedtv
to get to auto mount on boot using etc/fstab add following line to fstab
//192.168.1.3/USB_Storage/recordedtv /home/osmc/recordedtv cifs user=<yourusername>,password=<yourpassword>,sec=ntlmv2 0 0
Add to etc/rc.local this waits for network (tried _netdev didn't work for me)
sleep20
sudo mount -a
Hope this saves someone else days of frustration. :-)