ecotec
Posts: 64
Joined: Mon Jul 01, 2013 1:10 pm
Location: Norfolk

HDD permissions and mini DLNA problem

Thu Nov 17, 2016 7:24 pm

Hi,
I'm looking for some help with a mini DLNA setup, I have successfully installed minidlna and edited the config file and it shows up on the network but I cannot see the files to play them.

So far I have:
1 Changed the user to "pi" and "root" in the minidlna config file - resulted in minidlna not being seen on the network despite a force reload.
2 Added minidlna to the pi group (sudo usermod -a G pi minidlna)
3 Checked and double checked the permissions on the external HDD (where the media is located) and all users can access the files.
4 Edited fsab and added a final entry to mount (/dev/sda1 /media/pi/samsung_4tb ext4 defaults 0 2)

Have I forgotten something simple?
Many thanks in advance!
b raspbian running get-iplayer and mini dlna server
b+ running volumio
pi 2 - dietpi - pihole, ssh and a few other bits

User avatar
Paeryn
Posts: 3010
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: HDD permissions and mini DLNA problem

Thu Nov 17, 2016 8:59 pm

Is there anything in the log file to give you any clues (/var/log/minidlna.log usually)?

The only thing I can think of for files not showing up could be if the database cache isn't read/writable.

I have minidlna set up to run as user pi and it works fine, I don't have either a user or group called minidlna (then again I compiled it myself, version 1.1.5 rather than 1.1.2 that is on the repo). I don't remember doing anything special bar increasing the number of system inotify watches (and that was only to stop it giving warnings in the log, it wasn't causing any failure).
She who travels light — forgot something.

ecotec
Posts: 64
Joined: Mon Jul 01, 2013 1:10 pm
Location: Norfolk

Re: HDD permissions and mini DLNA problem

Fri Nov 18, 2016 7:24 am

Thanks for your reply Paeryn

I've checked all the folder file paths in the conf file

Code: Select all

/var/cache/minidlna
/var/log
(I've also got /var/log/minidlna)
I've checked the permissions and they all look fine and log files are being written - but without much helpful in there.

I copied over a file from the external hard drive to /home/pi/Music and reloaded, the file appeared immediately, so it does look to be a permissions/config issue?

Any ideas?!
b raspbian running get-iplayer and mini dlna server
b+ running volumio
pi 2 - dietpi - pihole, ssh and a few other bits

User avatar
Paeryn
Posts: 3010
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: HDD permissions and mini DLNA problem

Fri Nov 18, 2016 10:28 am

ecotec wrote:Thanks for your reply Paeryn

I've checked all the folder file paths in the conf file

Code: Select all

/var/cache/minidlna
/var/log
(I've also got /var/log/minidlna)
I've checked the permissions and they all look fine and log files are being written - but without much helpful in there.

I copied over a file from the external hard drive to /home/pi/Music and reloaded, the file appeared immediately, so it does look to be a permissions/config issue?

Any ideas?!
If it appears when in /home/pi/Music did you add the hard drive's folder to the search locations? The database cache is obviously fine if it's picking up files from your home directory. My music is stored on a USB drive and it's set to only check there. I can't think of anything else if you aren't getting any errors logged.
She who travels light — forgot something.

ecotec
Posts: 64
Joined: Mon Jul 01, 2013 1:10 pm
Location: Norfolk

Re: HDD permissions and mini DLNA problem

Fri Nov 18, 2016 3:11 pm

Thanks Paeryn

Still encountering issues have:

checked the config file again - the /media/pi/samsung_4tb/tv is correct and I can paste it into the file explorer
I've editing fstab and checked the entry, all seems fine (rebooted)
I've followed the advice here: https://everbit.wordpress.com/2013/04/0 ... pberry-pi/
to edit:

Code: Select all

3. MiniDLNA doesn’t have permissions to view newly created folders in the watched media_dir
I solved this by running MiniDLNA as the user root instead of minidlna. Edit init.d and add USER=root near the top.
sudo nano /etc/init.d/minidlna
USER=root
And User=pi
no change...

What's the best way to check permissions of a drive, groups that can access?
This drive was in use with a pi1, i've moved it over to a pi2 I have spare - is that causing an issue?
Anyone have any thoughts?

Thanks!
b raspbian running get-iplayer and mini dlna server
b+ running volumio
pi 2 - dietpi - pihole, ssh and a few other bits

ecotec
Posts: 64
Joined: Mon Jul 01, 2013 1:10 pm
Location: Norfolk

Re: HDD permissions and mini DLNA problem

Fri Nov 18, 2016 3:19 pm

Log file - is sql.c:41: error: SQL ERROR 8 [attempt to write a readonly database] the issue?

Code: Select all

[2016/11/18 15:12:06] sql.c:41: error: SQL ERROR 8 [attempt to write a readonly database]
.....
[2016/11/18 15:12:36] minidlna.c:1004: warn: Starting MiniDLNA version 1.1.2.
[2016/11/18 15:12:37] minidlna.c:1043: warn: HTTP listening on port 8200
[2016/11/18 15:12:37] inotify.c:198: warn: WARNING: Inotify max_user_watches [8192] is low or close to the number of used watches [0] and I do not have permission to increase this limit.  Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches.
[2016/11/18 15:16:13] minidlna.c:153: warn: received signal 15, good-bye
 is low or close to the number of used watches [0] and I do not have permission to increase this limit.  Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches.
b raspbian running get-iplayer and mini dlna server
b+ running volumio
pi 2 - dietpi - pihole, ssh and a few other bits

User avatar
Paeryn
Posts: 3010
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: HDD permissions and mini DLNA problem

Sat Nov 19, 2016 12:23 am

ecotec wrote:Log file - is sql.c:41: error: SQL ERROR 8 [attempt to write a readonly database] the issue?
That sounds like SQLite can't write to minidlna's database. Either the user minidlna is being run as doesn't have permission to write to it or the database is locked as readonly. You could always try deleting the database (or just rename/move it incase you need to put it back) and let it recreate a new one (files.db in where ever db_dir= in minidlna.conf points to, mine is /var/cache/minidlna/files.db). I'm not sure how SQLite manages things but it might have caused issues when you tried changing the user that minidlna runs as.
She who travels light — forgot something.

ecotec
Posts: 64
Joined: Mon Jul 01, 2013 1:10 pm
Location: Norfolk

Re: HDD permissions and mini DLNA problem

Sun Dec 11, 2016 5:06 pm

I've still not fixed these issues despite spending an age trying to so:

I've added minidlna to the pi group using:
sudo usermod -a -G pi minidlna

I've created directories for log and database
sudo mkdir /var/{cache,log}/minidlna
sudo chown minidlna:minidlna /var/{cache,log}/minidlna

I've edited the config file and if I place files on the sd card and add the location
they appear fine and I play them without issue. So minidlna is working - it's just I
can't see the files on the HDD.

I can't seem to get minidlna to run as user pi or root, if I change it just disapears from the
network.
The log is not displaying anything that looks important.

I've followed some of the notes on this thread: viewtopic.php?f=35&t=16352

How can I check the permissions of the hard drive so I can provide access for minidlna?

RE: Paeryn » I've got my DB files saving to: db_dir=/home/pi/.minidlna
In the folder is a file "files.db" owned by minidlna so it looks fine?
b raspbian running get-iplayer and mini dlna server
b+ running volumio
pi 2 - dietpi - pihole, ssh and a few other bits

Return to “Troubleshooting”