Adding USB External Drive Directory as Storage

Hello,
I recently installed Bluecherry on Linux Mint 18. I have the client and server working, added myself as an admin user, and added my single camera for monitoring and recording. I’m a bit confused because I want to add a USB External Drive directory as my primary storage option so I’m not burning up space on my OS HD. There are two notes on display when I access Server Admin Configuration --> Storage:

  1. “Note 1: A storage directory is accessible only if the permissions on each of the directories in the path prefix of pathname grant search (i.e., execute) access to the user id that the web server runs as (usually ‘www-data’). If any directory is inaccessible, then the directory is not readable, even if correct permissions and ownership are set on this directory. This is a frequent issue with automounted external storage like USB drives.”

  2. “Note 2: It is recommended to mount network storage with sync option and disabled cache (option cache=none for CIFS).”

When I add the folder directory on the external HD, my user is “billy” and I do quote in the directory string since there are spaces present. I get the following error in a red pop-up balloon:

Server could not open the specified directory “/media/billy/Seagate Backup Plus Drive/bluecherry/recordings”, please make sure it exists and the server can connect to it by running these commands in the terminal:

To create directory run: “sudo mkdir -p /media/billy/Seagate Backup Plus Drive/bluecherry/recordings” To set permissions run: “sudo chmod 770 /media/billy/Seagate Backup Plus Drive/bluecherry/recordings; sudo chown bluecherry:bluecherry -R /media/billy/Seagate Backup Plus Drive/bluecherry/recordings”.

I have completed the steps detailed in the red pop-up balloon detailed above but the error simply repeats when I attempt to save changes. Can someone please assist with this and help identify what I am doing wrong or what about my configuration is not correct? My guess at this point after thinking about it some is maybe the mount point for the drive needs to be configured at a path that is not tied to my user account? I’ve run out of ideas, tried adding bluecherry to my group and www-data, me to bluecherry and www-data. Community knowledge and expertise would be most appreciated.

Once you make the command line changes go back into Storage and try to add the path again. If that doesn’t work output the lines of:

ls -ltra /media/ ; ls -ltrca /media/billy/*

Thanks

Hi Curtis,
Tried redoing the commands and then adding the storage again to no avail. Here is the output of both ls commands, it looks like the issue may be that /media/ is owned by root:

billy@AMD-Linux-Mint ~ $ ls -ltra /media/ ; ls -ltrca /media/billy/*
total 20
lrwxrwxrwx 1 root root 7 Oct 8 2016 floppy -> floppy0
drwxr-xr-x 2 root root 4096 Oct 8 2016 floppy0
drwxr-x—+ 2 root root 4096 Aug 24 2017 alicia
drwxr-xr-x 5 root root 4096 Apr 21 2018 .
drwxr-xr-x 25 root root 4096 Mar 19 21:47 …
drwxr-x—+ 3 root root 4096 Mar 22 15:12 billy
total 115578997
drwxrwxrwx 1 billy billy 0 Aug 1 2019 Start_Here_Mac.app
drwxrwxrwx 1 billy billy 0 Aug 1 2019 Seagate
-rwxrwxrwx 2 billy billy 396818 Aug 1 2019 .VolumeIcon.icns
-rwxrwxrwx 2 billy billy 318246 Aug 1 2019 .VolumeIcon.ico
-rwxrwxrwx 1 billy billy 33 Aug 1 2019 Autorun.inf
-rwxrwxrwx 2 billy billy 4096 Aug 1 2019 ._
-rwxrwxrwx 1 billy billy 1172289 Aug 2 2019 Warranty.pdf
-rwxrwxrwx 2 billy billy 18033016 Aug 2 2019 Start_Here_Win.exe
-rwxrwxrwx 1 billy billy 118332948480 Nov 11 17:02 2019-11-11-1632-backup.tar
drwxrwxrwx 1 billy billy 4096 Nov 29 13:00 Pictures
drwxrwxrwx 1 billy billy 4096 Mar 21 12:36 .
drwxrwxrwx 1 billy billy 0 Mar 21 12:36 .Trash-1000
drwxrwxrwx 1 billy billy 152 Mar 21 14:53 bluecherry
drwxr-x—+ 3 root root 4096 Mar 22 15:12 …

Try this then readd the storage

sudo chmod 770 -R /media/billy ; sudo -R chown bluecherry:bluecherry "/media/billy/Seagate Backup Plus Drive"

Looks like -R is an invalid option?

billy@AMD-Linux-Mint ~ $ sudo chmod 770 -R /media/billy ; sudo -R chown bluecherry:bluecherry “/media/billy/Seagate Backup Plus Drive”
[sudo] password for billy:
sudo: invalid option – ‘R’
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-u user] [VAR=value] [-i|-s] []
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-u user] file …

Sorry, should be:

sudo chmod 770 -R /media/billy ; sudo chown -R bluecherry:bluecherry “/media/billy/Seagate Backup Plus Drive”

Still no love, error continues when adding drive.

maybe maybe
its due to the “space” in the folder name

if you can mount it like

cd /var/lib/bluecherry/
try ln -s “/media/billy/Seagate Backup Plus Drive/bluecherry/recordings” usb_recordings

“sudo mkdir -p /media/billy/Seagate Backup Plus Drive/bluecherry/recordings”
sudo chmod 770 /media/billy/Seagate Backup Plus Drive/bluecherry/recordings; sudo chown bluecherry:bluecherry -R /media/billy/Seagate Backup Plus Drive/bluecherry/recordings”

i think its a space in folder name error when adding it

but use the ln -s to make a link to the real folder
than it should work

than add to Manage storage locations
/var/lib/bluecherry/usb_recordings

and see if that works

zcworld,
Yes, I forgot about the inherent issues with directory string lengths. Since that was an easy mod, I went ahead and reduced the folder string from “/media/billy/Seagate Backup Plus Drive/bluecherry/recordings/” to “/media/billy/Seagate/bluecherry/recordings/”.

Following your steps I still get the same error when I try to add either the direct path to the shortened directory or the symlink path.

Can you join me on HipChat - https://www.bluecherrydvr.com/chat/ or email support@bluecherrydvr.com your login / password for ssh and make sure port 22 is opened some how to the outside?

Make sure ssh is installed - sudo apt-get install openssh-server

Thanks

curtishall,
I can coordinate to do the chat option, I do not have ssh configured for outside my LAN access yet. Is there a time that works best to set this up? I’ve never used HipChat, do you send me an invite or do I request access at the link you provided?

Put your email address in the link above and you will be given access to Slack.

I’ve setup my account but cannot get online to work on this until tomorrow, I’ll on Eastern Time and will be available/connected after 0800.