Difference between revisions of "Troubleshooting:Filesystem Permissions"

From MythTV Official Wiki
Jump to: navigation, search
(Common Issues)
m (Category corrected.)
(5 intermediate revisions by 3 users not shown)
Line 57: Line 57:
 
<pre>
 
<pre>
 
# chown mythtv:mythtv /media/data
 
# chown mythtv:mythtv /media/data
# chmod g+ws /media/data
+
# chmod g+w /media/data
 
# ls -ld /media/data
 
# ls -ld /media/data
drwxr-xr-x 1 myhtv mythtv 4096  Jun 11 13:08 /media/data
+
drwxrwxr-x 1 myhtv mythtv 4096  Jun 11 13:08 /media/data
 
</pre>
 
</pre>
 
Also: check the permissions of each step in the mount path, from /.
 
Also: check the permissions of each step in the mount path, from /.
  
Reference: 2012 thread on mythtv-user titled "Can't watch TV Permission Denied opening recording file despite chmod a+rwx"
+
Also: some distributions use the path /media as a location for automatically mounting removable storage.
 +
So you may do better with a different mountpoint path e.g /data.
 +
 
 +
Reference: MythTV-Users mailing list [http://www.mythtv.org/pipermail/mythtv-users/2012-July/336208.html "Can't watch TV Permission Denied opening recording file despite chmod a+rwx"]
 
   
 
   
[[Category:Troubleshooting|Filesystem Permissons]]
+
[[Category:Troubleshooting]]

Revision as of 12:43, 13 July 2012

Filesystem Permissions

A lot of problems people have with mythtv can be traced back to filesystem permission issues.

Common Issues

It's quite common for the mythtv backend or frontend programs to not have sufficient permissions to read or write some areas of disk. The details vary by operating system and distributor. The examples given here are for Linux.

Some useful questions to ask when troubleshooting:

  • What user is the frontend running as?
linux$ ps -fade |grep mythfrontend
  • What user is the backend running as?
linux$ ps -fade |grep mythbackend
  • If they are different users, are they members of the same user group?
linux$ id <mythfrontenduser>  #should return the uid and some gids
linux$ id <mythbackenduser>
  • Are all the directories mythtv uses owned by those users and are they group-owned by that (shared) group?
$ find /var/lib/mythtv -type d ! -user mythtv -exec ls -ld {} \;
$ find /var/lib/mythtv -type d -group mythtv -exec ls -ld {} \;
  • Do the log files have any clues as to what is going on?
$ tail -f /var/log/mythtv/mythbackend.log  #now try doing the thing that is not working
  • If the filesystems are exported (NFS or CIFS/samba), what are the export permissions?
$ less /etc/exports
$ sudo showmount -e
* Do the UIDs and GIDs of frontend and backend users match up across your systems?

Subtle Issues

Unable to record, or watch live TV

You have set wide-open permissions but still can't write to a new disk you just installed:

$ ls -l /media/data/mythtv/
drwxrwxrwx 2 mythtv mythtv 4096 Jun 11 12:08 recordings

On Linux, and possibly other UNIXes, check the permissions of the underlying mount point:

$ grep media /etc/fstab
/dev/sdb1 /media/data  ext4 defaults   0  2
$ sudo umount /media/data
$ ls -ld /media/data
drwxr-xr-x 1 root root 4096  Jun 10 11:08 /media/data

The fix is to make the mount point owned by the user that needs to write there.

# chown mythtv:mythtv /media/data
# chmod g+w /media/data
# ls -ld /media/data
drwxrwxr-x 1 myhtv mythtv 4096  Jun 11 13:08 /media/data

Also: check the permissions of each step in the mount path, from /.

Also: some distributions use the path /media as a location for automatically mounting removable storage. So you may do better with a different mountpoint path e.g /data.

Reference: MythTV-Users mailing list "Can't watch TV Permission Denied opening recording file despite chmod a+rwx"