• 돌아가기
  • 아래로
  • 위로
  • 목록
  • 댓글

시놀로지(헤놀로지)에서 Rclone을 이용한 구글드라이브 마운트하기.

달소 달소 3859

3

14

 

안녕하세요 달소입니다.

 

앞서 설치한 Rclone을 이용해서 사용하고계신 구글드라이브를 마운트시켜서 드라이브처럼 사용해보도록하겠습니다.

 

이렇게 했을때의 장점은 구글드라이브의 저장소를 로컬처럼 사용해서 plex와 같은 영상재생에도 사용할 수 있고 다양한 방법으로 활용할 수 있습니다.

 

사전준비사항은 시놀로지(헤놀로지)에 rclone을 미리 설치해주셔야합니다.

 

  안녕하세요. 달소입니다.   오늘은 시놀(헤놀)에서 원격클라우드로의 마운트를 좀더 쉽게 사용하기위한 Rclone을 설치해보겠습니다. &n...
달소 | 2021.12.01

 

마운트할 공유폴더 생성하기

image.png.jpg

image.png.jpg

 

 

image.png.jpg

구글드라이브에 vfs로 연동하기.

rclone config 명령어로 마운트를 시작합니다.

n 을눌러 새로운 원격지.

name은 원격지로 사용할이름(원하는대로 입력)

 

image.png.jpg

16번이 구글드라이브입니다.

image.png.jpg

Client id/secret은 공백으로 엔터만 쳐도됩니다.

아래 type의 경우 내용을 잘읽어보고 선택해주세요. 저는 Full access인 1번으로했습니다.

 

image.png.jpg

여기서가 중요한데 일반 로컬 유저시라면 auto config를 사용하셔도되지만

저처럼 원격지 리눅스 서버라면 아래 N을 선택해주셔야합니다.
웹사이트를 못켜는 remote or headless machine 기준입니다.

그리고 나오는 url로 접속해주세요.

image.png.jpg

url로 접근하면 아래처럼 계정을 선택하라고하는데 연동할 계정을 선택해주세요.

image.png.jpg

권한허용해주고

image.png.jpg

코드를 복사해주세요.

image.png.jpg

복사한 코드는 다시 터미널에가서 붙여넣기 해주면 완료입니다.

공유드라이브가 아니면 no 맞으면 yes입니다.

image.png.jpg

 

이제 아래 명령어를 통해 드라이브를 vfs로 마운트해주겠습니다.

아래 gdrive는 위에서 이름지정해준 구글 드라이브입니다 :뒤에는 마운트시킬 폴더입니다.

 

rclone mount gdrive: /volume2/rclone/gdrive \
--allow-other \
--allow-non-empty \
--fast-list \
--drive-skip-gdocs \
--poll-interval=15s \
--vfs-cache-mode full \
--vfs-write-back 5s \
--bwlimit-file 16M \
--buffer-size=16M \
--vfs-read-chunk-size=32M \
--vfs-read-chunk-size-limit 2048M \
--vfs-cache-max-size 100G \
--vfs-cache-max-age 336h \
--vfs-read-ahead 32M \
--dir-cache-time=1000h \
--log-level INFO \
--log-file /volume2/rclone.log \
--cache-dir=/volume2/rclone/gcache \
--timeout 1h \
--umask 000 \
--config /root/.config/rclone/rclone.conf

 

image.png.jpg

 

이렇게 명령어를 입력하고 시간이 지나면 아래처럼 동기화가 되는걸확인하실 수 있습니다.

 

image.png.jpg

 

이제 부팅시에 자동으로 rclone을 통해 마운트가 되도록 스크립트를 등록해주겠습니다.

 

자동 스크립트 등록

먼저 스크립트를 bash쉘로 하나 만들어주도록하겠습니다.

다이렉트로 명령어를 실행시키도록했더니.. 제대로 실행이 안되더군요..

 

볼륨은언제나 자신이 생성한 공유폴더 기준입니다.

 

vi /volume2/rclone/rclone.sh

 

#/bin/bash
sleep 1m

