Project

General

Profile

(SOLVED) Error when changing default recording directory, Timeshift and recording not working.

Added by George Turner almost 11 years ago

Hello and please accept my appologies for being a noob

I cannot for the life of me successfully change the default recording directory of TVheadend to the one I want. I think it is a matter of permissions on the new target directory. The original default settings work and I can both record and timeshift as I like.

When I change the Timeshift directory I get: access denied, when TVheadend tries to create directories.

I have fiddled around a bit

with the ownership/groups,changing target dir permissions to

sudo chmod -R 777 LiveTV/

adding hts user to my users group

Changed the owner and group of target to hts

ls -al output of target is
drwxrwxrwx 5 hts hts 4096 Dec 14 08:29 LiveTV

The directory is automounted in my fstab with
UUID=8d214c70-1990-489e-a426-b502204dbba9 /home/username/Videos/LiveTV/ ext4 nodev,nosuid 0 2
I have also tried to change the TVheadend user to me in etc/default/tvheadend unsuccessfully. I could not log in to configuration.

What am I doing wrong?


Replies (7)

RE: Error when changing default recording directory, Timeshift and recording not working. - Added by Prof Yaffle almost 11 years ago

Try doing a sudo su hts to switch to the hts user on the command line and then see if you can write to your target directory. That elminates the tvheadend application completely.

If you can't write to the target, then that might help set a direction to track down the problem (are these permissions set on the mount point or the mounted volume? Not sure it makes a difference, but...) (also, just check group membership by issuing the command groups while su-ed to hts).

If you can, then something else is up - my starting point would be the path you're defining in the tvheadend web interface.

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by George Turner almost 11 years ago

Thanks, I realized that the parent directory did not have rw access.

I also understood what i total noob I am :P

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by Andrew Johnson over 9 years ago

Hi everyone...

I know this is an old thread, but I found it when trying to solve the recording problem when using a FAT32 USB Hard Drive (formatted under windows). I remember reading somewhere that with FAT32 only the user that the drive is mounted under has write access to it (and root of course). I am using TvHeadEnd version 3.4 ~ Wheezy. (actually on a Raspberry Pi)

What you can therefore try is

sudo nano /etc/default/tvheadend

Then change the $TVH_USER default

# TVH_USER
#   if set to "" will run as root
#TVH_USER="hts" 
TVH_USER="osmc" 

Or you can change it to Root - on OSMC Kodi, the default user is "osmc" - so changing it to that "lines things up" better. You can then record in any folder that user "osmc" has access to. When it boots, USB drives are mounted by this user, so away you go.

If you have created any config, however, you will need to copy this to your "new" user's home folder e.g.

cp -avr /home/hts/.hts /home/osmc/.hts

where hts is the uses for TvHeadEnd and osmc is the user for OSMC (i.e. the Kodi default user name in version I am using on Ras Pi)

You can then restart TV headend:

sudo /etc/init.d/tvheadend restart

Your access problems should then be eased or they should be gone!

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by D Fry about 9 years ago

I realize this is an old thread but this thread keeps coming up when I Google my issue. I recently built a machine to use as a PVR. I am running Ubuntu 14.04 LTS as an operating system, latest Kodi-Stable from PPA, and TVHeadend 4.07. My machine has a M.2 SSD with the OS and all the programs on it. I also have two 1TB rotational drives connected to SATA connections on the motherboard and they have been setup in the BIOS as RAID0. They show up in Ubuntu under /media/username/1e38214e-34f9-4702-a719-0150a9e3b6c9. I have tried all of the steps mentioned above to change the recording location to the partition on the RAID drive. and a couple of other things I found through Google, but no change in the result, the log shows permission denied when a recording tries to create a folder in the RAID partition. Changing the default user in the /etc/default/tvheadend file results in tvheadend not being able to start at all. Time shift I left pointed at the default location, which works fine. As long as I have the recording pointing at the default location recordings work fine. Any help I can get will be appreciated.

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by Mark Clarkstone about 9 years ago

D Fry wrote:

I realize this is an old thread but this thread keeps coming up when I Google my issue. I recently built a machine to use as a PVR. I am running Ubuntu 14.04 LTS as an operating system, latest Kodi-Stable from PPA, and TVHeadend 4.07. My machine has a M.2 SSD with the OS and all the programs on it. I also have two 1TB rotational drives connected to SATA connections on the motherboard and they have been setup in the BIOS as RAID0. They show up in Ubuntu under /media/username/1e38214e-34f9-4702-a719-0150a9e3b6c9. I have tried all of the steps mentioned above to change the recording location to the partition on the RAID drive. and a couple of other things I found through Google, but no change in the result, the log shows permission denied when a recording tries to create a folder in the RAID partition. Changing the default user in the /etc/default/tvheadend file results in tvheadend not being able to start at all. Time shift I left pointed at the default location, which works fine. As long as I have the recording pointing at the default location recordings work fine. Any help I can get will be appreciated.

Why are these drives being mounted in /media/<username>/<uid>? You could've set the location manually during the install of Ubuntu. Have you tried adding them to /etc/fstab? (this is basically what the installer does when you manually set the location).

# /md0 was on /dev/md0 during installation
UUID=ee796fc9-a176-4408-8787-f558c229b530 /md0            ext4    defaults        0       2

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by George Turner about 9 years ago

D Fry wrote:

I realize this is an old thread but this thread keeps coming up when I Google my issue. I recently built a machine to use as a PVR. I am running Ubuntu 14.04 LTS as an operating system, latest Kodi-Stable from PPA, and TVHeadend 4.07. My machine has a M.2 SSD with the OS and all the programs on it. I also have two 1TB rotational drives connected to SATA connections on the motherboard and they have been setup in the BIOS as RAID0. They show up in Ubuntu under /media/username/1e38214e-34f9-4702-a719-0150a9e3b6c9. I have tried all of the steps mentioned above to change the recording location to the partition on the RAID drive. and a couple of other things I found through Google, but no change in the result, the log shows permission denied when a recording tries to create a folder in the RAID partition. Changing the default user in the /etc/default/tvheadend file results in tvheadend not being able to start at all. Time shift I left pointed at the default location, which works fine. As long as I have the recording pointing at the default location recordings work fine. Any help I can get will be appreciated.

The folder were you mount the drive in fstab must allow for read write for user hts.
This is how I solved my issue.

RE: (SOLVED) Error when changing default recording directory, Timeshift and recording not working. - Added by D Fry about 9 years ago

Thanks for all the responses. I had tried changing the permissions for the folder on the RAID partition and the RAID partition itself but that hadn't helped. So what finally worked was I had to change the permissions of the /media folder and every folder between that and the destination folder. Thanks again for all the help.

    (1-7/7)