miniDLNA starts indexing files then suddenly stops

That is, I was able to configure my router (Archer C7 v5) to automatically mount my external HDD (4 TB) with NTFS filesystem on /mnt/sda1 using ntfs-3g, fdisk and block-mount packages.
Also Ive added samba36-server and luci-app-samba package to share the hard rive access too.
Over the network share the hard drive is still accessible, also through ssh is accesible and I can see my files there but miniDLNA for some strange reason does not index my files. I mean, when ever I restart the router or just restarting the service, it does starts indexing then after a while the indexing list shows as -1 and then goes to 0. The DLNA server is being catcher by my TVs on the network but doesn't show any files there and I want this service because not all the TVs are compatible with samba share.

I had the same problem, the database gets to big to be generated/handled by the Archer C7.
QUESTION: were is the database for minidlna stored?

And avoid NFTS if possible, add additional complexity and memory usage. If possible use native Linux filesystem.

My solution was a RPi4 for DLNA service (and more).

1 Like

There's a section of the wiki that suggests using a linux machine to build the database first if you run into this problem, might be worth a try. Or if you know someone who has a router with enough memory you might see if they'd let you borrow it long enough to build the dateabase, just store the log and database on the drive you're using, then once the database is built you can use your archer again and just point the log and database in minidlna config to the drive where the log/database is already located.

It's been so long since I've used the default location I can't remember where it is, but you can go to Luci>Services>Minidlna>Advanced Settings and you should see the database location there.

1 Like

I did this for my setup, but with increasing size of the database it was no longer possible to use the database with minidlna on the Archer C7. Use a bigger device (or RPi) for minidlna.

FYI, I have minidlna and samba running stable for years on a Zyxel NBG6716, which IIRC is similar to your device. It indexes and serves over 9000 files off a usb-drive.

However i am using ext4 as filesystem on the usb-drive
database location is /var/run/minidlna (the NBG has plenty of space)
the db itself is about 28MB, and the art_cache is about 6MB.

I suggest you check your available space/memory (IIRC /var/run is mapped to RAM)
and the logs of course.

It really depends on the number of files. I have now more than 24000 files and there is no changce to get that running on the Archer C7 (database is now about 78M). I think the limit was about half to generate the database, a little bit higher if the database was generated externally on server. This device has onlz 128MB of RAM.

probably NTFS is another killer.
and he has SMB also runing...

Thanks for the many replies and sorry for taking me this long to reply.
In my case I can't remember how much files are indexed but anyways, since the storage device is an external USB hard drive (a Lacie 4 TB), sometimes I do detach it from the router to take it on a trip, so for this reason NTFS filesystem is a must.
Anyways, the miniDLNA database was previously generated on a old config when I had a Netgear WNDR3800 with DD-WRT and it could generate it without any problems, so there wouldn't be any reasons for OpenWrt can't do it (since its a much more advanced firmware).
The database I have it on the same same NTFS location that has my files that would be /mnt/sda1
Whats different on my OpenWrt setup than DD-WRT setup is that, I used to have a 1 Gb ext3 partition on the same drive as /dev/sda2 that had a part of the system copied to it with with a startup script the when the drive was detected it created this symlink to this parts with and in there it was the miniDLNA database and log file, so what I done after changing to OpenWrt I deleted this ext3 partition and copied the db to the NTFS partition.

Ever since I used it many many years ago, this was a problem. And decades later, it remains a problem. This is partly why just a few minutes ago, I created a thread asking for this:
It is much, much better. If anyone who's anyone here reading this, please, please please, port LMS to openwrt, create a luci app for it, and user base of openwrt will reach the sky. Trust me! But really, this is a great sever that support loads and loads of streaming devices out there.

So what I was talking of my old setup on DD-WRT with miniDLNA that used to work and then I was able to recover the startup script, it was like this:

#! /bin/sh
sleep 10
if [ -f /mnt/sda1/.optware.enable ]; then
 if [ -f /mnt/sda2/.optware.enable ]; then
  mount -o bind /tmp/mnt/sda2/bin /bin
  mount -o bind /tmp/mnt/sda2/etc /etc
  mount -o bind /tmp/mnt/sda2/lib /lib
  mount -o bind /tmp/mnt/sda2/opt /opt
  mount -o bind /tmp/mnt/sda2/usr /usr
  mount -o bind /tmp/mnt/sda2/root /tmp/root
  mount -o bind /tmp/mnt/sda2/jffs /jffs
  sleep 2
