1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSL2/PodmanからGoogleDrive/Cryptomatorのファイルをマウントするまで

Last updated at Posted at 2024-10-31

はじめに

Google Driveのクラウド上にあるファイルやCryptomatorで暗号化してマウントしているファイルをWSL2から触る、もっと言うとPodmanのコンテナ上から触りたいなと思ったわけです。

厳密に言うと、最初は触れてたんですがとある時から触れなくなったのでそのトラブルシュートをまとめておきます。

なんかマウントできない

最初は、docker-composeコマンドとかでうまいことマウントしてくれていたのでGoogleDriveの中のファイルとか普通にPodmanのコンテナの中から読めてました。
ある時 docker-compose down したあとdocker-compose up -dすると起動しなくなりました。
色々と見ていくと以下のようなエラーが起きていました。

[+] Running 1/3
 ✔ Network docker_default  Created                              0.0s
 - Container komga_books  Creating                             0.1s
 - Container jellyfin    Creating                             0.1s
Error response from daemon: container create: statfs /mnt/f/hogehoge/Docker/path/config/cache: no such file or directory

要するに、ファイルが読めねーよっていうエラーです。

原因を切り分ける

Podmanが原因のエラーなのか、WSL2が原因のエラーなのか切り分けをしないといけないので、WSL2の中で動いてるpodman machineを見ていくことにしました。

> wsl -d podman-machine-default
$ ls /mnt/
c  d  f  g  wsl  wslg
$ ls /mnt/f
$
$ ls /mnt/g
$

なるほど、/mnt/f(CryptomatorでマウントしたFドライブ)や/mnt/g(GoogleDriveがマウントしているGドライブ)のマウントポイントはあるけど、マウントされてないっていうことらしい。
そもそもなんで最初はうまく言ってたのかはわからんですね。

ググりまくったけどまぁ解決しませんでした。

解決

色々試してpodを消したりしたところ、/mntディレクトリ配下にマウントポイントすら作られなくなっていたので、手動でマウントポイント作って手動でマウントしてやることにしました。

sudo mkdir /mnt/f
sudo mkdir /mnt/g
sudo mkdir /mnt/h
sudo mkdir /mnt/i
sudo mount -t drvfs f: /mnt/f
sudo mount -t drvfs g: /mnt/g
sudo mount -t drvfs h: /mnt/h
sudo mount -t drvfs i: /mnt/i

はい。そんな感じで1ヶ月位解決に要したトラブルに関してのお話でした。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?