0

My minidlna program is attempting to access the /media folder to get the drives mounted there. I have adapted the minidlna.conf file to look specifically for these drives. I get to them and recieve an access denied message. I cannot change the folder permission while they are in the /media folder.

I have tried the following:

  1. change the user in minidlna.conf to the current user effect: cannot access file, permission denied

2.change the user to "root" in minidlna.conf effect: "bad user error"

  1. comment the user out in the minidlna.conf file effect: cannot access files, permission denied.

  2. moved a test folder from a /media folder to a /home folder 4.5 changed permissions to the /home folder to give everyone access to everything effect: cannot access file, permission denied.

    basically, nothing I do will allow the minidlna program to access the drives mounted in the /media folder. I cannot find a way to change the directory path without changing the drive location. my blue ray device can see the folders created by the minidlna program, but these folders are empty. is there a way to unmount and remount to a different directory? (automount rules perhaps?)

    any help would be greatly appreciated. Please understand that I have been a Ubuntu user for about 72 hours.

    P.S.

    I have also tried mediatomb, serviio, and ushare. so far, minidlna has gotten the closest to making this work.

2 Answers 2

2

I had a similar issue and it was all permissions.

Create a group for the users that are going to need access to the media

sudo groupadd mediausers

(use whatever group name is appropriate in the place of "mediausers")

Add a media admin user to manage the media, you should use this user to FTP media to the media folder

sudo useradd --ingroup mediausers mediaadmin

Store your media on a non-system partition and mount that partition in a non-system default folder, we'll make one, assign ownership, and fix permissions on it

sudo cd /media
sudo mkdir servedmedia
sudo mount /path/to/partition /media/servedmedia
sudo chown -R mediaadmin:mediausers servedmedia
sudo chmod -R 775 servedmedia

"-R" means to recurse into the folders, so that everything is changed. 775 is Read/Write/Execute for the owner and group and read and execute for the generic users. It's advisable to go through and only assign execute to the folders and not the files. For a file, it should be "chmod 774 -filename-" and for a folder, "chmod 775 -folder name-" or use FileZilla's properties to fix the folders and files separately. "Execute" must be allowed on folders for users that need to browse or change to that folder. It is inadvisable and bad form to allow Execute to generic users to all files, so that last line is really poor, but will work.

To make that mount point persist across boots, look up how to add that partition to /etc/fstab

Check to see if the minidlna user exists

sudo id -u minidlna

If it comes back with "no such user", add a user minidlna can use and add it to the mediausers group and disallow logins from it as it is a system user and doesn't need a login (-L) or a home folder (-M)

sudo useradd -M --ingroup mediausers minidlna 
sudo usermod -L minidlna

You'll have to verify that minidlna is configured to use that user

sudo nano /etc/minidlna.conf

Find the line that says

# Specify the user name or uid to run as (root by default).
# On Debian system command line option (from /etc/default/minidlna) overrides this.
user=minidlna

Change that (or leave it if your user is "minidlna")

While you're in that file, look for

# Path to the directory you want scanned for media files.
#
# This option can be specified more than once if you want multiple directories
# scanned.
#
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
#   * "A" for audio    (eg. media_dir=A,/var/lib/minidlna/music)
#   * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
#   * "V" for video    (eg. media_dir=V,/var/lib/minidlna/videos)
#   * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera)
media_dir=/media

Make sure "media_dir" reads the path to your media (/media/servedmedia)

Before you close it, look for

# Automatic discovery of new files in the media_dir directory.
#inotify=yes

Un-remark "#inotify=yes" so that it says "inotify=yes"

Close and save it with Ctrl-X / Y / [enter]

Make sure minidlna starts at boot-time

systemctl enable minidlna

Start (or restart) the minidlna daemon

systemctl restart minidlna

There are some issues with iNotify, but those can be a different google search. The default max is 1000 so it should only be an issue if you are flooding your server with file changes.

0

I had a similar problem when mounting my NTFS partition. As you cannot change the permissions I guess that we are speaking about FAT or NTFS partitions and probably USB Devices? This is a bug in udisks, with hardcoded options: https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/682589

I achieved access for minidlna by mounting the desired devices via /etc/fstab. Be sure to add options "default,umask=0000". If the devices automount, just unmount them and run command mount -a in Terminal.

See this answer for more informations: https://askubuntu.com/a/408871/32228

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .