External storage problem... its there, but not there

Nextcloud 11.0.1
Ubuntu server 16.0.4 server
On VirtualBox
PHP 7.0
Apache 2.4
Redis Cache
Https and Strict Https

Hello. I decided to try out the external storage option. I enabled the app. I am using virutalbox. So I installed the guest additions and then added two shared folders. Pictures and Photoshop.

Now when I do the df -h in the root dir I do get:

Filesystem                      Size  Used Avail Use% Mounted on
udev                            2.5G     0  2.5G   0% /dev
tmpfs                           496M  7.0M  490M   2% /run
/dev/mapper/nextcloud--vg-root  2.0T   84G  1.8T   5% /
tmpfs                           2.5G     0  2.5G   0% /dev/shm
tmpfs                           5.0M     0  5.0M   0% /run/lock
tmpfs                           2.5G     0  2.5G   0% /sys/fs/cgroup
/dev/sda1                       472M  105M  344M  24% /boot
Pictures                        2.8T  650G  2.1T  24% /media/sf_Pictures
Photoshop                       2.8T  650G  2.1T  24% /media/sf_Photoshop
tmpfs                           496M     0  496M   0% /run/user/0

There I can see that my two shared folders are there /media/sf_Photoshop and /media/sf_Pictures

So when I went into admin and external storage I add a local storage option, name it Pictures, add the mount point of /media/sf_Pictures, then add admin and my username for the access. Green light ready to go.

Now when I go into my main files folder on the site … the folder does not show up. However when I click on external storage on the left of the screen under the options, I do see a pictures folder with an arrow. When I click on this folder it takes me right back to the main files screen of my site.

weird huh

Now I can cd into sf_Pictures and see all of the files there just fine. I thought maybe the permissions are off and they probably are.

so when check the permissions and ownership I get this:

drwxrwx— 1 root vboxsf 4096 Jun 10 2013 sf_Photoshop
drwxrwx— 1 root vboxsf 12288 Jan 24 23:55 sf_Pictures

I tried to run sudo -u www-data chown -R www-data:www-data /media/sf_Pictures

I get back the following message:

cannot read directory ‘/media/sf_Pictures’: Permission denied

soooo now I have no idea what to do to get this working right. As far as I know the new external storage should be on the main folder list on the main screen and not just under the external storage on the left of the screen in its own section.

heeelllp lol

Thanks again.

EDIT
I ran

sudo -u www-data ./occ files:scan root --path=/media/Photoshop

and I got this back

Unknown user 1 media
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |

I have tried replacing the username “root” with www-data, my username on the site, and others…and I get the same message everytime

EDIT 2

I have gotten dropbox to work and also just to see my own nextcloud server to work there as well. I just cant get the local folders to work for some reason still. I`m not sure what to do … but damn it im trying lol

Can you read the folder with the www-data user?

sudo -u www-data ls -lisa /media/Photoshop

sudo -u www-data ls -username /media/sf_Photoshop

tried that and I got permission denied again … not sure whats going on

www-data does not have enough permissions to read the folder. It must be able to read and execute the parent folder.

ya thats what I read and why I was trying change the permissions/ownership with that sudo -u www-data chown -R www-data:www-data /media/sf_Pictures deal that I listed … but that was giving me an error as well.

So at this point im not real sure how to do that I guess

The parent folder is /media, what permission do you use there?

well right now its just the default that it set from just adding it

drwxrwx— 1 root vboxsf 4096 Jun 10 2013 sf_Photoshop
drwxrwx— 1 root vboxsf 12288 Jan 25 01:56 sf_Pictures

I mean the folder itself, not what is within the folder (for your default settings it should be obvious that this can’t work).

oh sorry … its in the media folder and it is this

drwxr-xr-x 5 root root 4096 Jan 25 00:06 media

That looks good. What kind of file system is used on your additional disks? If it is NTFS you have to set the permissions during the mount process in the /etc/fstab file:

On Linux file systems, you mount them and can set the permissions as usual.

well honestly all I did to get them to show up in the file system was just use virtualbox shared folders option. i selected the folder and then rebooted the virtualbox and then the folders showed up.

so after doing that I would still need to do something with fstab? Because at that point they are already mounted.

or maybe I shouldt use the virtualbox shared folders and do it from scratch somehow?

if you cant tell already I am not super familiar with this stuff … it just comes from me looking and looking and trying stuff. I as of yesterday had to literally redo the whole thing from complete scratch as I messed something up and couldnt recover it. So I am not afraid to try stuff … but I try to make sure I go about it the best way possible… which is why I am trying to clarify as much as i can on this.

oh and yes it is NTFS

I am dealing with the same problem, except I’m doing a reinstall with my data folder being shared is on the host.

I read that using the virtualbox shared folder method creates issues and earnestly tried in vain to have the guest OS (ubuntu 16.04.?) Mount on reboot but failed on every try. Now virtualbox is managing it, folders very accessible to all but www-data regardless of chow… I even tried adding the user www-data to the vboxsf group (and admittedly know nothing about potential security issues) but tried anyway.

I hope you find the solution!

Hello everyone. Nice software you guys have. I’ve been working with Nextcloud and I came across this issue too. The way I solved it was in the similar vein to solving the problem with getting access to a VirtualBox share at all. When I initially added my first vbox share it said I didn’t have permissions to view the folder contents. Some guy on stack overflow said to add your user to the vboxsf group so I did and it solved it. So I did this same trick with the www-data user like this:

sudo usermod -a -G vboxsf www-data

and now I can add my external storage

Still having to have all users rescan all media each time i reboot the external smb server. This is lame and frustrating.

Please don’t hijack other topic, the OP had an external NTFS-formatted disk and permission issues.

Let’s close the topic here.