Skip to content

How to Mount a Network Share

Claude Pageau edited this page Dec 11, 2017 · 18 revisions

Introduction

This section will describe how to automatically save pi-timolo media files to a remote network share. You will need to have a writeable share setup on a remote computer or device.

Setup a mount point on RPI

Make sure you have the IP address of the network computer that has a share with read/write permissions. I am assuming this is a windows PC in the example. Change the items in bold to match the user login and share on the network computer. Note the windows user will need to have read and write permissions on the network share or you can set share access to Everyone read/write if you don't want a password.

NOTE: You can configure makevideo.sh to save timelapse video's to the remote share mount point. Edit the variables in makevideo.sh to enable this feature per variable comments. Use nano to make changes then ctrl-x y to save.

nano makevideo.sh

Login to Raspberry pi via SSH or terminal session and perform the following. Note you can change the folder name mnt to anything you like.

cd ~/pi-timolo
mkdir mnt
sudo mount -t cifs -o username=loginname,password=password,uid=pi,gid=pi //serverIP/sharename ./mnt

This should mount the remote drive share to the /home/pi/pi-timolo/mnt folder. Check that the share is successful by typing ls mnt You should see the directory structure of the remote share if the share connected OK.

Setup fstab to make mount point permanent

To make the change permanent put an entry at the end of the /etc/fstab file

sudo nano /etc/fstab

Add the following to the end of the fstab file

//serverIP/sharename /home/pi/pi-timolo/mnt cifs username=loginname,password=password 0 0

ctrl-x y to save changes

You should reboot and check to see if the network drive mounted OK.

Create media subfolders on share

If it mounted OK then I would create a motion folder on the remote share

cd ~/pi-timolo
mkdir mnt/motion

Change config.py to point to mount point subfolder

Now just change the config.py file to point to the network share mount

cd~/pi-timolo
nano config.py

Change the appropriate motion or timelapse directory locations eg.

motionDir = "mnt/motion"

Test Changes

Restart pi-timolo and check that new files are being written to the remote network share.

Clone this wiki locally