Media file share using Raspberry Pi

Media file share using raspberry pi can be achieved using Samba file server. You can use Samba file server to store all your media files and share across multiple device on your home network. Raspberry Pi will act as single location for storing all media files.

Things you need:-

  1. Raspberry Pi with raspian already installed. Refer my previous post on installing raspian.
  2. external USB storage device. Note – if you intend to use large USB disk have separate power supply for it.

Prerequiste – You are having raspberry pi with raspian already installed.

Follow following steps to install and configure the server.

  1. sudo apt-get update
  2. sudo apt-get intall ntfs-3g
  3. sudo apt-get install samba samba-common-bin

Once you install the above software on your pi create a folder to mount your USB disk.

4. sudo mkdir /external

note: use command lsusb to list all connected drive.

5. Mount the external drive using following command

sudo mount /dev/sda1 /external

After installing the samba server its time to configure the server. For this you need to modify the smb.conf file. Follow the steps below to configure the server to enable media file share using raspberry pi.

Configuring the Samba server

6. sudo nano /etc/samba/smb.conf

Add following lines at the bottom

[rmediaserver]
comment = yes
public = yes
writable = yes
browsable = yes
path = /external
create mask = 0777
directory mask = 0777

To test the correctness of the parameter use the command testparm

Restarting samba server

Thats’s it. You are done. The shared media file server can be accessed over the network. Following screenshot will show on how we can access on windows machine.

media_file_sahre
Windows example of Media files share

 

Troubleshooting media file share 

  • If you are not able to access file server from other machines, check the smb.conf. Run testparm to check for error.
  • Check for Samba password and user  using the command below. 
sudo smbpasswd -a pi  [ to add user pi ] and followed by password.
  • If you are using large USB drive, make sure to use external power supply. Better using external hard drive with its own power supply.  

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.