webdavをマウント(CentOS / Ubuntu )


CentOS6

  • バージョン
[root@aspire webdav]# cat /etc/redhat-release
CentOS Linux release 6.0 (Final)
[root@aspire webdav]#
[root@aspire webdav]# uname -a
Linux aspire 2.6.32-71.29.1.el6.i686 #1 SMP Mon Jun 27 18:07:00 BST 2011 i686 i686 i386 GNU/Linux
  • 入ってなかったのでインストール
# wget http://pkgs.repoforge.org/davfs2/davfs2-1.4.6-1.el6.rf.i686.rpm

                  テンプレート        ビデオ        公開
[root@aspire ~]# rpm -ivh davfs2-1.4.6-1.el6.rf.i686.rpm
警告: davfs2-1.4.6-1.el6.rf.i686.rpm: ヘッダ V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
準備中...                ########################################### [100%]
   1:davfs2                 ########################################### [100%]
[root@aspire ~]#
[root@aspire ~]# rpm -qa davfs2
davfs2-1.4.6-1.el6.rf.i686

[root@aspire ~]#
[root@aspire ~]# rpm -qi !$
rpm -qi davfs2
Name        : davfs2                       Relocations: (not relocatable)
Version     : 1.4.6                             Vendor: Dag Apt Repository, http://dag.wieers.com/apt/
Release     : 1.el6.rf                      Build Date: 2010年11月12日 16時15分52秒
Install Date: 2012年08月07日 14時44分32秒      Build Host: lisse.hasselt.wieers.com
Group       : System Environment/Kernel     Source RPM: davfs2-1.4.6-1.el6.rf.src.rpm
Size        : 518109                           License: GPL
Signature   : DSA/SHA1, 2010年11月13日 08時05分59秒, Key ID a20e52146b8d79e6
Packager    : Dag Wieers 
URL         : http://dav.sourceforge.net/
Summary     : FUSE-Filesystem to access WebDAV servers
Description :
davfs2 is a FUSE file system driver that allows you to mount a WebDAV server
as a local file system, like a disk drive. This way applications can access
resources on a Web server without knowing anything about HTTP or WebDAV.

davfs2 runs as a daemon in userspace. It uses the kernel file system coda or
fuse. Most probably your Linux kernel includes at least one of this file
systems. To connect to the WebDAV server it makes use of the neon library.
Neon supports TLS/SSL (using OpenSSL or GnuTLS) and access via proxy server.
[root@aspire ~]#
  • mount
[root@aspire davfs2]# mount -t davfs http://XXX.XX.XXX.XXX:18080/webdav/XX/Apri/ /tmp/webdav
Please enter the username to authenticate with server
http://XXX.XX.XXX.XXX:18080/webdav/XX/Apri/ or hit enter for none.
  Username: XX
Please enter the password to authenticate user XX with server
http://XXX.XX.XXX.XXX:18080/webdav/XX/Apri/ or hit enter for none.
  Password:
[root@aspire davfs2]#
[root@aspire davfs2]# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/sda6              20G  3.7G   15G  21% /
tmpfs                 751M   76K  751M   1% /dev/shm
/dev/sdb1             1.8T  1.2T  598G  66% /data
http://XXX.XX.XXX.XXX:18080/webdav/XX/Apri/
                       26G   13G   13G  50% /tmp/webdav
  • インターネット経由のRockDiskオッソ!
    • 一秒あたり1.7MB
[root@aspire webdav]# ls -lh
合計 212M
drwx------ 2 root root    0  8月  7 20:38 2012 lost+found
  • rw-r--r-- 1 root root 212M 7月 26 10:53 2012 tb_workstation.exe
[root@aspire webdav]# time cp tb_workstation.exe /tmp real 1m58.686s user 0m0.028s sys 0m1.847s [root@aspire webdav]#
  • viはおろか、touchすらままならないとは・・・
