Files inside of External storage won't show in nextcloud (Snap Package)



As you can see from the attached images files within my hard drive isn’t showing in nextcloud but does show in other places. It is added through the administration using these settings: Imgur: The magic of the Internet When I try and write to the drive it says unable to create file from template: Imgur: The magic of the Internet
This is what happens when I rescan my files: https://imgur.com/a/CF7z8hz It seems to be a permission issue, one problem is that idk how to fix this.

Hope you can fix this, Jeremy

Hello There?

Did you read and understand the → manual ← , specially about the ownership of the mounted drive?

Much luck,
ernolf

image
I followed those instructions and I am still getting messages saying permission denied when I rescan. and now no drives at all are showing in my media folder in nextcloud where I am trying to mount my HDDs, I had it working before but its decided to break itself now after I reformatted one of my hard drives.

In case you didn’t do it:

chown -R www-data:www-data /media/drive1

chown -R www-data:www-data /media/drive2

chown -R www-data:www-data /media/drive…

Then try to run occ this way:

sudo -u www-data /snap/bin/nextcloud.occ files:scan --all

1 Like

it must be

chown -R www-data:www-data /media/drive1

or

chown --recursive www-data:www-data /media/drive1

option “-r” does not exist for chown:

https://www.man7.org/linux/man-pages/man1/chown.1.html

Much luck,
ernolf

3 Likes

Hello,

Snap has very little but very specific set of customization option. You can’t change the location of the default storage unless you follow that exact steps.

  1. External Storage must be mounted under either “mnt” or “media”
  2. Snap must be commanded to access external sudo snap connect nextcloud:removable-media
  3. Config file located at /var/snap/nextcloud/current/nextcloud/config/config.php must be edited for value DataDirectory for the new location (that external drive
  4. Contents of default storage location /var/snap/nextcloud/common/nextcloud/data must be moved to new location

Snap will now store stuff in that new location

Not all occ commands works under snap

Refer here for more details → Change data directory to use another disk partition · nextcloud-snap/nextcloud-snap Wiki (github.com)

Thanks.

So you can’t just mount the whole of the media folder so you have access to all of your files over next cloud like I did before it broke? Just in case I created separate mounts for the different drives and it still doesn’t work

Now when I run the second command I get this error message

I don’t really think you understand what I am doing, I am trying to mount external storage inside of next cloud using the external storage app not change my data directory for next cloud


I set the drive up to mount individually and it highlighted red and says external mount error

Like you I had some troubles setting up my external storage to make it work at the beginning.

What you need is make sure that “www-data” has the ownership of all your files (also the root directory) in the mounted drive, and the permissions iirc are set to -rw-r-----.

And make sure you have configured correctly your external storage in the Nextcloud settings:

  • Folder: is the folder where you can access you external drive in Nextcloud
  • External storage: local
  • Authentication: none
  • Configuration: path/to/your/hd.

I have set the permissions according to your instructions and it still won’t work, same error as before

Hello,

As I wrote earlier, anything apart from that external mounting process will not work with “snap” deployment.

Refer here → Configure Nextcloud snap · nextcloud-snap/nextcloud-snap Wiki (github.com)

Snap has extremely limited set of permissible customization. Anything apart from what is mentioned or allowed, will not work.

For deeper customization, you should consider docker or native / direct installation.

Thanks.

1 Like

I switched to the docker version but I am still having the same issue.




image

Hope you can help me, Jeremy