Home storage for user not writable - HELP

Hello. I have mounted my HD in a different mounting point for may samba share without moving any data of my database.

I just changed the path in config.php and any entry in mysql in accordance with tutorial.

Now everithing works but I cannot anymore write in the database.

If I run

sudo -u www-data php occ files:scan --all

I get

Scanning files for 1 users
Starting scan for user 1 out of 1 (xxx)
Home storage for user xxx not writable
Make sure you're running the scan command only as the user the web server runs as

+---------+-------+--------------+------------------+
| Folders | Files | Elapsed time | Items per second |
+---------+-------+--------------+------------------+
| 0       | 0     | 00:00:00     | 0                |
+---------+-------+--------------+------------------+

I tried to change the data rights:

sudo chmod 777 /srv/dev-disk-by-uuid-304a4dce-e926-4081-a5f7-a308c5d320cf/owncloud

chown -R www-data:www-data /srv/dev-disk-by-uuid-304a4dce-e926-4081-a5f7-a308c5d320cf/owncloud

but after few seconds data are not anymore accessable.

If I try to access the data from samba share I do not have the rights.
From terminal I can see everything at the right place.

What can I try ?

I am also ready to loose all my data and restart from the beginning if it is the case but I really do not know where to start from.
I was yhinking to DROP DATABASE from mysql and create a new one but I do not know what would happend to owncloud.

Forgot the -R? 777 is IMHO too open. From the docs:

sudo find /var/www/owncloud -type f -exec chmod 640 {} \;
sudo find /var/www/owncloud -type d -exec chmod 750 {} \;

Hello alfred. Thanks for the answer.
Iā€™ve run again with -R but still the same issue.
I cannot upload any data because I do not have permission.

It seems there is a process that changes back the rights to the folder.

root@debian:/var/www/owncloud# ls -l /srv/dev-disk-by-uuid-304a4dce-e926-4081-a5f7-a308c5d320cf/owncloud
total 240
drwxrwx---+  6 www-data     1001   4096 May  7 18:41 .
drwxrwsrwx+ 17 root     users      4096 May  7 19:56 ..
-rwxrwxrwx   1 www-data www-data    323 Apr 23 23:36 .htaccess
-rwxrwxrwx   1 www-data www-data      0 Apr 23 23:36 .ocdata
drwxrwxrwx+  2 www-data www-data   4096 Apr 23 21:41 avatars
drwxrwxrwx+  2 www-data www-data   4096 May  7 18:41 cache
drwxrwxrwx+  2 www-data www-data   4096 Apr 23 22:03 files_external
-rwxrwxrwx   1 www-data www-data    145 Apr 23 22:03 htaccesstest.txt
-rwxrwxrwx   1 www-data www-data      0 Apr 23 23:36 index.html
drwxrwxrwx+  6 www-data www-data   4096 Apr 24 11:08 miazza
-rwxrwxrwx   1 www-data www-data 207576 May  7 21:04 owncloud.log
-rwxrwxrwx   1 root     root          0 Apr 23 19:28 show

Iā€™m not an expert so could you kindly expand the sudo find above ?
(or a link from docs that I have not found).

Iā€™m really puzzled , the whole day on this ā€¦

I have now tried to move the data to an external USB pen drive but the result is the sameā€¦
Please help ā€¦
otherwise how can I create a new database and starting from the beginning ?

Finally I lost all my database and I created a new one.
Just for who reads the data structure from fresh is this:

root@debian:/srv/nsa325/omv-nsa325/owncloud# ls -l data
total 88
drwxrws---+ 5 root     users  4096 May  8 16:29 .
drwxrwsrwx+ 3 root     users  4096 May  8 15:42 ..
-rw-rw-rw-+ 1 www-data users   323 May  8 16:15 .htaccess
-rw-rw-rw-+ 1 www-data users     0 May  8 16:15 .ocdata
drwxrwsrwx+ 2 www-data users  4096 May  8 16:25 avatars
drwxrwsrwx+ 2 www-data users  4096 May  8 16:29 files_external
-rw-rw-rw-+ 1 www-data users   145 May  8 16:28 htaccesstest.txt
-rw-rw-rw-+ 1 www-data users     0 May  8 16:15 index.html
drwxrwsrwx+ 7 www-data users  4096 May  8 17:40 your_user
-rw-r-----+ 1 www-data users 34907 May  8 18:15 owncloud.log

I know that ownclud is for free and no assistance is granted but ā€¦ other free sw have better assistance anyhowā€¦

Iā€™m truly sorry to say this: Complaining here about the lack of community support is IMHO not very fair.

I assume you decided to install ownCloud in a non-standard way, what IMHO is very discouraged for a beginner with limited Linux experience. And you decided not to fill the issue template, so willing helpers donā€™t know anything about your system.

The various installation processes described in the docs should and do work without any problem on any system that fulfill the requirements.

Maybe you should start over, following all the recommendations. In case you still end up with problems, feel free to come back and ask again, preferably with a filled issue template.

1 Like

Sorry alfreddb ā€¦ it was nothing personal.
Iā€™m a noob, yes of course.
I installed owncloud following the Debian recommended way and everything was well working.
When I changed the data path I started to have problems and after two days (and nights) spent on that data folder I finally found the way alone (but I needed to create a new db and start from new).

At the end I discovered what was the issue just comparing the new and the old and the solution was to use the chmod and chown in the right way on the data folder (easy to see now comparing the two).

Itā€™s not a matter of fearness ā€¦ itā€™s more related to the fact that the solution was not very difficult to be found and on other linux forums the community is may be larger and more effective.

You pointed me on the right way but finally my skill was not sufficient.

Anyhow I like owncloud and ā€¦ hopefully I will not need again to move my data folder.

Again, it was not a complain because nothing is due here :wink:

Thanks again for your help that anyhow brought me to study alot on the available docs thay is well done and very clear.

Some final remarks:

  • IIRC, the whole ownCloud tree must be owned by www-data:www-data. (user and group)
  • Your files and directories have ACLs set (access control lists). You can see this by the ā€˜+ā€™ character appended to the permission list. I donā€™t know from where this comes and why this was done. I assume, this causes your permission trouble.

Out of curiosity: What filesystem has your data disk, and how exactly is it mounted?

1 Like

Well, the HD used for this samba share is coming from differnt NAS and never re-formatted.

It is Ext4

  1. It was first mounted as samba on my NSA325 with original stock firware
  2. it has been mounted as samba on my NSA325 after having flashed Debian over the stok fw (firs owncloud install)
  3. now it is mounted as samba on my NSA325 Debian Flashed via Openmediavault that uses ACL but I did not touch it (after this I had the problem with my database without moving any file just changing the path in config.php etcā€¦)

In OMV the ACL is set as:
Owner= www-data ā†’ Read/Write/Exe
Group = user ā†’ Read/Write/Exe
Others ā†’ Read/Write/Exe
Then there is a nice flag (that I did not see before) on ā€œreplace all existing permissionā€.
The flag ā€œApply permissions to files and subfoldersā€ is not flagged.

Anyhow now it seems to work even with the +.

This ACL is a nightmare and I wonder if now it is secure or notā€¦

Does this mean, that you are planning to access your ownCloud content from windows as well? If so, Iā€™m afraid you will end up in another trouble.

No.
I use the same disk but the owncloud data will remain as not accessible from samba.
Iā€™m not looking for other troubles :slight_smile:
Now I have a stable situation and I hav done a clone of my Debian rootfs ā€¦ just in case .

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.