External Hard Drive Issues with owncloud 9.1


I have a Raspberry Pi 3 (nginx,php5,mysql) with an external 5TB HD (ext4) which I am trying to set up with owncloud.

I am trying to replace Google Drive, with which I've had a few issues. The 5TB HD is basically a clone of a HD on my desktop computer. Ideally, these Pi and desktop drives will remain completely in sync. In addition, two folders will be synced to both my laptop and mobile phone.

I went through the install yesterday and had no problems. However, I used the default data location, since I'd assumed it would be easy to move it afterwards. After installation, I moved the location in the config file, but could not get the files to show up on owncloud. After doing a little more reading, it sounded like the easiest way to get everything to work would be to just reinstall owncloud and set the data directory to my external HD during installation.


I did this today, but the files still are not showing up. The only files on owncloud are the default installation files (Documents / Photos / owncloud manual). After changing ownership back to my user and opening up the directory, I saw that owncloud created a "username" directory. Inside this directory there is a "files" directory, and in this folder are the default owncloud files. All my other files on the hard drive are outside this directory, and thus are not displaying in owncloud. This is pretty frustrating and not at all the behavior I expected when choosing the hard drive as my data folder.

To recap, this is my situation:

/web/sitename/www/owncloud --> where owncloud is installed

/media/username/drive-name --> where the drive is mounted; I have several major directories here that I want in owncloud

/media/username/drive-name/username/files --> the default owncloud files, which are the only ones currently displaying over the web

Ownership of the drive was set recursively to www-data; permissions were set to 0770.

My question: how can I get the entire contents of my external hard drive onto owncloud? I'm willing to do a reinstall -- I just want this to work and be able to move on at this point.

Additional question: is there any way to set permissions so that my Pi user and www-data can cd through the drive? I tried to set up a shared group (user + www-data), but I'm still in the process of learning Linux and may not have done it correctly.

TIA for any advice or insight.

Update (20160831 0200 UTC): I just activated the external storage app, and now the drive is appearing in owncloud.


(1). I now have the username/files folder and all the other owncloud config files appearing as well.

I imagine this might be problematic, and it is certainly not neat. To achieve what I'm looking for, would the solution be to:
A. Reinstall again.
B. Install the data file inside the web directory (out of www root, though).
C. Use the app to load my local external drive.


(2). Syncing is not clean. I just tried to sync one folder, and it is not working well.

I am trying to sync:

On my desktop drive: media/drive/owncloud/folder 1/folder xyz
On my raspberry pi: media/drive/owncloud/folder 1/folder xyz

What I am getting on my desktop drive:
media/drive/owncloud/folder 1/folder xyz/local/owncloud/folder 1/folder xyz

Again, any feedback would be much appreciated. TIA.

The native storage of owncloud is completely handled by owncloud and you cannot change it's internal structure, it always uses this scheme:

You can include other folders in your system via the external storage feature.

Neither the external storage, nor the data-directory have to be in the document-root (it's even better if it isn't). However the webserver user (www-data) needs full access to this folder. Be careful, www-data must be able to go through all parent folders as well. You can check with:
sudo -u www-data ls -lsia /path/to/my/data/folder

The current client unfortunately can't detect already existing files on the client. They must be downloaded or uploaded a first time through the client. That's not very practical with 5 TB of data.

1 Like

Thank you -- very helpful and informative. It would be nice to get this information up front, as unfortunately I do think this limits my use for owncloud, at least for now. Thanks again for your time!

If you have ideas on how to improve the documentation, please don't hesitate to share your ideas on github.com/owncloud/documentation/issues. From "inside" the system such things are not easy to tackle and if you can say, at which place a little more information would have helped you, this will improve the documentation for everybody.