Cannot mount USB local drives

Steps to reproduce

  1. Login onto OC web configuration
  2. Try to add local folder as external storage

Expected behaviour

Indicator for the external storage should go green.
I’m trying to add a local storage as external storage, after allowing local storage from the config.php. I can see the option in the Web UI but no matter what USB drive I select, I cannot see the indicator going green.
My server is just a laptop running Lubutnu 18.04.
I can access those USB drives from my Windows machine on the network by using Lubuntu SMB share.
When I add a test folder from within the installation disk (think /home/user/Music) I can access that folder in OwnCloud with no issue.
The USB drives are NTFS formatted and unfortunately cannot be formatted as they contains TBs of data.

Actual behaviour

Indicator for the external storage stays red, cannot see the content of the folders created

Server configuration

Operating system:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Kernel:
Linux multimedia 4.18.0-22-generic #23~18.04.1-Ubuntu SMP Thu Jun 6 08:37:25 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Web server:
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2019-04-03T13:22:37

Database:
ii mariadb-client-10.1 1:10.1.40-0ubuntu0.18.04.1 amd64 MariaDB database client binaries
ii mariadb-client-core-10.1 1:10.1.40-0ubuntu0.18.04.1 amd64 MariaDB database core client binaries
ii mariadb-common 1:10.1.40-0ubuntu0.18.04.1 all MariaDB common metapackage
ii mariadb-server 1:10.1.40-0ubuntu0.18.04.1 all MariaDB database server (metapackage depending on the latest version)
ii mariadb-server-10.1 1:10.1.40-0ubuntu0.18.04.1 amd64 MariaDB database server binaries
ii mariadb-server-core-10.1 1:10.1.40-0ubuntu0.18.04.1 amd64 MariaDB database core server files

PHP version:
PHP 7.2.19-0ubuntu0.18.04.1 (cli) (built: Jun 4 2019 14:48:12) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.2.19-0ubuntu0.18.04.1, Copyright © 1999-2018, by Zend Technologies

ownCloud version: (see ownCloud admin page)
[ownCloud ] 10.2.0 (stable)

Updated from an older ownCloud or fresh install:
Fresh install

Where did you install ownCloud from:
Ubuntu repository

Signing status (ownCloud 9.0 and above):
not sure

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

No errors have been found.

The content of config/config.php:
Pastebin here

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Command not found, not sure of exact installation path.
List of app from app folder:
comments federatedfilesharing files_trashbin notifications
configreport federation files_versions provisioning_api
dav files files_videoplayer systemtags
encryption files_external firstrunwizard updatenotification
external files_sharing market user_external

List of external app from apps-external folder:
none

Are you using external storage, if yes which one: local/smb/sftp/…
Attempting to use local storage, USB hard drive connected to the server (personal computer)

Are you using encryption:
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…
Not sure, so I’d guess no

Client configuration

Browser:
Mozilla Firefox 67.0.3 (64 bit)

Operating system:
Windows 10 Pro build 1803

Logs

Web server error log

none

ownCloud log (data/owncloud.log)

See pastebin

Browser log

none

{"reqId":"6LbnpeT7jljwva10Rsrr","level":3,"time":"2019-06-19T16:08:29+00:00","remoteAddr":"192.168.0.3","user":"admin","app":"PHP","method":"GET","url":"\/index.php\/apps\/files_external\/globalstorages\/7?testOnly=true","message":"stat(): stat failed for \/media\/vale\/Volume\/ at \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Local.php#135"}

Forget about ownCloud for a moment, are you sure the USB drive is mounted properly in the FS and can access to it?
php code doesn’t seem to be able to access to that folder. Does the server have enough permissions to access to that folder?

If you can access to those files via SMB share, you can try to use the SMB connection in ownCloud instead of the local one.

1 Like

This is the output of mount | column -t

/dev/sdc1   on  /media/vale/Volume               type  fuseblk          (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb1   on  /media/vale/SAMSUNG              type  fuseblk          (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdd1   on  /media/vale/PB                   type  fuseblk          (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sde1   on  /media/vale/Elements             type  fuseblk          (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

Those are the 4 USB drives I’m trying to use in OC, all of them are NTFS. Do they look right? I wouldn’t be sure, sorry.
Regarding using them as SMB, although SMB share from Lubuntu to Windows works, it does not in OC. I treid with session credentials, with username and password, using different mount points. Still nada.
To be clear, as host I have the OC internal IP address (192.168.x.x), for share I tried /dev/sdb1,
/media/vale/SAMSUNG and \multimedia\Samsung (Windows share path), nothing in remote subfolder and WORKGROUP in domain.

If you want to access them through local storage, access to those locations (/media/vale/…) and make sure you can read any files inside it and check the file properties.

For SMB access, it might be better if you can show an screenshot of the configuration. You’re probably setting something wrong.

If you can try “multimedia” as host and “Samsung” as share (assuming that “multimedia” will be resolved properly). You can also try to use the ip address where the SMB shares are as host.
I’d recommend you to familiarize with smbclient, and check if you can access to those shares using smbclient.

1 Like

I’ve tried both configurations, none of them worked so far. You can see from the screenshot attached bothconfigurations for Local and SMB. For SMB I also tried manually inputting the credentials, but it didn’t work.

For local storage, make sure the web server’s user (www-data / apache) can access to the folder without any problem. You might access to the folder, but maybe the web server can’t.

For SMB, the share is just “Samsung” in your case.

1 Like

YES. Thank you so much. Although I still cannot access the folders on OC as a local share, I can now see them as SMB shares. Might not be very elegant but it works.
Thank you again.