sudo apt install davfs2
挂载路径
MOUNT_PATH=/media/webdav
webdav服务器
WEBDAV_HOST=http://127.0.0.1:5244/dav
[ -d ${MOUNT_PATH} ] || sudo mkdir -p ${MOUNT_PATH}
sudo mount.davfs ${WEBDAV_HOST} ${MOUNT_PATH} -o uid=$(id -u) -o gid=$(id -u)
umount -v /home/webdav
mount.davfs: mounting failed; the server does not support WebDAV
vi /etc/davfs2/davfs2.conf
查找ignore_dav_header, 打开注释并设置为1
ignore_dav_header 1
然后重新挂载
vim /etc/davfs2/secrets
按照这个格式追加到文件末尾就可以http://192.168.31.88:5244/dav 用户名 密码
在 /etc/fstab 末尾追加:
http://192.168.31.88:5244/dav /home/webdav davfs rw,uid=0,gid=0 0 0
//192.168.31.90/video /home/synology cifs defaults,username=limingze,password=xxxxx,dir_mode=0777,file_mode=0777,vers=2.0 0 2
查看硬盘
fdisk -l
or
lsblk
格式化硬盘,输入m根据提示选择对应操作
fdisk /dev/sdb
格式化硬盘分区
mkfs.ext4 /dev/sdb1
挂载硬盘
mkdir -p /home/mydir
mount /dev/sdb1 /home/mydir
# mount usb
UUID="90b06ef9-a790-4f89-8a41-712ce59ca971" /home/wxedge ext4 defaults 0 0
UUID="da2f378c-78c3-41db-93fb-cc7f85754fd3" /home/wxedge2 ext4 defaults 0 0
#/dev/sdb /home/wxedge ext4 defaults 0 0
#/dev/sdc /home/wxedge2 ext4 defaults 0 0