Q:

How to use a USB to extend space on a certain folder in Linux?

I am attempting to run a live video stream using RPi-Cam-Web-Interface (elinux.org/RPi-Cam-Web-Interface) to monitor a room while away. Since I will be streaming the video for a 24 hour recording (split into 30 minute segments for easier video manipulation) I will need a lot of space to hold all of the files. 
I have found that the video files are stored in the /var/www/html/media file on the Raspberry Pi and that they are automatically stored there when the RPi-Cam-Web-Interface records video. I would like to mount a USB on this folder to add more space to it and allow the large recordings without running out of space.
Is this possible to be configured or should I attempt to locate where the RPi-Cam-Web-Interface is storing the videos in its configuration and change it to the USB drive (I have looked already for it and have not been able to find it)? 

A:

Simply mounting the usb drive on /var/www/html/media will over shadow the existing contents, which maybe acceptable. However you may want to copy the contents to the usb drive before mounting it in the same place. This can be accomplished with rsync and mount --bind
# TODO kill processes using /var/www/html/media until restarting them after bind mounting usb dirve to /var/www/html/media.
# Smart copy the existing contents to usb drive
rsync -av /var/www/html/media/ /path/to/usb/drive
# sync to make sure the folder contents are transfered and no writes are waiting.
sleep 0.5 && sync
sudo mount --bind /path/to/usb/drive /var/www/html/media/
# TODO restart processes using /var/www/html/media 

