Hello There, Guest! Login Register
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Unable to change User rights on mounted hard disk

#1
I have successfully installed Plexpi Vs. 1.3 on Pi 3B+ and use an external hard disk for all my media files. Everything works perfect!
Now I have installed Nextcloud on the Pi which is also working fine except that I have no chance to use the external hard drive for the nextcloud data directory. After several tries I found out that I cannot change the user rights for the data folder one the disk. 
chown -R www-data:www-data /media/pi/<drive name>/<data path> or sudo chown -R www-data:www-data /media/pi/<drive name>/<data path>has no effect at all even if I use sudo -i
I also tried to use a memory stick instead of the hard disk - same result....
A fresh install of Nextcloud with the external path immediately gives an error and the procedure I found for changing the data path after an installation fails as well. Checking the user rights of the directory still shows pi as owner.
I'm not familiar with Debian - so what shall I do???
 Reply
#2
Hi, I'm not an expert here, but I think that pi is the user who mounts the drive.

You can try to unmount the drive and remount it specifying uid=<www-data user id>,gid=<www-data group id> as mount options.

To find the www-data uid and gid you can run
Code:
id www-data


Let me know if this helps!

Bye
 Reply
#3
I did not "solve" the problem but I found a workaround. My hard disk was automatically mounted in '/media/pi/XXX' and this seemed to be the problem because I could not change the user as long as it was mounted under '/pi/....' Now I mount the drive using an entry in fstab in '/media/XXX' and everything works as expected. It seems that even at root I cannot make any changes in folders under '/pi' .....

A shor warning: During testing I was able to kill my whole system (it did not boot anymore) with an entry in fstab which I thought was correct but seemed to contain an error. I had to reload the image on the SD card and redo all steps......
 Reply
#4
That's exactly what I suggested you to do :)

To avoid the fstab errors, after changing it you can test your new settings before rebooting running
Code:
sudo mount - a

 Reply
#5
(09-24-2018, 03:57 AM)Heinerlein Wrote: I did not "solve" the problem but I found a workaround. My hard disk was automatically mounted in '/media/pi/XXX' and this seemed to be the problem because I could not change the user as long as it was mounted under '/pi/....' Now I mount the drive using an entry in fstab in '/media/XXX' and everything works as expected. It seems that even at root I cannot make any changes in folders under '/pi' .....

A shor warning: During testing I was able to kill my whole system (it did not boot anymore) with an entry in fstab which I thought was correct but seemed to contain an error. I had to reload the image on the SD card and redo all steps......


If ever that happens again, instead of formatting your SD card and starting from scratch (even if it's a great learning curve), I recommend you boot into single-user mode and try to edit the fstab file directly. I've had to do it a few times when I'd messed something up.
 Reply
 
 
Forum Jump:

Users browsing this thread: 1 Guest(s)