Project

General

Profile

Mount NFS share for recordings and timeshift

Added by Josu Lazkano about 2 years ago

Hello,

I have a little Debian server for TVheadened without big hard disk: Mini PC Z83II

So I use to mount a NFS from a NAS for recordings and timeshift. I have configured this way in the fstab file:

192.168.0.10:/vol2/tvdata    /mnt/tvdata/    nfs    defaults    0 0

The problem is that every time I reboot the server, I need to execute "mount -a" to mount the NFS share.

How could I configure the NFS share to mount in boot time?

I will appreciate your help.

Kind regards.


Replies (3)

RE: Mount NFS share for recordings and timeshift - Added by Dave H about 2 years ago

The system will automatically try to mount the NFS filesystem at boot given that line in /etc/fstab, so I expect it is trying and failing. You should be able to find some error message in the system log. My guess is that it is trying the mount before the network is available, so you need to change 'defaults' to read '_netdev' so that it waits until the network is available before trying the mount.

RE: Mount NFS share for recordings and timeshift - Added by andrea boh almost 2 years ago

I follow up this topic, maybe someone can help me. I mount a nfs share for timeshift with fstab. But if the share Is not reachable (es. Nas is offline or i power off voluntary) tvheadend crash and i must kill the service. Any way for mount the share in a Better way than fstab? Maybe autofs cold help?
Thanks

RE: Mount NFS share for recordings and timeshift - Added by Fred Fred almost 2 years ago

Use autofs, I've been using it for years.
I store my recordings on a Windows PC so it's not NFS but SMB, below are my instructions for it.
To use my instructions with NFS you need to replace a few lines like install nfs-common autofs and not the cifs-utils and things like that, so just google for a more useful instruction and replace the lines needed.

I hope this helps out and you get things sorted, best of luck.

-
As I wrote above I use a Windows machine to store all larger recordings, its a Win10 called mypc and have ip 192.168.1.2 with a share called recordedtv, ther is a local user on it called kodi with the password kodi and this user have full permissions on the share and folder on the machine.
I dont want this to be permanently attachaed - so the solution is autofs.

To add recordings to my Windows machine here is how:
sudo apt-get install cifs-utils autofs
sudo mkdir /mnt/mypc
sudo chmod 7777 /mnt/mypc

Add this at the bottom of the file and comment the line +auto.master and paste the info
sudo nano /etc/auto.master
#+auto.master
/mnt/mypc /etc/auto.mypc --timeout=60 --ghost
To save: ctrl+o (enter)
To exit: ctrl+x

sudo id hts
Replace uid and gid with what the user hts have on you system and then paste the line
sudo nano /etc/auto.mypc
recordedtv -fstype=cifs,rw,username=kodi,password=kodi,uid=107,gid=111 ://192.168.1.2/recordedtv
To save: ctrl+o (enter)
To exit: ctrl+x

Restart it:
sudo /etc/init.d/autofs restart

In TVH webgui enter this as recordingpath to store recordings on you Win PC:
/mnt/mypc/recordedtv

    (1-3/3)