Mounting As A Filesystem

To install your cloud directory as a filesystem, you first need davfs2 installed.  99% of the time, this will be included in your distributions repositories.  In Debian

apt-get install davfs2

If you want to let normal users mount the filesystem

dpkg-reconfigure davfs2

and select "yes" at the prompt.

Now you need to add any user you want to be able to mount dav to the davfs2 group

usermod -aG davfs2 <DesktopUser>

Note: on some systems the user group may be different, i.e. - "network"
on Arch Linux. If in doubt, check the davfs documentation for your
particular OS.

Edit /etc/fstab

nano /etc/fstab

to include your cloud directory by adding


https://freevolt.org/cloud/ /mount/point davfs user,noauto,uid=<DesktopUser>,file_mode=600,dir_mode=700 0 1


Where https://freevolt.org is the URL of your hub, /mount/point is the location you want to mount the cloud, and <DesktopUser> is the user you log in to one your computer.  Note that if you are mounting as a normal user (not root) the mount point must be in your home directory.

For example, if I wanted to mount my cloud to a directory called 'cloud' in my home directory, and my username was bob, my fstab would be

https://freevolt.org/cloud/ /home/bob/cloud davfs user,noauto,uid=bob,file_mode=600,dir_mode=700 0 1

Now, create the mount point.

mkdir /home/bob/cloud

and also create a directory file to store your credentials

mkdir /home/bob/.davfs2

Create a file called 'secrets'

nano /home/bob/.davfs2/secrets

and add your cloud login credentials


https://freevolt.org/cloud <username> <password>


Where <username> and <password> are the username and password for your hub.

Don't let this file be writeable by anyone who doesn't need it with

chmod 600 /home/bob/.davfs2/secrets

Finally, mount the drive.

mount https://freevolt.org/cloud

You can now find your cloud at /home/bob/cloud and use it as though it were part of your local filesystem - even if the applications you are using have no dav support themselves.

Troubleshooting

With some webservers and certain configurations, you may find davfs2 creating files with 0 bytes file size where other clients work just fine.  This is generally caused by cache and locks.  If you are affected by this issue, you need to edit your davfs2 configuration.

nano /etc/davfs2/davfs2.conf

Your distribution will provide a sample configuration, and this file should already exist, however, most of it will be commented out with a # at the beginning of the line.  

First step is to remove locks.

Edit the use_locks line so it reads use_locks 0.

Unmount your file system, remount your file system, and try copying over a file from the command line.  Note you should copy a new file, and not overwrite an old one for this test.  Leave it a minute or two then do ls -l -h and check the file size of your new file is still greater than 0 bytes.  If it is, stop there, and do nothing else.

If that still doesn't work, disable the cache.  Note that this has a performance impact so should only be done if disabling locks didn't solve your problem.  Edit the cache_size and set it to cache_size 0 and also set file_refresh to file_refresh 0.  Unmount your filesystem, remount your file system, and test it again.

If it still doesn't work, there is one more thing you can try.  (This one is caused by a bug in older versions of dav2fs itself, so updating to a new version may also help).  Enable weak etag dropping by setting drop_weak_etags 1.  Unmount and remount your filesystem to apply the changes.


Return to the Main documentation page