Issues with Postgres when moving docker to other disk mount

Hello,

I have openSuse installed in a 40GB partition .

Docker by default uses /var/lib/docker/ to create volumes etc , which means i can only put a couple of images before i fill up the partition.

I edit the /etc/docker/daemon.json with “data-root”: “/lots/of/disk/space,”, restarted docker create all the volumes .

i run ./webodm.sh start it downloads /creates all the images and then greats me with db exited with code 1

db | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted broker | 1:C 08 Jan 2022 12:14:13.167 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo broker | 1:C 08 Jan 2022 12:14:13.167 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started broker | 1:C 08 Jan 2022 12:14:13.167 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf db | ******************************************************************************** db | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow db | anyone with access to the Postgres port to access your database without db | a password, even if POSTGRES_PASSWORD is set. See PostgreSQL db | documentation about "trust": db | https://www.postgresql.org/docs/current/auth-trust.html db | In Docker's default configuration, this is effectively any other db | container on the same system. db | db | It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace db | it with "-e POSTGRES_PASSWORD=password" instead to set a password in db | "docker run". db | ******************************************************************************** db | The files belonging to this database system will be owned by user "postgres". db | This user must also own the server process. db | db | The database cluster will be initialized with locale "en_US.utf8". db | The default database encoding has accordingly been set to "UTF8". db | The default text search configuration will be set to "english". db | db | Data page checksums are disabled. db | node-odm_1 | info: Authentication using NoTokenRequired node-odm_1 | info: Listening on 0.0.0.0:6367 UDP for progress updates worker | psql: error: could not translate host name "db" to address: Name or service not known broker | 1:M 08 Jan 2022 12:14:13.167 * monotonic clock: POSIX clock_gettime worker | Postgres is unavailable - sleeping worker | psql: error: could not connect to server: No route to host worker | Is the server running on host "db" (172.19.0.3) and accepting worker | TCP/IP connections on port 5432? worker | Postgres is unavailable - sleeping db | fixing permissions on existing directory /var/lib/postgresql/data ... initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted broker | 1:M 08 Jan 2022 12:14:13.167 * Running mode=standalone, port=6379. node-odm_1 | info: No tasks dump found broker | 1:M 08 Jan 2022 12:14:13.167 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. broker | 1:M 08 Jan 2022 12:14:13.167 # Server initialized broker | 1:M 08 Jan 2022 12:14:13.167 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. node-odm_1 | info: Checking for orphaned directories to be removed... node-odm_1 | info: Server has started on port 3000 broker | 1:M 08 Jan 2022 12:14:13.177 * Ready to accept connections worker | psql: error: could not connect to server: Connection refused worker | Is the server running on host "db" (172.19.0.3) and accepting worker | TCP/IP connections on port 5432? worker | Postgres is unavailable - sleeping db exited with code 1 worker | psql: error: could not translate host name "db" to address: Name or service not known worker | Postgres is unavailable - sleeping webapp | psql: error: could not connect to server: Connection refused webapp | Is the server running on host "db" (172.19.0.3) and accepting webapp | TCP/IP connections on port 5432? webapp | Postgres is unavailable - sleeping db | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted db | ******************************************************************************** db | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow db | anyone with access to the Postgres port to access your database without db | a password, even if POSTGRES_PASSWORD is set. See PostgreSQL db | documentation about "trust": db | https://www.postgresql.org/docs/current/auth-trust.html db | In Docker's default configuration, this is effectively any other db | container on the same system. db | db | It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace db | it with "-e POSTGRES_PASSWORD=password" instead to set a password in db | "docker run". db | ******************************************************************************** db | The files belonging to this database system will be owned by user "postgres". db | This user must also own the server process. db | db | The database cluster will be initialized with locale "en_US.utf8". db | The default database encoding has accordingly been set to "UTF8". db | The default text search configuration will be set to "english". db | db | Data page checksums are disabled. db | db | fixing permissions on existing directory /var/lib/postgresql/data ... initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted worker | psql: error: could not connect to server: Connection refused worker | Is the server running on host "db" (172.19.0.3) and accepting worker | TCP/IP connections on port 5432? worker | Postgres is unavailable - sleeping webapp | psql: error: could not translate host name "db" to address: Name or service not known webapp | Postgres is unavailable - sleeping worker | psql: error: could not translate host name "db" to address: Name or service not known worker | Postgres is unavailable - sleeping db | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted db | ******************************************************************************** db | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow db | anyone with access to the Postgres port to access your database without db | a password, even if POSTGRES_PASSWORD is set. See PostgreSQL db | documentation about "trust": db | https://www.postgresql.org/docs/current/auth-trust.html db | In Docker's default configuration, this is effectively any other db | container on the same system. db | db | It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace db | it with "-e POSTGRES_PASSWORD=password" instead to set a password in db | "docker run". db | ******************************************************************************** db | The files belonging to this database system will be owned by user "postgres". db | This user must also own the server process. db | db | The database cluster will be initialized with locale "en_US.utf8". db | The default database encoding has accordingly been set to "UTF8". db | The default text search configuration will be set to "english". db | db | Data page checksums are disabled. db | db | fixing permissions on existing directory /var/lib/postgresql/data ... initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted db exited with code 1 db | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted db | ******************************************************************************** db | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow db | anyone with access to the Postgres port to access your database without db | a password, even if POSTGRES_PASSWORD is set. See PostgreSQL db | documentation about "trust": db | https://www.postgresql.org/docs/current/auth-trust.html db | In Docker's default configuration, this is effectively any other db | container on the same system. db | db | It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace db | it with "-e POSTGRES_PASSWORD=password" instead to set a password in db | "docker run". db | ******************************************************************************** db | The files belonging to this database system will be owned by user "postgres". db | This user must also own the server process. db | db | The database cluster will be initialized with locale "en_US.utf8". db | The default database encoding has accordingly been set to "UTF8". db | The default text search configuration will be set to "english". db | db | Data page checksums are disabled. db | db | fixing permissions on existing directory /var/lib/postgresql/data ... initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

