使用rclone挂载alist到本地磁盘

最近用docker搭建了一个navidrome自己的音乐容器,但是并不想音乐文件放在服务器上,索性就使用rclone把alist上的云盘挂载到本地了,系统是Ubuntu22.04

1.安装

安装 rclone

curl https://rclone.org/install.sh | sudo bash

安装fuse

apt-get install fuse

如果后面挂载出现failed to mount FUSE fs: fusermount: exec: "fusermount3": executable file not found in $PATH错误。可以使用syslink:

ln -s /bin/fusermount /bin/fusermount3

或者安装fuse3

apt-get install fuse

2.配置

ubuntu@problem-arm:~$ sudo -i

root@problem-arm:~# rclone config

2024/08/02 05:37:06 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults

No remotes found, make a new one?

n) New remote

s) Set configuration password

q) Quit config

n/s/q> n #按n创建远程

Enter name for new remote.

name> alist #输入远程名字

Option Storage.

Type of storage to configure.

Choose a number from below, or type in your own value.

1 / 1Fichier

\ (fichier)

2 / Akamai NetStorage

\ (netstorage)

3 / Alias for an existing remote

\ (alias)

4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others

\ (s3)

51 / Uptobox

\ (uptobox)

52 / WebDAV

\ (webdav)

53 / Yandex Disk

\ (yandex)

54 / Zoho

\ (zoho)

55 / premiumize.me

\ (premiumizeme)

56 / seafile

\ (seafile)

Storage> 52 #这里选择52使用webdav

Option url.

URL of http host to connect to.

E.g. https://example.com.

Enter a value.

url> http://127.0.0.1:45454/dav #输入你的alist地址,地址后面要加一个/dav

Option vendor.

Name of the WebDAV site/service/software you are using.

Choose a number from below, or type in your own value.

Press Enter to leave empty.

1 / Fastmail Files

\ (fastmail)

2 / Nextcloud

\ (nextcloud)

3 / Owncloud

\ (owncloud)

4 / Sharepoint Online, authenticated by Microsoft account

\ (sharepoint)

5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises

\ (sharepoint-ntlm)

6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol

\ (rclone)

7 / Other site/service or software

\ (other)

vendor> 6 #这里选择6

Option user.

User name.

In case NTLM authentication is used, the username should be in the format 'Domain\User'.

Enter a value. Press Enter to leave empty.

user> admin #输入你的alist的用户名

Option pass.

Password.

Choose an alternative below. Press Enter for the default (n).

y) Yes, type in my own password

g) Generate random password

n) No, leave this optional password blank (default)

y/g/n> y #输入y

Enter the password:

password:123456 #输入你的alist账号密码

Confirm the password:

password:123456 #再次输入确认密码

Option bearer_token.

Bearer token instead of user/pass (e.g. a Macaroon).

Enter a value. Press Enter to leave empty.

bearer_token> #这里直接回车

Edit advanced config?

y) Yes

n) No (default)

y/n> #这里也可以直接回车使用默认的

Configuration complete.

Options:

- type: webdav

- url: http://127.0.0.1:65533/dav

- vendor: rclone

- user: AsjiYsaBBhsapmlkH

- pass: * ENCRYPTED *

Keep this "alist" remote?

y) Yes this is OK (default)

e) Edit this remote

d) Delete this remote

y/e/d> y #输入y确认你的信息

Current remotes:

Name Type

==== ====

alist webdav

e) Edit existing remote

n) New remote

d) Delete remote

r) Rename remote

c) Copy remote

s) Set configuration password

q) Quit config

e/n/d/r/c/s/q> q #这里我们已经成功配置好远程了,输入q退出

3.查看是否配置成功

ubuntu@problem-arm:~$ sudo -i root@problem-arm:~# rclone lsd alist:/

-1 2024-08-02 05:32:58 -1 ali

-1 2024-08-02 05:31:08 -1 tianyi

#alist是你刚刚远程配置的名称

这里看到配置是成功的,显示我alist连接了是有两个盘的(阿里和天翼的)

4.挂载

root@problem-arm:~# rclone mount alist:/ /home/remote &

#这里我将alist的两个盘挂载到我的 /home/remote下,&在后台持续挂载

5.取消挂载

root@problem-arm:~# fusermount -qzu /home/remote

  • 21
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AlbertXiaoMing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值