Ubuntu VPS挂载WebDAV网盘 TransIP 1T

前几天注册了TransIP 1T网盘不利用有点可惜,故通过WebDAV挂载到VPS。然后可以做的事就比较多了,比如做个备份,上传一些视频等等。

TransIP其实是有教程的,不过全荷兰语,代码发的也凌乱,故重新整理发出来。https://www.transip.nl/vragen/756

  1. 首先安装davfs2
    apt-get update
    apt-get install davfs2
  2. 挂载到VPS
    mkdir /stack
    #手动挂载(XXXX改成你的stack地址前缀),并按提示输入用户名、密码。
    mount -t davfs https://XXXX.stackstorage.com/remote.php/webdav/ /stack
    #通过命令df -h查看挂载结果。出现最后一排的情形表明成功,否则请重新挂载。
    df -h
    
    root@myscis.cn:~# mkdir /stack
    root@myscis.cn:~# mount -t davfs https://XXXX.stackstorage.com/remote.php/webdav/ /stack
    Please enter the username to authenticate with server
    https://XXXX.stackstorage.com/remote.php/webdav/ or hit enter for none.
      Username: XXXX
    Please enter the password to authenticate user XXXX with server
    https://XXXX.stackstorage.com/remote.php/webdav/ or hit enter for none.
      Password:
    root@myscis.cn:~# df -h
    Filesystem                                            Size  Used Avail Use% Mounted on
    udev                                                  227M     0  227M   0% /dev
    tmpfs                                                  49M  5.6M   43M  12% /run
    /dev/xvda1                                             20G   19G 1019M  95% /
    tmpfs                                                 242M   96K  242M   1% /dev/shm
    tmpfs                                                 5.0M     0  5.0M   0% /run/lock
    tmpfs                                                 242M     0  242M   0% /sys/fs/cgroup
    tmpfs                                                  49M   24K   49M   1% /run/user/112
    tmpfs                                                  49M     0   49M   0% /run/user/0
    https://XXXX.stackstorage.com/remote.php/webdav/  1.0T   48K  1.0T   1% /stack
    
    
    #卸载WebDAV
    umount /stack
  3. 开机自动挂载
    sed -i 's/# use_locks       1/use_locks       0/g' /etc/davfs2/davfs2.conf
    echo "https://XXXX.stackstorage.com/remote.php/webdav/ 用户名 密码" > /etc/davfs2/secrets
    echo "https://XXXX.stackstorage.com/remote.php/webdav/ /stack davfs user,rw,noauto" > /etc/fstab
    mount /stack

发表回复