acostanz
(Acostanz)
April 3, 2025, 4:30pm
1
Created a volum:
docker volume create --opt device=/dev/sdb1 pgdata
using the following to start/run the container:
podman run --replace -d --name my-postgresdb-container -p 5432:5432 -e POSTGRES_PASSWORD=XXXXX --mount type=volume,source=pgdata,destination=/home/postgres/pgdata/data localhost/my-postgres-db:latest
container doesn’t start and we get the error:
Error: mounting volume pgdata for container 0463b76c9132e230bf6b7a90c8d99bdbeab9f323c83821b9232201e5ece5cc14: mount: /home/postgres/.local/share/containers/storage/volumes/pgdata/_data: permission denied.
any insight? w’re using Linux type file system mkfs ext2
when I remove the --mount, the container starts. not sure what is up. any help is appreciated! Thanks
meyay
(Metin Y.)
April 3, 2025, 7:16pm
2
Looks like the volume misses the option to declare the type. You can try if adding --opt type=ext2
helps.
Why would anyone want to use ext2 over ext4?
Update: the logs indicate a permission issue. You might need to fix the owner and/or permissions of the root of the filesystem.
acostanz
(Acostanz)
April 3, 2025, 7:21pm
3
I said ext4, the SA said “let’s try ext2 and see what happens”. We’ll try ext4 next, then xfs if that doesn’t work.
Thanks for the tip!
meyay
(Metin Y.)
April 3, 2025, 7:25pm
4
ext2 was release 32 years ago. ext4 17 years ago. I hope his/her argument was not that it’s too cutting edge
acostanz
(Acostanz)
April 3, 2025, 7:34pm
5
1 Like
meyay
(Metin Y.)
April 4, 2025, 6:52am
7
Well spotted! I missed it.
acostanz
(Acostanz)
April 4, 2025, 4:31pm
8
I tried to not be so fancy and just ran:
docker volume create pgdata
I mounted this using -v pgdata:/home/postgres/pgdata
I was then able to persist data between container runs.
Thanks to all that responded!
acostanz
(Acostanz)
April 4, 2025, 4:34pm
9
And i missed this, too.
podman=docker and docker=podman
No. It’s similar software, but it’s not 100% compatible. I would not expect a Docker volume to work with a podman container.
acostanz
(Acostanz)
April 5, 2025, 2:34am
11
Most likely true. I’m a DBA and just getting started in the world of containers.
I’m just lucky, I guess. In this case a docker volume worked with a podman container.