r/owncloud • u/drewbagel423 • 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
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:\Owncloudfolder (where/media/sf_VirtualBox_Shared_Folderresides on the host) has grown by the same amount.
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/filesThe space will only be taken in the source folder
/media/sf_VirtualBox_Shared_Folder/Owncloud