Difference between revisions of "Davfs"

From ArchWiki
Jump to: navigation, search
m (format)
(Mounting as regular user: Add STACK URL since owncloud and box.com are provided as well. (maybe move them all to a dedicated section at some point?))
 
(17 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
[[Category:File systems]]
 
[[Category:File systems]]
 +
[[ja:Davfs]]
 
'''DAVfs''' is a Linux file system driver that allows you to mount a WebDAV server as a disk drive. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources, defined in RFC 4918.
 
'''DAVfs''' is a Linux file system driver that allows you to mount a WebDAV server as a disk drive. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources, defined in RFC 4918.
  
 
== Installing DAVfs ==
 
== Installing DAVfs ==
  
[[pacman|Install]] {{Pkg|davfs2}} from [[official repositories]].
+
[[Install]] {{Pkg|davfs2}} from [[official repositories]].
  
 
==Mounting the partition==
 
==Mounting the partition==
 
Examples:
 
Examples:
  # mount.davfs http://localhost:8080/ /mnt/dav
+
  <nowiki># mount.davfs http://localhost:8080/ /mnt/dav</nowiki>
  # mount -t davfs http://localhost:8080/ /mnt/dav
+
  <nowiki># mount -t davfs http://localhost:8080/ /mnt/dav</nowiki>
  
 
==Mounting as regular user==
 
==Mounting as regular user==
  
Add yourself to network group:
+
Add yourself to network group (where username is replaced with your username):
 
  # usermod -a -G network username
 
  # usermod -a -G network username
  
Add webdav entry to /etc/fstab:
+
Add webdav entry to /etc/fstab (again, replacing username with your actual username):
  https://webdav.example.com /home/username/webdav davfs user,noauto,uid=username,file_mode=600,dir_mode=700 0 1
+
  <nowiki>https://webdav.example.com /home/username/webdav davfs user,noauto,uid=username,file_mode=600,dir_mode=700 0 1</nowiki>
  
 
Create secrets file in your home:
 
Create secrets file in your home:
  # mkdir ~/.davfs2/
+
  $ mkdir ~/.davfs2/
  # echo "https://webdav.example.com webdavuser webdavpassword" >> ~/.davfs2/secrets  
+
  <nowiki>$ echo "https://webdav.example.com webdavuser webdavpassword" >> ~/.davfs2/secrets</nowiki>
  # chmod 0600 ~/.davfs2/secrets
+
  $ chmod 0600 ~/.davfs2/secrets
 +
 
 +
For owncloud, the url is:
 +
<nowiki>https://webdav.example.com/remote.php/webdav</nowiki>
 +
 
 +
For box.com, the url is:
 +
<nowiki>https://dav.box.com/dav</nowiki>
 +
 
 +
For STACK, the url is (replace username with your username):
 +
<nowiki>https://username.stackstorage.com/remote.php/webdav</nowiki>
 +
 
 +
If you want to mount several disks from same server, you need specify mount points of this disks instead of server address in file ~/.davfs2/secrets, remember to put the password in double quotes.
 +
 
 +
/home/username/disk1 webdavuser1 "webdavpassword1"
 +
/home/username/disk2 webdavuser1 "webdavpassword2"
 +
.........
 +
/home/username/diskN webdavuserN "webdavpasswordN"
  
 
Now you should be able to mount and unmount ~/webdav:
 
Now you should be able to mount and unmount ~/webdav:
 
  # mount ~/webdav
 
  # mount ~/webdav
 
  # fusermount -u ~/webdav
 
  # fusermount -u ~/webdav
 +
 +
== Troubleshooting ==
 +
 +
=== Creating/copying files not possible ===
 +
 +
If creating/copying files is not possible, while the same operations work on directories, edit {{ic|/etc/davfs2/davfs2.conf}} and change the following line accordingly:
 +
 +
{{hc|/etc/davfs2/davfs2.conf|
 +
[...]
 +
use_locks 0
 +
[...]
 +
}}
 +
 +
== See also ==
 +
 +
http://doc.owncloud.org/server/6.0/user_manual/files/files.html

Latest revision as of 22:52, 12 April 2016

DAVfs is a Linux file system driver that allows you to mount a WebDAV server as a disk drive. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources, defined in RFC 4918.

Installing DAVfs

Install davfs2 from official repositories.

Mounting the partition

Examples:

# mount.davfs http://localhost:8080/ /mnt/dav
# mount -t davfs http://localhost:8080/ /mnt/dav

Mounting as regular user

Add yourself to network group (where username is replaced with your username):

# usermod -a -G network username

Add webdav entry to /etc/fstab (again, replacing username with your actual username):

https://webdav.example.com /home/username/webdav davfs user,noauto,uid=username,file_mode=600,dir_mode=700 0 1

Create secrets file in your home:

$ mkdir ~/.davfs2/
$ echo "https://webdav.example.com webdavuser webdavpassword" >> ~/.davfs2/secrets 
$ chmod 0600 ~/.davfs2/secrets

For owncloud, the url is:

https://webdav.example.com/remote.php/webdav

For box.com, the url is:

https://dav.box.com/dav

For STACK, the url is (replace username with your username):

https://username.stackstorage.com/remote.php/webdav

If you want to mount several disks from same server, you need specify mount points of this disks instead of server address in file ~/.davfs2/secrets, remember to put the password in double quotes.

/home/username/disk1 webdavuser1 "webdavpassword1"
/home/username/disk2 webdavuser1 "webdavpassword2"
.........
/home/username/diskN webdavuserN "webdavpasswordN" 

Now you should be able to mount and unmount ~/webdav:

# mount ~/webdav
# fusermount -u ~/webdav

Troubleshooting

Creating/copying files not possible

If creating/copying files is not possible, while the same operations work on directories, edit /etc/davfs2/davfs2.conf and change the following line accordingly:

/etc/davfs2/davfs2.conf
[...]
use_locks 0
[...]

See also

http://doc.owncloud.org/server/6.0/user_manual/files/files.html