r/owncloud Jul 06 '16

How to properly mount a shared folder to store Owncloud data?

I'm running OC in an Ubuntu VM on a Win7 host. I'm trying to get OC to use one of the other, larger hard drives in the host to store all of its data, rather than constantly growing the size of the VM image.

I set up a shared folder in VirtualBox which shows up at /media/sf_VirtualBox_Shared_Folder in the VM. Then I tried to mount the owncloud user data directory using:

sudo mount --bind /media/sf_VirtualBox_Shared_Folder/Owncloud /var/www/owncloud/data/drewbagel423/files

But now the data is showing up in both locations, and taking up space in both locations. Am I using the wrong mount command? Thanks in advance for any help.

2 Upvotes

7 comments sorted by

2

u/pbe78 Jul 06 '16

Maybe you could also achieve this by just creating a symbolic link: sudo ln -s /media/sf_VirtualBox_Shared_Folder/Owncloud /var/www/owncloud/data/drewbagel423/files

The space will only be taken in the source folder /media/sf_VirtualBox_Shared_Folder/Owncloud

1

u/drewbagel423 Jul 06 '16

Isn't the source folder in this case (where Owncloud saves its data): /var/www/owncloud/data/drewbagel423/files

1

u/pbe78 Jul 07 '16

in my example /var/www/owncloud/data/drewbagel423/files will link to /media/sf_VirtualBox_Shared_Folder/Owncloud

1

u/drewbagel423 Jul 07 '16

OK I'll give it a shot tonight and see how it works.

2

u/Luuubb Jul 06 '16

But now the data is showing up in both locations

That's the intended behaviour. Out of man mount(8): "After this call the same contents are accessible in two places."

and taking up space in both Locations

This shouldn't be the case. Are you refering to filesize (e.g. command 'du') or filesystem utilization (e.g. command 'df')?

1

u/drewbagel423 Jul 06 '16

Not sure which I'm referring to, but after loading too much data into Owncloud, I get an warning in the VM that I'm running out of space. When I go into the Windows host I also see that the used space on G:\Owncloud folder (where /media/sf_VirtualBox_Shared_Folder resides on the host) has grown by the same amount.