Is there a remedy to that ? (that folder doesnt exist btw “/var/lib/postgresql/”)

Am i doing this wrong ? is there a better way to make webodm and its paraphernalia run from an other mount ?

Thank you for your time,
Best!

1 Like

Welcome!

Sorry for the trouble.

I don’t have much hands-on with redirecting the mounts, but could you give us a bit more detail about your system?

How much RAM? How much SWAP?

Hello Saijin,

32GB ram, 2.2 GB swap partition , 5800x cpu.

thank you for your reply,
Best!

1 Like

Personally I use ubuntu mate on a 128gb ssd as my OS drive which is not a lot of space for ODM. when starting up webodm.sh there is a flag you can use to move the media dir to another drive if you have that available. EG. ./webodm.sh start --media-dir /media/yourdrive/odm this will move the assets to that directory however there is still data that gets stored in your home directory. I have found that the -optimize disk space option works well to keep disk usage of the home directory low. another option is within linux is to move the home directory to a bigger drive if possible… hope this helps…

1 Like

Hello uplanddog,

yep always have my users in an other mount (other physical disk)

and i do use the --media-dir still docker goes to your /var/lib/docker/ and by default it tries to create a volume of 100GB. That volume you can change , webodm just doesnt like it :D.

I think if it was in a repo like rest of linux software it would save people a bit a headache :smiley:

Thank you for your reply,
Best!

1 Like

I moved the docker directory off my OS drive as well. This is the directions I found that worked perfectly for my ubuntu distro: https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux

1 Like

Not saying no, but my thoughts on this are here:

If you can help contribute a port and maintain it, it’d be 100% a very welcome contribution! If you know Flatpak, we can get even wider coverage and closer to native!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.