rclone mount gdrive: /volume2/rclone/gdrive \
--allow-other \
--allow-non-empty \
--fast-list \
--drive-skip-gdocs \
--poll-interval=15s \
--vfs-cache-mode full \
--vfs-write-back 5s \
--bwlimit-file 16M \
--buffer-size=16M \
--vfs-read-chunk-size=32M \
--vfs-read-chunk-size-limit 2048M \
--vfs-cache-max-size 100G \
--vfs-cache-max-age 336h \
--vfs-read-ahead 32M \
--dir-cache-time=1000h \
--log-level INFO \
--log-file /volume2/rclone.log \
--cache-dir=/volume2/rclone/gcache \
--timeout 1h \
--umask 000 \
–-config /root/.config/rclone/rclone.conf

 

이제 이 스크립트를 작업스케쥴러에 넣어주겠습니다.

 

제어판 -> 작업스케쥴러

 

image.png.jpg

 

사용자는 root로해주셔야합니다!

 

image.png.jpg

image.png.jpg

 

이제 부트업이되면 자동으로 스크립트가 실행되면서 마운트가 진행됩니다.

 

스크립트 실행결과는 작업 -> 결과확인으로 가능합니다.

 

image.png.jpg

 

아래처럼 중단됨이나 표준출력 오류가없으면 정상적으로 된것입니다.

image.png.jpg

 

다음편에서는 sftp를 한번 연결해보겠습니다

신고공유스크랩
14
3등
ts 2021.12.03. 02:03

구드 용량이 없어서 원드라이브로 시도 중인데 계정연동 로그인창이 뭘 선택해도 안뜨네요..

ts 2021.12.03. 18:51
달소

Use auto config?

* Say Y if not sure

* Say N if you are working on a remote or headless machine

 

y) Yes (default)

n) No

y/n> n

Option config_token.

For this to work, you will need rclone available on a machine that has

a web browser available.

For more help and alternate methods see: https://rclone.org/remote_setup/

Execute the following on the machine with the web browser (same rclone

version recommended):

rclone authorize "onedrive"

Then paste the result.

Enter a string value. Press Enter for the default ("").

 

 

헤드리스 선택시 위와 같이 뜨네요..

ts 2021.12.03. 18:54
달소

Use auto config?

* Say Y if not sure

* Say N if you are working on a remote or headless machine

 

y) Yes (default)

n) No

y/n> y

2021/12/03 18:52:13 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XbShY2v09T3ykolDB9bTYQ

2021/12/03 18:52:13 NOTICE: Log in and authorize rclone for access

2021/12/03 18:52:13 NOTICE: Waiting for code...

 

오토모드로 선택하면 로그인창은 안뜨고 이렇게 뜨고 위 주소로 들어가봐도 아무 반응이 없습니다.ㅠ

theb1ue 2021.12.07. 16:19
ts

해당 메뉴에서 n 입력하셔야 합니다. 그럼 127.0.0.1 이 주소가 아닌

google.com/~~어쩌구 주소가 나올텐데 이걸 브라우저에 붙여넣고 진행하시면 됩니다.

profile image
달소 글쓴이 2021.12.07. 16:58
ts

넵 n으로해야 접속주소가 나옵니다!

headless 환경(리눅스와같은CLI) 환경에서는 바로 접속되지않아서 아래 n으로 진행해주셔야합니다

네오니오 2022.01.09. 19:38

시놀에 rclone vfs를 설치하려 하는데, 리눅스 문외한이지만 자세한 설명으로 따라올 수 있었습니다. 감사합니다.

 

rclone lsd gdrive: 로 조회시 폴더들이 보이는걸 보면 설치와 config까지는 이상이 없는 것 같은데,

vfs 명령어 (예제와 동일합니다) 입력시

-------------------------

Usage: rclone mount remote:path /path/to/mountpoint [flags]

 

Flags:

--allow-non-empty Allow mounting over a non-empty directory (not supported on Windows)

--allow-other Allow access to other users (not supported on Windows)

--allow-root Allow access to root user (not supported on Windows)

