69

openwrt 借助 docker 镜像 clouddrive 挂载阿里云盘并挂载到局域网的教程

 2 years ago
source link: https://hellodk.cn/post/919
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

openwrt 借助 docker 镜像 clouddrive 挂载阿里云盘并挂载到局域网的教程

首先确保 openwrt 安装了 fuse-utils

opkg update && opkg install fuse-utils

然后需要使用一个 ext4 格式分区(这个分区要求是 docker 数据分区 Docker Root Dir)作为虚拟磁盘挂载的路径。

mount --make-shared /mnt/system

/dev/sda3 作为 overlay 使用,实现 openwrt 扩容,同时将这个分区挂载到一个 ext4 文件格式分区,本文是 /mnt/system(挂载点),这样就满足了 clouddrive 的要求

接着运行容器

docker run -d \
--name clouddrive \
--restart unless-stopped
-v /mnt/system/CloudNAS:/CloudNAS:shared \
-v /mnt/system/Config:/Config \
-p 9798:9798 \
--privileged \
--device /dev/fuse:/dev/fuse \
cloudnas/clouddrive

然后浏览器打开 10.10.10.1:9798 绑定阿里云盘即可

开机自启需要在 /etc/rc.localexit 0 之前添加 mount --make-shared /mnt/system。开机后即可自动应用

挂载后的效果

期间遇到错误

invalid mount config: must use either propagation mode "rslave" or "rshared" when mount source is within the daemon root, daemon root: "/opt/docker", bind mount source: "/opt/docker/CloudNAS

原因是因为我绑定了错误的 local path /opt/docker/CloudNAS 正确的应是 /mnt/system/CloudNAS 原因就是需要一个 ext4 file system 的local mount point


再利用 samba 将阿里云盘挂载到局域网,编辑文件 /etc/config/samba 添加如下配置

config sambashare
option browseable 'yes'
option name 'AliDrive'
option path '/mnt/system/CloudNAS/CloudDrive/阿里云盘'
option users 'dk'
option read_only 'no'
option guest_ok 'no'
option create_mask '0755'
option dir_mask '0755'

然后局域网设备就可以挂载这个磁盘了。比如 mac 打开 finder,按下 command ➕️ k 快速打开 Connect to Server 对话框,在地址栏输入 smb://10.10.10.1/AliDrive 输入用户名 dk 和对应密码即可完成挂载。


然后还有一些图片分享

我的阿里云盘容量明细,有接近4个TB是永久容量。现在阿里云盘的审核也是越来越狠,但是如本文这样使用感觉还是很不错的,毕竟没花一分钱白嫖来的。

收藏的赵本山小品合集

收藏的人人影视735部电影

mac 挂载后在 finder 中浏览/管理


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK