I'm trying to give rwx permissions to www-data in /media/bblab/Database/data to install OwnCloud.

bblab is my user name and Database is my disk label. The step I mount the drive is:

  1. login as bblab (the user created when I installed Ubuntu)

  2. open disk application and find an empty drive /dev/dm-2 (hard drive 2T*2 installed on motherboard with hardware RAID 1 (Gigabyte X79-UP4))

  3. create a new partition on drive /dev/dm-2 and the partition is named /dev/dm-3

  4. mount the partition /dev/dm-3 at /media/bblab

  5. use terminal to change the permission of the media to 750

  6. add group www-data to /media/bblab/Database

  7. sudo chown -R www-data:www-data /media/bblab/Database/data

and now when use command ls -al /mdeia/bblab/Database, the result is

drwxr-x--- bblab www-data .
drwxr-x--- root root ..
drwxrwx--- www-data www-data data
drwx------ root root lost+found

But OwnCloud still gives the following messages:

Can't create data directory (/media/bblab/Database/data/data)

This can usually be fixed by giving the webserver write access to the root directory.

Is there any step I'm doing wrong or have forgotten to do? Thanks!


What worked on my end:

sudo chown -R www-data:www-data /path/to/ownCloud 
sudo chmod -R 775 /path/to/ownCloud
sudo adduser YOURNAME www-data


for ownCloud to work well, www-data must be the one that own all of that folders with both Read and Write. It's just that how it works.

That application running so smoothly with that approach I used.


This can be fix by changing the parent folders' permissions. For example, if folder Database's permission is set to 777, bblab has to set to 777 else Database configuration won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.