No permission to external storage

Hi,

I am new with Nextcloud.

I tried all hints about this topic but nothing works.
Errors occured or crashed the system.
Maybe you can help me.

Some Info:

RaspberryPi2
nextcloudpi

The issue you are facing:

I facing problems with my permission on Nextcloud.
I can not write or create on my external storage.
Reading is possible.
Write and create over ssh is possible.
But on the web interface or apps it doesn’t work and this message occured:
"You’ve got no permission to upload or create…"
The external Storage are (USB1 Fat32, USB2 Ext4).
Both got the same problem.

I think I need permission for anything?!

Maybe you can give me some steps do to.


@nachoparker do you know how to help here?

are you using the ‘external storage’ app?

how are they mounted?

Hi,

thanks for the answer.

Yes, I use the “external strorage” app.

The USB-drive is mounted like here, when I use lsblk:

sda1 8:1 0 59.6G 0 part /media/64GB

And in the menu of “nextcloudpi-config” the command “nc-automount” is “yes”

Or did you mean something else?

I have not tried using external storage with automount.

I imagine you have to make the drive writable for the www-data user

I have to mount the USB to use it as external storage.

I also tried to change the permission for www-data.
I use chmod.
But the problem is the ownership for path /media/USBdrive changes everytime after a reboot back to the user root.

Do you have some ideas?

The options are either see if udiskie supports mounting with permissions for a particular user, or mount it manually from fstab

Now it works!

What I have done?

I used the command “sudo su” and after that “sudo chown -R www-data:www-data /media/USBdrive”

After a reboot it works.

Now I am allowed to create/delete files.

I dont know if it`s the best way to do it but now it is working for me:)

Thanks for your help!
Maybe you can tell me whats the reason why it works now?
Cause of “sudo su” as root user?

good to know

I am not sure why it works. udiskie removes and creates /media/USBdrive dynamically, so it shouldn’t survive reboot I think.

I would have to experiment it myself :stuck_out_tongue:

Hehe, it doesnt work anymore.

Error occured on the web interface “http error 500”

After some research, my /dev/root is 100% full.
32 GB full, but I dont know what that should be?!

I think with my try of “chmod” i messed it all.

Now, I remaster the pi.

After that, maybe you can give me some steps?
The issue is still the same, i need full access to my USB device (read and write).

Do I need automount my USB device with nextcloudpi-config?
Do I need permission for www-data, and how I doing it?

Thanks for your patience!

well, if automount doesn’t give you the right permissions ( I would google ‘mount permissions udiskie’ ), then you can always

  • disable automount
  • create the directory with the right permissios
  • mount from fstab

Now, I remastered my pi.

My steps:

On nextcloudpi-config:

  • Noip activated
  • encrypt
  • fail2ban
  • usb automount

In the web interface:

  • external storage app
  • directory for this storage /media/USBdrive

It works!
I can read and write!
No failure with permissions!

I have done it by the exactly same way as many times before. But now it works.
I hope for a longer time:-D

Maybe there was a update?

lol I’m glad

nothing related has changed recently dO_ob

Really big thanks for your support!

But now I have some new questions.

I gave one user the permission for my usb.
And gave it 55 GB from the usb.
But on the web interface, it only shows the user about 26GB…
But I think thats the storage from the sd-card itself and not the external usb.

Now my question, is it possible to use the 55GB for the usb? Or does it only works with internal storage?

Sure, actually that is THE normal way of using NCP

With your setup it will probably work fine, maybe it won’t get the free space right, but that’s it.

In NCP, normally, after automount, you do nc-datadir to move your data to the USBdrive, and you don’t need ‘external storage’.

You can check the wiki and my blog for the steps, or just follow the wizard :wink:

But I think that your setup will also work fine