How to use a partition of a disk as a Dedicated Drive for ZoneMinder, v1.31.46. on Ubuntu 18.04 LTS Computer

This post explains how to use a partition of a disk of a  PC to store zoneminder events instead of saving on the computer ( At /var/cache/zoneminder/events).

To enable to write data of zoneminder to the partition of the drive , It is necessary to mount the usb drive  on the file system of the PC .

For the installation details of Zoneminder please refer my earlier post 

For the latest details please refer the following site

How to use a partition of a disk as a Dedicated Drive for ZoneMinder

First make a partition of the disk and formatted it to ext4 .

For partitioning , It is easy to use GParted-LiveCD Ref https://gparted.org/download.php (You will have to download GParted live and write it to a cd )

 

After rebooting you will be able to see the partition using following methods

Open the Ubuntu terminal

ls -l /dev/disk/by-uuid

Screenshot from 2018-08-29 23-33-41

Figure 1 :-Getting details of disk using the Ubuntu terminal ( ls -l /dev/disk/by-uuid )

Screenshot from 2018-08-29 23-32-05

Figure 2:- Getting details of disk  using gnome-disk-utility

 

Screenshot from 2018-08-29 23-31-16

Figure 3:-mounted disks.  The sda3 was named as zmdata during the partitioning

You can see the sda3 is mounted on /media/bkjaya1952/zmdata. But without mounting on the file system of the PC zoneminder  will not be able to write data in to sda3. Therefore you will have to create a Systemd Mount Unit.

Creating Systemd Mount Unit

Open the Ubuntu terminal

sudo mkdir /mnt/sda3

sudo gedit /etc/systemd/system/mnt-sda3.mount

and paste the following codes into mnt-sda3.mount and save
(details of uuid of usb was taken from figure 1 and figure 2)

Screenshot from 2018-08-30 16-29-23

Figure 4:-Codes in mnt-sda3.mount

sudo systemctl enable mnt-sda3.mount

sudo systemctl start mnt-sda3.mount

Then restart the computer

Now if you see the folder /mnt/sda3 ,you can see that the disk partition is mounted on /mnt

Screenshot from 2018-08-30 09-31-46

Figure 5:-The sda3 Partition is now mounted on the file system of the PC

If you compare Figure 2 and Figure 5 You can see the sda3 is mounted on the file system now

Create a folder called “zoneminder” on the mounted sda3. Then create folders “events”  with in the folder “zoneminder”

Open the ubuntu terminal

cd /mnt/sda3

mkdir zoneminder

cd zoneminder

mkdir events

sudo chown -R www-data:www-data /mnt/sda3/zoneminder

sudo chown -R www-data:www-data /mnt/sda3/zoneminder/events

Screenshot from 2018-08-29 23-46-46

Figure 6:-

Create a config file under /etc/zm/conf.d . Name the file anything you want just as long as it ends in “.conf”. Add the following content to the file and save your changes:

(In my case I have used ajp.conf as the file name )

sudo gedit /etc/zm/conf.d/ajp.conf

and pasted following codes and  saved  the file in /etc/zm/conf.d

Screenshot from 2018-08-30 16-42-30

Figure 7:-

 

Open the ZM console and go to Options/Storage and add a NewStorage

added Storage path as /mnt/sda3/zoneminder/events

Please refer the following figure for the details

Figure 8:-Creating  a New Storage for the Monitor

Then enter following command on the Ubuntu terminal to start zoneminder.

sudo systemctl start zoneminder

Screenshot from 2018-08-30 09-37-44

Figure 9:-ZM Console and the monitor

 

Screenshot from 2018-08-30 09-41-26

Figure 10:- Saved ZM events on the mounted disk partition

( At/mnt/sda3/zoneminder/events)

 

Reference :-

Zoneminder Official Installation Guide

Andrew Bauer’s  blog-page

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s