/media/*: Permission denied

  • jule_

    jule_ - 2011-04-24


    I am relativly new to Ubuntu and just installed Mediatomb in order to be able to use my UPNP TV to watch videos from the harddisks of my HTPC. I am using Ubuntu 10.04.

    My videos are located on hdd2 which is mounted on /media/hdd2 via the fstab line

    /dev/mapper/sdc1_crypt /media/hdd3  ext4

    The harddisk itself is LUKS encrypted, but I don't think that this is the problem here.

    When I start Mediatomb, the browser interface does not let me access /media/hdd3 to add it to my Database. I always get a popup message

    Error: could no list directory /media/hdd2 : Permission denied

    Since I am a Linux newbee I am not quite sure where to change the permission of this directory.
    ls -la of /media gives me

    drwx------  6 jessica jessica 4096 2010-09-25 12:32 hdd2

    which seems right to me. jessica:jessica is my (only) user/group. Also, I can access /media/hdd2 via Nautilus.

    Which user does Mediathomb use when I start it with /etc/init.d/mediatomb start?

    Any hints how to solve that permission problem are appreciated!



  • BT

    BT - 2011-04-25

    MediaTomb will run as the mediatomb user and group when started via the init.d script. This would explain why MediTomb can't access your files, since the permissions (rwx) only are only set for the owner (jessica).

    You can fix this issue by setting the permissions to allow your files to be world readable. Since you want to share your files, allowing other users to have read access to your files probably isn't a big concern. To apply the new permissions run the following:

    find /media/hdd2 -type d -exec chmod 755 '{}' \;
    find /media/hdd2 -type f -exec chmod 644 '{}' \;

    The first line sets directory permissions to 755 (rwxr-xr-x), and the second line sets file permissions to 644 (rw-r-r-). Please note that this will set permissions for every file and directory in /media/hdd2.

  • jule_

    jule_ - 2011-04-25

    Thanks a lot, amak79.

    It took a while to change all the file- and directory-permissions of the 2TB drive, but now everything works as it should.

    And I learned something about the linux permission system ;-)

    ==> Solved.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks