Forums » Tutorial and setups »
What can the "mount point" be for an internal drive for TVH recordings
Added by Malcolm Smith almost 4 years ago
Hi me again - still learning at 66 so sorry if this is basic Linux stuff, just when I think I've got my ageing head around permissions (if that's what this problem is?)
I have installed a second internal drive for to use for TVH recordings as I would rather not have them on the boot drive
After trying several scenarios TVH is happy to record to the drive if I mount it under /home/hts - Is that the only mount point I should / can use or should I be able to mount the drive at say /mnt ?
If I should be able to mount at somewhere other than /home/hts are there any instructions anywhere on how to do so? I haven't been able to find any searching this forum or google, or reading the docs so any pointers gratefully received.
Thanks
Replies (8)
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Dave H almost 4 years ago
You can move it. Go to /Configuration/Recording/Digital Video Recorder Profiles and look for the 'Recording system path' setting. Mine is /srv/live-tv FWIW. That's because I export it to Kodi running on a Fire TV.
What's wrong with /home/hts as a mount point though? It's not going to get confused with other things.
You shouldn't use /mnt as a permanent mount point. Keep it for doing things temporarily.
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Malcolm Smith almost 4 years ago
Thanks for your input Dave H
Dave H wrote:
You can move it. Go to /Configuration/Recording/Digital Video Recorder Profiles and look for the 'Recording system path' setting. Mine is /srv/live-tv FWIW. That's because I export it to Kodi running on a Fire TV.
What's wrong with /home/hts as a mount point though? It's not going to get confused with other things.
Probably nothing at the moment.
The question arose because before I moved it to /home/hts, the system (Linux Mint) mounted it at /media (I think it was there) by default and no amount of me trying as many permission configurations I could think of could get TVH to record to it there
You shouldn't use /mnt as a permanent mount point. Keep it for doing things temporarily.
That's what I thought /media was for? but I'm still learning after 2 years - seems everyday is a learning day even at 66 :-)
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Dave H almost 4 years ago
Well /media is where the OS mounts new devices that come online (unless you've told it to mount the device somewhere else in /etc/fstab) /mnt is a directory from an older time and is generally kept for user-initiated mounts. These days it's normally not used much.
There's a thing called 'bind mounts' that lets you have space show up in more than one place, but you probably don't need to investigate that. For now, having your disk show up at either /home/hts or /media/<whatever> should be fine.
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Hiro Protagonist almost 4 years ago
Dave H wrote:
What's wrong with /home/hts as a mount point though?
The OP asked about mounting it UNDER /home/hts, which would work fine.
Using /home/hts as a mount point is going to cause a world of pain if you actually have an hts user. The directories immediately under /home are by convention users home directories, but you could
create you own directory there and use it, or mount under an existing directory, but don't mount ON an existing /home directory.
FWIW you can mount your drive anywhere in the filesystem with a few caveats.
1) Don't mount it on a non-empty directory - you won't be able to access the content you mounted the drive over until you unmount.
2) Make sure the entire path to the mount point has at least r-x permissions for the users who need access to the drive.
3) It's best to stay away from system directories, putting it under /var, /opt or a directory you've created under / would be fine, the likes of /dev /lib or /tmp would be bad choices.
4) You can't mount on pseudo filesystems like /proc or /sys
Wherever you mount your drive, you'll have to tell TVH as mentioned above.
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Malcolm Smith almost 4 years ago
Hiro Protagonist wrote:
FWIW you can mount your drive anywhere in the filesystem with a few caveats.
1) Don't mount it on a non-empty directory - you won't be able to access the content you mounted the drive over until you unmount.
2) Make sure the entire path to the mount point has at least r-x permissions for the users who need access to the drive.
3) It's best to stay away from system directories, putting it under /var, /opt or a directory you've created under / would be fine, the likes of /dev /lib or /tmp would be bad choices.
4) You can't mount on pseudo filesystems like /proc or /sysWherever you mount your drive, you'll have to tell TVH as mentioned above.
If that's the case can you give any guidance on what the permissions need to be set to so that TVH can record to a mount point other than under /home/hts as this is where I'm having trouble.
This is my set up
Dedicated pc with linux Mint Xfce os and TVH installed following these instructions
https://tvheadend.org/projects/tvheadend/wiki/AptRepositories
resulting in TVH Version 4.2.8-36~g5bdcfd8ac
The only users are root, me (mks), and hts . currently recordings go to
/home/hts/500GB#S36/hts-recordings/prog title folder
Permissions are: (please excuse my novice way of describing)
/home - folder owner root Read and Write - group root Read - others Read (created by system at install)
/hts - folder owner hts RW - group R - others R (created by TVH install)
/500GB#S36 - folder owner root RW - group users RW - others RW (created by me as root)
/hts-recordings - folder owner mks RW - group mks RW - others RW created by me as mks)
/prog title - owner hts RW - group video RW - others RW (created by TVH when recording)
I have tried many variations of permissions and locations of mount point and have been unsuccessful in getting TVH to record to any location other than the default or below the default as above. I'm obviously doing something wrong if you say it's possible but I must be missing something in my understanding of the process
Any guidance or pointers to learning material gratefully received
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Malcolm Smith almost 4 years ago
Just to add to my last post
TVH users with profiles under users tab are admin, mks, and htsp
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Dave H almost 4 years ago
Permissions are: (please excuse my novice way of describing)
Normally the best way of showing permissions is to directly cut and paste an 'ls' command and its output, like this:
$ ls -la /srv/live-tv/
total 84162684
drwxr-xr-x 3 hts video 8192 Jan 18 14:00 ./
drwxr-xr-x 1 root root 64 Jan 11 2019 ../
-rw-rw-r-- 1 hts video 2224464880 Jan 16 00:06 'Battlestar Galactica.ts'
-rw-rw-r-- 1 hts video 395463452 Jan 17 17:53 'BBC News-1.ts'
-rw-rw-r-- 1 hts video 238763572 Jan 16 17:50 'BBC News.ts'
... more here ...
Note that directories such as /srv (== ../ ) and live-tv (== ./ ) must have execute permission ( x ) as well as read (r) and write (w). This is necessary for programs to be able to search the directory etc. The above shows where my recordings are kept. Here is hts' home directory on my system:
$ ls -ld /var/lib/tvheadend/
drwxr-xr-x 1 hts video 254 Jul 26 2018 /var/lib/tvheadend//
$ ls -l /var/lib/tvheadend/
total 0
drwxr-xr-x 1 hts video 0 May 10 2017 bin/
drwx------ 1 hts video 176 Jan 18 15:28 config/
drwxr-xr-x 1 hts video 20 Jan 14 2018 public_html/
RE: What can the "mount point" be for an internal drive for TVH recordings - Added by Hiro Protagonist almost 4 years ago
Malcolm Smith wrote:
Any guidance or pointers to learning material gratefully received
As I said & Dave H reiterated, having execute ( x ) as well as read (r) and write (w) is vital.
To find out if a directory you've created can be used by a particular user, try this little exercise:
Log in as the user who need access to the directory.
$ sudo mkdir -p foo/bar $ ls -la drwxr-xr-x 3 root root 4096 Jan 19 12:25 . drwxr-xr-x 34 root root 36864 Jan 19 12:22 .. drwxr-xr-x 3 root root 4096 Jan 19 12:25 foo $ ls -la foo drwxr-xr-x 3 root root 4096 Jan 19 12:25 . drwxr-xr-x 3 root root 4096 Jan 19 12:25 .. drwxr-xr-x 2 root root 4096 Jan 19 12:25 bar $ touch foo/bar/baz touch: cannot touch 'foo/bar/baz': Permission denied $ sudo chown user.user foo/bar $ ls -la foo drwxr-xr-x 3 root root 4096 Jan 19 12:25 . drwxr-xr-x 3 root root 4096 Jan 19 12:25 .. drwxr-xr-x 2 user user 4096 Jan 19 12:29 bar $ touch foo/bar/baz $ ls -la foo/bar drwxr-xr-x 2 user user 4096 Jan 19 12:29 . drwxr-xr-x 3 root root 4096 Jan 19 12:25 .. -rw-r--r-- 1 user user 0 Jan 19 12:29 baz
Notes:
'mkdir -p' allows you to create a directory path, creating any directories in the path that don't already exist
Directory foo has drwxr-xr-x permission - this is vital if users other than root need to access anything below foo.
The "Permission denied" error happened because only root had write permission to 'bar'.
Changing the ownership of 'bar' gave 'user' write permission, allowing the 'touch' to succeed.
Ensuring a user can touch a file in the directory in question means you can then be confident that a program run by that user can also write there.
If reading a directory fails, make sure each directory in the path has at least r-x permission for all users.
If writing to a directory fails, make sure that user has write permission, you can do that be either changing the permission, or changing the ownership of the directory.