To make things easy for this whole process, you can use the command “sudo su” then “cd” to run as the root user and not have to type sudo every time
1) Updating the system:
sudo apt update && sudo apt full-upgrade -y
and reboot:
sudo reboot -h now
2) Install basic utilities for desktop DLNA server:
sudo apt install ntfs-3g minidlna -y
3) Identifying and Mounting drives to system at boot
Identify drives:
sudo blkid
Mount drives to the system:
sudo nano /etc/fstab
Here we add our drives the system. I added mine using the PARTUUID identifiers to the end of the file. A quick example of how I added my drives:
PARTUUID=06ecb0e7-01 /Server/Drive01 vfat defaults 0 2
PARTUUID=b32565ef-01 /Server/Drive02 vfat defaults 0 2
PARTUUID=bd4189b5-34cd-49e9-b7d3-2b72055263c7 /Server/Drive03 ntfs defaults 0 2
PARTUUID=64318921-01 /Secure vfat defaults 0 2
Using PARTUUID is more reliable than using say “/dev/sda1”. If you unplug a drive from your computer, it may not have the same identifier the next time it’s plugged in otherwise, and thus won’t mount properly to your system. The second area is where you want your drives mounted. Next, we choose the drive format. Then we set our mounting options, feel free to edit these if you’re more familiar with them. Followed by a couple more mounting identifiers. Since I chose defaults mounting options, my identifiers are 0 and 2.
After you have finished editing your mounting options you can run “sudo mount -a” to ensure all your drives are properly mounted, then reboot.4) Once your rebooted, we move on to editing our MiniDLNA server configuration.
In terminal enter the following:
sudo nano /etc/minidlna.conf
In this file, go down until you see the line:
#user=minidlna
and remove the #. Keep going in the file until you see a section reading:
# Path to the directory you want scanned for media files.
At the end of this paragraph you should see an example directory already made for you. Add your own media directories here, making sure to delete the example one they gave you. Here are my directories:
media_dir=V,/Server/Drive03/Movies
media_dir=A,/Server/Drive03/Music
media_dir=P,/Server/Drive03/Pictures
Almost done! After you’ve added your directories, go down until you see the line
#friendly_name=
Delete the # and add whatever name you want for your server at the end:
friendly_name=Pi Media
Yes, you can use spaces, as long as it’s on the same line. Save changes to the conf file and close it.
Finally, we are ready to get the DLNA server going. So we run a couple commands in terminal before we start:
sudo service minidlna restart && sudo service minidlna force-reload
Once you’ve finished everything here, hop on your favorite DLNA client and enjoy!
Oh yeah, one last thing. Reboot.