Can I move my media files to a different path or partition on the server?
Question:
I have installed Centova Cast on a small partition on my server, and I want to place my media files on a different, large partition on the server. How can I do this?
Answer:
This is accomplished through the use of a bind mount. The procedure for configuring a bind mount is documented in the Client Data (Linux) section of the Internals Reference Manual.
If your Centova Cast server is already hosting client data, you will need to move the existing data to its new home prior to setting up the bind mount. The general procedure for doing so involves the following steps:
Temporarily disable your Centova Cast cron jobs.
mv -f /etc/cron.d/centovacast /etc/centovacast-cron.disabledStop any streams that may be online.
/usr/local/centovacast/bin/ccmanage batch --method=stop --username=allStop Centova Cast.
service centovacast stopMove all client data to the new location. We will use
/home/vhostsas the new path for our client data; change this to whatever path you would like to use.mv /usr/local/centovacast/var/vhosts /homeCreate a placeholder
vhostsdirectory.mkdir /usr/local/centovacast/var/vhostsMake sure ownerships are sane.
chown ccuser.ccuser /home/vhosts /usr/local/centovacast/var/vhostsSet up the bind mount.
echo "/home/vhosts /usr/local/centovacast/var/vhosts none bind" >> /etc/fstabMount the bind mount.
mount /usr/local/centovacast/var/vhostsStart Centova Cast.
service centovacast startRe-enable your Centova Cast cron jobs.
mv -f /etc/centovacast-cron.disabled /etc/cron.d/centovacastOptionally, start all streams.
/usr/local/centovacast/bin/ccmanage batch --method=start --username=all
After performing this procedure, the contents of /usr/local/centovacasst/var/vhosts/
should appear identical to the contents of the /home/vhosts/ directory -- /home/vhosts
has been "grafted" into the filesystem at a new location.
It is important to understand that, as a result of the mount command above,
/usr/local/centovacast/var/vhosts is now essentially a shortcut to the
/home/vhosts directory. While you can see the files in two different places, the
files only physically exist (and thus only take up disk space) in the /home/vhosts
directory.
Accordingly, any changes you make in /usr/local/centovacast/var/vhosts
will actually affect /home/vhosts -- for example, if you delete a file named
/usr/local/centovacast/var/vhosts/user-x/foo.txt, you're actually deleting
/home/vhosts/user-x/foo.txt.
NOTE: This article is for Centova Cast v3 only; an alternate version exists for Centova Cast v2.