Using a dedicated Hard Drive
On many installs you may wish to dedicate a hard drive or partition for Zoneminder events. There are many reasons why you may wish to do this - security, data segregation, preventing encroachment onto OS partition by zoneminder etc.
It's not terribly difficult to do, but may be non-obvious to the untaught so here's a brief guide.
Some commands here are based on Debian/Ubuntu installs
1. Become root or "sudo -s" to gain root privs.
2. Stop Zoneminder. "/etc/init.d/zoneminder stop" or "/usr/bin/zmpkg.pl stop"
3. Mount your new partition onto the root filesystem, ensuring it is automatically remounted at boot time by editing /etc/fstab -- For the benefit of this guide, I'm calling my new partition /newdrive
Note this new partition can be a local drive, raid partition, lvm/md device, external NAS, SAN, NFS share or SMB share. The only condition is that the I/O throughput should be up to handling what Zoneminder will throw at it. For that speed reason, some favour non-journalled filesystems and accept the extra risk of data protection
4. Locate Zoneminder's "events" and "images" directories. In Debian, these are usually in /usr/share/zoneminder
If you wish to copy the data across, MOVE the events and images directories to /newdrive (Note this will take a long time on systems with many events). Also, DO NOT restart zoneminder if it cannot locate these files as zmaudit.pl will delete the database entries for any events it cannot match files to
If you don't wish to preserve the data, it is MUCH faster to simply delete or rename the original events and images dirs and create new directories in /newdrive and link to them from the original locations. There is no need to remove the "orphaned" entries in the database, zmaudit will take care of those.
Eg:
mkdir /newdrive/events
mv /usr/share/zoneminder/events /usr/share/zoneminder/events_old
ln -s /newdrive/events /usr/share/zoneminder/events
(Repeat for images)
5. Finally, restart zoneminder ( "/etc/init.d/zoneminder start" or "/usr/bin/zmpkg.pl start") Monitor its operation and ensure new events are being created normally and are viewable. Zoneminder should also update the "Disk: %%" on its Console screen to reflect the disk space on its new partition.