Cannot get media server running in combination with external USB HD (using Samba)

I’m in the process of switching functionality of two of my Raspberry Pi’s (3 and 4), and got the Raspberry 3 running fine (used it for DietPi running a wireless access point).

However, I can’t get my Raspberry Pi running DietPi with a media server using the music stored on my external USB HD (files stored in /Music folder on that drive). I use DietPi and am able to get Samba running on it, and accessible on the rest of my network. But I can’t get media servers running. I’ve tried MiniDLNA, Airsonic, and Ampache, followed the DietPi instructions, and none of them work. Specifically, none of them are starting successfully primarily because they don’t seem to find the files on the external HD. Previously I had this set up and working on my Raspberry Pi 3 using MiniDLNA and Samba, and have used this successfully for about 2 years. I wanted to “upgrade” to the Pi 4 to hopefully get better performance.

My initial thoughts is this is a permissions issue. I see that DietPi creates a sub-folder in the “/mnt” folder called “dietpi_userdata” and does a “chown” command for the folder, along with a “chmod 0775”. I changed the Samba setup so that my user data (the “dietpi_userdata” folder) is located on the external hard drive, and I’ve moved the files from my “/Music” folder to that same folder underneath the “diepi_userdata” folder, but it still doesn’t work (although I’ve only tried that with MiniDLNA, and not Airsonic or Ampache yet).

Has anyone else got MiniDLNA, Airsonic or Ampache working with music files located on an external HD, and if so, how? I’ve tried installing Samba at the same time as the media server, and also tried it by installing Samba first, moving my userdata to the external HD, and then the media server, but it’s still not working.

Thanks in advance for help with this.


let’s put samba aside for time being. As I understood, your external HDD already contain the media files. correct?

let’s check your HDD and how it is mounted

cat /etc/fstab
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

This problem is now solved, and the media server (MiniDLNA) is now working.

Before I saw the response to my message, I performed both “chown dietpi:dietpi” and “chmod0775” commands on the “/Music” folder of my external HD (which is also the Samba share), and that worked!

This seems to be a “bug”, or at least something that should be fixed, with DietPi. DietPi never executed these commands when the userdata was moved to the Samba share, so it seems like this should be an easy fix.

I may end up trying another media server anyhow (as noted above, I had tried Airsonic), and I’ll report back the results.



Probably there is a misunderstanding on your side. Coping files using cp will never adjust file permissions nor file ownership to a specific user. usually files are copied with permission as is and thinks like user permissions would need to be set individually. This has nothing to do with DietPi as it is Linux standard behaviour.

I’m still confused.

The external HD is a 5TB drive formatted under Windows 10, and the files were already on the HD prior to hooking it up to the DietPi RPi4 box. Also, this same HD was used with my RPi3 box (running Raspberry Pi OS), also running MiniDLNA. I was “upgrading” by moving over to my RPi4 and using DietPi as the OS. I had the user “Pi” on the old RPi3 box, and assume all the permissions were set for that folder (/Music) with that user. Therefore, when I hooked this up to the DietPi / RPi4 box, which had the primary user of “DietPi”, wouldn’t the permissions need to be changed to “DietPi” for this folder? And if the “dietpi_userdata” folders were moved by DietPi from the SD Card to the external HD, shouldn’t DietPi also change the permissions automatically on the moved dietpi_userdata folders?



files and folder permission are set for individual users and groups. Moving the disk to another system will preserve permission from the original system. Means they still pointing to the old pi user, which is not existing on DietPi. Therefore you would need to set permission correctly again yourself. But this has nothing to do with DietPi. It would be same on other Linux based system. Just connection a disk, will never adjust permissions on that disk.

To be more precise: File and directory owners and groups are tied to user IDs and group IDs. When attaching a drive from one system to another, the same IDs may be attached to a different user name, or none at all, which may cause quite some issues or confusion :wink:. On DietPi, the dietpi user and group both have the ID 1000. AFAIK on Raspberry Pi OS, those two IDs are used for the user pi. So for those, if my assumptions are right, nothing needs to be changed. But in general, it makes sense to freshly chown the content of newly attached drives, at least everything that was not owned by root (which always has ID 0, both user and group).