if [ -d /opt/usr ]; then
 export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
 if [ -f /tmp/mnt/sda1/.minidlna.enable ]; then
  sleep 2
  minidlna -f /opt/etc/config/minidlna.conf
  sleep 4
  echo "nameserver 2001:4860:4860::8888" >> /tmp/resolv.dnsmasq
  echo "nameserver 2606:4700:4700::1111" >> /tmp/resolv.dnsmasq

Is it possible to do something like this so I can have more space in the router using a ext3 partition with 1 Gb on /mnt/sda2 where I could also be able to store the miniDLNA database?

PD: Ive deleted this last post by mistake (but I was able to recover it), I wanted to add the link of the original post where I got this setup (hope that I'm not breaking any rules but putting this link that is from DD-WRT forum, in case that rules are being broken sorry).

You can put the database on the ext3 partition (or anywhere you'd like), just point to it in minidlna config.

Thanks, for the reply but as what I was saying, if this solution is possible (its not just another partition where to store the database. As it can be seen on the script, its the entire filesystem that is copied to this ext3 partition and with the help of symlinks you point the system directorys to the new copied on the partition, that way you have the space assigned to that partition so you have plenty of room to make other stuffs besides of miniDLNA too.
so wat Im asking if this solution could also be applied to OpenWrt with some slight mods.

cd /tmp/mnt/sdb2 
mkdir etc opt root bin lib usr opt/lib 
touch optware.enable 
chmod 755 etc opt root bin lib usr 
chmod 755 opt/lib 
cp -a /etc/* /tmp/mnt/sdb2/etc/ 
cp -a /bin/* /tmp/mnt/sdb2/bin/ 
cp -a /lib/* /tmp/mnt/sdb2/lib/ 
cp -a /usr/* /tmp/mnt/sdb2/usr/ 
mount -o bind /tmp/mnt/sdb2/etc /etc 
mount -o bind /tmp/mnt/sdb2/opt /jffs 
mount -o bind /tmp/mnt/sdb2/bin /bin 
mount -o bind /tmp/mnt/sdb2/lib /lib 
mount -o bind /tmp/mnt/sdb2/usr /usr
umount /jffs 
mount -o bind /tmp/mnt/sdb2/root /tmp/root 
mount -o bind /tmp/mnt/sdb2/opt /opt 
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'

Sorry, I'm not really understanding what you're trying to do, maybe someone else can help, if you're worried about the size of the database there's probably no need to, I have around 15,000 songs and 1,000 movies and my db is only 40mb.

Ok, I was finally able to get it working!
Ive used some part of what was said, still don't know the use of some line or where are some directorys.

Ive made 3 partition:

  1. NTFS 3,9 Tb (Data), ntfs-3g package
  2. ext3 768 Mb (System), kmod-fs-ext4
  3. swap 256 Mb
cd /mnt/sda2
mkdir etc bin lib usr
chmod 755 etc bin lib usr
touch .optware.enable
cp -a /etc/* /mnt/sda2/etc/
cp -a /bin/* /mnt/sda2/bin/
cp -a /lib/* /mnt/sda2/lib/
cp -a /usr/* /mnt/sda2/usr/
mount -o bind /mnt/sda2/etc /etc
mount -o bind /mnt/sda2/bin /bin
mount -o bind /mnt/sda2/lib /lib
mount -o bind /mnt/sda2/usr /usr

Line that I don't understand the use and how to adapt it to OpenWrt:

export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'

So far I don't know where to find the directorys "root" and "opt".

After that Ive set the miniDLNA log and database to be registered on /etc

Also on System > Startup > Local Startup

if [ -f /mnt/sda2/.optware.enable ]; then
 mount -o bind /mnt/sda2/etc /etc
 mount -o bind /mnt/sda2/bin /bin
 mount -o bind /mnt/sda2/lib /lib
 mount -o bind /mnt/sda2/usr /usr
sleep 2

After Ive restarted miniDLNA service it finally could index all files!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.