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:-
- Raspberry Pi with raspian already installed. Refer my previous post on installing raspian.
- 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.
sudo apt-get update
sudo apt-get intall ntfs-3g
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.
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.
I think the command is “lsusb” to list the connected usb devices
Thanks for pointing it. I have corrected it now.