[root@aspire webdav]# touch aaa.txt
touch: cannot touch `aaa.txt': 入力/出力エラーです
  • 結論

webdavサーバの性能によると思うが、遅い。とりあえず、RockDiskのネット越しでは戦えない。(LAN内ならsmbfsでマウントするから)

Ubuntu

  • バージョン
root@saber:/etc# more lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"
root@saber:/etc#
root@saber:/etc# uname -a
Linux saber 3.0.0-21-generic-pae #35-Ubuntu SMP Fri May 25 18:17:24 UTC 2012 i686 i686 i386 GNU/Linux
root@saber:/etc#
  • 入ってなかったのでインストール
root@saber:/etc# apt-get install davfs2
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
  libffado-dev libconfig++8 ibus-anthy phonon libnss3-dev libsamplerate0-dev
  ttf-takao-gothic linux-headers-3.0.0-12-generic-pae libnspr4-dev libffado2
  phonon-backend-gstreamer libphonon4 libxml++2.6-2 libsndfile1-dev
  flashplugin-downloader
これらを削除するには 'apt-get autoremove' を利用してください。
以下のパッケージが新たにインストールされます:
  davfs2
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 136 個。
138 kB のアーカイブを取得する必要があります。
この操作後に追加で 483 kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu/ oneiric/universe davfs2 i386 1.4.6-1ubuntu3 [138 kB]
138 kB を 0秒 で取得しました (490 kB/s)
パッケージを事前設定しています ...
未選択パッケージ davfs2 を選択しています。
(データベースを読み込んでいます ... 現在 226753 個のファイルとディレクトリがインストールされています。)
(.../davfs2_1.4.6-1ubuntu3_i386.deb から) davfs2 を展開しています...
man-db のトリガを処理しています ...
davfs2 (1.4.6-1ubuntu3) を設定しています ...
root@saber:/etc#
root@saber:/etc# dpkg -l | grep davfs
ii  davfs2                                 1.4.6-1ubuntu3                          mount a WebDAV resource as a regular file system
root@saber:/etc#
  • mount
root@saber:/etc# mount -t davfs http://XXX.XXX.XXX.XXX:18080/webdav/XXX/Apri/ /tmp/webdav
Please enter the username to authenticate with server
http://XXX.XXX.XXX.XXX:18080/webdav/XXX/Apri/ or hit enter for none.
  Username: XX
Please enter the password to authenticate user kk with server
http://XXX.XXX.XXX.XXX:18080/webdav/XXX/Apri/ or hit enter for none.
  Password:
root@saber:/etc#
root@saber:/etc#
root@saber:/etc# df -h
Filesystem            Size  Used Avail Use% マウント位置
/dev/sda1              20G  8.4G   11G  45% /
udev                  2.0G  4.0K  2.0G   1% /dev
tmpfs                 805M  1.6M  804M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  2.0G  144K  2.0G   1% /run/shm
/dev/sdb3             1.4T  1.2T  116G  91% /bkup
/dev/sdc3             890G  782G   63G  93% /data/knftp
/dev/sda3             276G  223G   39G  86% /data/img
//aspire/knftp        1.8T  1.2T  598G  66% /aspire_knftp
http://XXX.XXX.XXX.XXX:18080/webdav/XXX/Apri/
                       26G   13G   13G  50% /tmp/webdav
root@saber:/etc#
  • インターネット経由のRockDiskオッソ!
    • 一秒あたり1.7MB
root@saber:/etc# ls -lh /tmp/webdav/
合計 212M
drwx------ 2 root root    0 2012-08-07 21:09 lost+found
  • rw-r--r-- 1 root root 212M 2012-07-26 10:53 tb_workstation.exe
root@saber:/etc# root@saber:/etc# root@saber:/etc# cd /tmp/webdav/ root@saber:/tmp/webdav# root@saber:/tmp/webdav# time cp tb_workstation.exe /tmp real 2m2.522s user 0m0.000s sys 0m0.396s root@saber:/tmp/webdav#
  • viはおろか、touchすらままならないとは・・・
root@saber:/tmp/webdav# touch aaa.txt
touch: `aaa.txt' に touch できません: 入力/出力エラーです
root@saber:/tmp/webdav# echo "aaa" > aaa.txt
  • su: aaa.txt: 入力/出力エラーです
  • 結論

webdavサーバの性能によると思うが、遅い。とりあえず、RockDiskのネット越しでは戦えない。(LAN内ならsmbfsでマウントするから)