--async-read Use asynchronous reads (not supported on Windows) (default true)

--attr-timeout duration Time for which file/directory attributes are cached (default 1s)

--daemon Run mount in background and exit parent process (as background output is suppressed, use --log-file with --log-format=pid,... to monitor) (not supported on Windows)

--daemon-timeout duration Time limit for rclone to respond to kernel (not supported on Windows)

--daemon-wait duration Time to wait for ready mount from daemon (maximum time on Linux, constant sleep time on OSX/BSD) (not supported on Windows) (default 1m0s)

--debug-fuse Debug the FUSE internals - needs -v

--default-permissions Makes kernel enforce access control based on the file mode (not supported on Windows)

--dir-cache-time duration Time to cache directory entries for (default 5m0s)

--dir-perms FileMode Directory permissions (default 0777)

--file-perms FileMode File permissions (default 0666)

--fuse-flag stringArray Flags or arguments to be passed direct to libfuse/WinFsp (repeat if required)

--gid uint32 Override the gid field set by the filesystem (not supported on Windows)

-h, --help help for mount

--max-read-ahead SizeSuffix The number of bytes that can be prefetched for sequential reads (not supported on Windows) (default 128Ki)

--network-mode Mount as remote network drive, instead of fixed disk drive (supported on Windows only)

--no-checksum Don't compare checksums on up/download

--no-modtime Don't read/write the modification time (can speed things up)

--no-seek Don't allow seeking in files

--noappledouble Ignore Apple Double (._) and .DS_Store files (supported on OSX only) (default true)

--noapplexattr Ignore all "com.apple.*" extended attributes (supported on OSX only)

-o, --option stringArray Option for libfuse/WinFsp (repeat if required)

--poll-interval duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)

--read-only Mount read-only

--uid uint32 Override the uid field set by the filesystem (not supported on Windows)

--umask int Override the permission bits set by the filesystem (not supported on Windows) (default 18)

--vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s)

--vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off)

--vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off)

--vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s)

--vfs-case-insensitive If a file name not found, find a case insensitive match

--vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full

--vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi)

--vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)

--vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms)

--vfs-used-is-size rclone size Use the rclone size algorithm for Used size

--vfs-write-back duration Time to writeback files after last use when using cache (default 5s)

--vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)

--volname string Set the volume name (supported on Windows and OSX only)

--write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)

 

Use "rclone [command] --help" for more information about a command.

Use "rclone help flags" for to see the global flags.

Use "rclone help backends" for a list of supported services.

Command mount needs 2 arguments maximum: you provided 33 non flag arguments: ["gdrive:" "/volume1/rclone/gdrive" "–allow-other" "–allow-non-empty" "–fast-list" "–drive-skip-gdocs" "–poll-interval=15s" "–vfs-cache-mode" "full" "–vfs-write-back" "5s" "–bwlimit-file" "16M" "–buffer-size=16M" "–vfs-read-chunk-size=32M" "–vfs-read-chunk-size-limit" "2048M" "–vfs-cache-max-size" "50G" "–vfs-cache-max-age" "336h" "–vfs-read-ahead" "32M" "–dir-cache-time=1000h" "–log-level" "INFO" "–log-file" "/volume1/rclone/rclone.log" "–cache-dir=/volume1/rclone/gcache" "–timeout" "1h" "–umask" "000"]

-----------------------

이런 내용으로 마운트 명령어가 안됩니다.

어디가 잘못된 걸까요?

profile image
달소 글쓴이 2022.01.10. 14:03
네오니오

흠 : 뒤에 한칸은 띄우시거 하신거겠지요??

복붙대신에 옵션값을 먼저 안주고 기본명령어로 마운트 해본다음 명령어를 추가하시는방향으로해보셔야할듯합니다

네오니오 2022.01.10. 21:44
달소

명령어는 이렇습니다

-----------------------

rclone mount gdrive: /volume1/rclone/gdrive \

–allow-other \

–allow-non-empty \

–fast-list \

–drive-skip-gdocs \

