Trouble Mounting CIFS Volumes in Docker on Windows 11

0
6
Asked By DockerDude88 On

Hey everyone,

I've been struggling for a week trying to mount my CIFS volumes in Docker on my Windows 11 machine. Unfortunately, I lost a hard drive containing my Docker containers just as I was trying to set up backups. Now, I'm starting everything from scratch, but I can't seem to get my previously working CIFS volumes mounted again.

Here's what I've been doing:

1. I created a volume in Portainer with all the CIFS details pointing to my NAS.
2. I use this volume in my Docker Compose file for my audiobookshelf service.

Here's a snippet of my Docker Compose configuration:

```
services:
audiobookshelf:
restart: unless-stopped
image: ghcr.io/advplyr/audiobookshelf:latest
ports:
- 13378:80
volumes:
- Audiobooks:/audiobooks:ro
- .config:/config
- .metadata:/metadata
environment:
- TZ=America/Bogota
volumes:
Audiobooks:
external: true
```

However, no matter what I do, I keep getting this error message:

```
Error response from daemon: error while mounting volume '/var/lib/docker/volumes/Audiobooks/_data': failed to mount local volume: mount //192.168.0.1/Storage/Books/Audiobooks:/var/lib/docker/volumes/Audiobooks/_data, data: addr=192.168.0.1,username=docker,password=********,vers=2.0: invalid argument
```

I've tried changing the CIFS version, and everything seems fine with my paths and credentials. Does anyone have any ideas on what might be wrong? I appreciate any help!

3 Answers

Answered By NetNinja73 On

Before diving deeper, check if the CIFS mount works directly on your host machine. If it does, you might want to consider using a bind mount instead of a volume in Docker.

Answered By NASGuru99 On

Are you sure the NAS address is correct? Sometimes, 192.168.0.1 is used by the router itself, and it might cause issues. Try mounting it on the OS running Portainer for clearer insight.

Answered By TechWizard42 On

One thing to try is to delete the volume whenever you make changes to its definition, like adjusting the password or the CIFS mount point. This can help ensure Docker recreates it correctly when you run `docker compose up`. Let me know if that helps!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.