Manual Installation works on /opt but permission denied on external hdd @BananaPi

Hi there,

I was running OH1.8 and wanted to try OH2, since it’s released as stable. However I’m having some permission problems on my setup.

My Hardware Setup:

I own a Banana pi pro and using it as NAS, running Openmediavault(OMV)3 (with Deluge, mysql, smb, nfs etc). OS is Armbian 5.25, based on Debian 8 Jessie. The system was OMV2, based on wheezy and OH1.8 was working flawlessly on attached SATA HDD.


I updated to OH2. Since I want to move everything away from SD, and bananapi let me boot from sd but have data on sata hdd, I installed it manually as defined in Installation Tutorial. However I got permission denied errors.

To be sure it’s working I fresh installed Raspbian Jessie on a spare Rpi2 and manually installed OH2 and it worked. Then I updated my NAS setup to Jessie based one and re-installed OH2. My permission errors still exist.

HDD is mounted as /srv/dev-disk-by-label-NASDrive and fstab is as:

/dev/mmcblk0p1 / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
#/var/swap none swap sw 0 0
tmpfs           /tmp            tmpfs   defaults        0       0
# >>> [openmediavault]
/dev/disk/by-label/NASDrive /srv/dev-disk-by-label-NASDrive ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,,jqfmt=vfsv0,acl 0 2
# <<< [openmediavault]

Folder permissions are

root@OPENMEDIAVAULT:/srv/dev-disk-by-label-NASDrive/openhab2# ls -l /srv/dev-disk-by-label-NASDrive/
drwxrwsr-x+  6 openhab openhab    4096 Apr 24 20:43 openhab2

When I do

sudo su -s /bin/bash -c '/srv/dev-disk-by-label-NASDrive/openhab2/' openhab

I get Permission denied error as:

root@OPENMEDIAVAULT:/srv/dev-disk-by-label-NASDrive/openhab2# sudo su -s /bin/bash -c '/srv/dev-disk-by-label-NASDrive/openhab2/' openhab
bash: /srv/dev-disk-by-label-NASDrive/openhab2/ Permission denied

I copied openhab2 folder to /opt with same ownership:

root@OPENMEDIAVAULT:/srv/dev-disk-by-label-NASDrive/openhab2# ls -l /opt
drwxr-xr-x 6 openhab openhab 4096 Apr 24 21:07 openhab2

When I run

sudo su -s /bin/bash -c '/opt/openhab2/' openhab

It runs:

Also openhab2.service works for /opt but not if modified for external hdd location.

My linux knowledge is limited. Definitely I’m stuck and don’t know what to do, seeking help to run OH2 on external HDD.

What are the permissions on /srv and /dev-disk-by-label-NASDrive. The openhab user probably doesn’t have permissions to access these directories. You could also log in as openhab (sudo su openhab) and see what happens if you manually change to the directories.

/srv and /srv/dev-disk-by-label-NASDrive had 775 privilages. I changed them to 777 and same error occured.

Normally openhab user had nologin, I allowed it login, defined a password for it and try to execute

root@OPENMEDIAVAULT:/srv/dev-disk-by-label-NASDrive# sudo su openhab
openhab@OPENMEDIAVAULT:/srv/dev-disk-by-label-NASDrive$ sudo su -s /bin/bash -c '/srv/dev-disk-by-label-NASDrive/openhab2/' openhab
[sudo] password for openhab: 
bash: /srv/dev-disk-by-label-NASDrive/openhab2/ Permission denied

Typing ./ also fails even if I logged as openhab.