–poll-interval=15s \

–vfs-cache-mode full \

–vfs-write-back 5s \

–bwlimit-file 16M \

–buffer-size=16M \

–vfs-read-chunk-size=32M \

–vfs-read-chunk-size-limit 2048M \

–vfs-cache-max-size 50G \

–vfs-cache-max-age 336h \

–vfs-read-ahead 32M \

–dir-cache-time=1000h \

–log-level INFO \

–log-file /volume1/rclone/rclone.log \

–cache-dir=/volume1/rclone/gcache \

–timeout 1h \

–umask 000 \

----------------------------

1. rclone mount gdrive: /volume1/rclone/gdrive 여기까지만 입력하고 엔터하면 아무 메시지 안나오고 멈춰 있습니다 희한한 건 이렇게 하면 윈도우 탐색기에서는 gdrive 폴더가 사라지고 그 폴더를 다시 만들려고 하면 이미 그 폴더는 있다고 나옵니다.

그리고 putty에서 ^c 하면 윈도우 탐색기에 다시 gdrive 폴더가 나타납니다

2. 명령어를 1과 같이 주었을 경우 시놀 탐색기에서 보면 정상적으로 폴더들을 가져옵니다.

3. 하지만 명령어 하나만 줘도 (예 : rclone mount gdrive: /volume1/rclone/gdrive –allow-other) 본문과 같은 메시지만 나옵니다.

 

profile image
달소 글쓴이 2022.01.11. 09:31
네오니오

흠.. 해당경로에 폴더들은 만들어주신 상태겠지요..? 왜그럴까요..

댓글 쓰기 권한이 없습니다. 로그인

취소 댓글 등록

cmt alert

신고

"님의 댓글"

이 댓글을 신고하시겠습니까?

댓글 삭제

"님의 댓글"

삭제하시겠습니까?


목록

공유

facebooktwitterpinterestbandkakao story

첨부 0

번호 분류 제목 글쓴이 날짜 조회 추천
공지 정보 DSM 7.2v) Mshell로 헤놀로지 부트로더 빌드하기. 59 달소 23.05.29.01:57 23010 +23
공지 정보 DSM 7.2v) ARPL-i18n(rr)으로 헤놀로지 부트로더 빌드하기. 71 달소 23.05.23.23:58 24695 +23
업데이트 RR-24.3.7 업데이트 7 EXP 18시간 전12:25 272 +2
후기 27000원 헤놀 머신 조립 (장난감) 9 헤놀로지맨 1일 전19:51 671 +4
업데이트 릴리즈 봇이 v1.0.2.4 를 너무 여러번 올려 버려 민망하네요. ㅎㅎ 6 화정큐삼 2일 전00:52 335 +4
4966 질문
image
양수 6시간 전00:08 33 0
4965 잡담
image
훔친수건 5시간 전01:47 63 0
4964 질문
image
레이져 9시간 전21:16 63 0
4963 질문
image
스맛홈매니아 10시간 전20:21 59 0
4962 업데이트
image
EXP 18시간 전12:25 272 +2
4961 질문
image
유니파트 1일 전22:15 218 0
4960 후기
image
헤놀로지맨 1일 전19:51 671 +4
4959 질문
image
유니파트 1일 전18:24 64 0
4958 질문
normal
Skywa1ker 1일 전17:46 154 0
4957 질문
normal
블랙앤해적 1일 전17:37 41 0
4956 질문
normal
요트 1일 전17:13 281 0
4955 질문
normal
zip 1일 전13:01 125 0
4954 질문
normal
모랄로 1일 전09:30 120 0
4953 업데이트
normal
화정큐삼 2일 전00:52 335 +4
4952 후기
image
kmw_ 2일 전16:06 587 +2
4951 질문
image
메가펀치 2일 전15:42 83 0
4950 질문
normal
모랄로 2일 전13:01 114 0
4949 질문
image
아나구 2일 전12:02 175 0
4948 질문
image
짱구바붕 3일 전23:44 214 0
4947 잡담
image
유니파트 3일 전21:28 349 +1