How to use ZFS Datasets for Event Storage

From ZoneMinder Wiki
Jump to navigationJump to search

This is not a treatise on how to use ZFS itself. That is covered very well elsewhere.

Notes:

  • That "storage0" and "data0" are the names for the OPs zfs storage pool, substitute the name of your own pool there.
  • The quotas below are adjustable to your personal needs. Do not just copy those quota sizes, but figure out what you will need to keep the amount of events you want to keep and use an appropriate quota for that.
# zfs create storage0/zoneminder
# zfs create storage0/zoneminder/events
# chown www:www /data0/zoneminder
# chown www:www /data0/zoneminder/events
# zfs set quota=500G storage0/zoneminder/events
# zfs set quota=600G storage0/zoneminder

After doing the above, go into each monitor and change its Storage to the new location.

# ls -l /data0/zoneminder/events/
total 2
drwxr-xr-x  3 www  www  3 Nov  1 08:35 1
drwxr-xr-x  2 www  www  2 Nov  1 08:33 2
lrwxr-xr-x  1 www  www  1 Nov  1 08:33 BackPTZ -> 2
lrwxr-xr-x  1 www  www  1 Nov  1 08:32 FrontPTZ -> 1

Partially copied from the OPs forum post.