Hi, I’m new to this group so apologies if this is something I should know.
I have used postgresql casually for several years but am wanting more space in my data directory.
I found: Setting up PostgreSQL Database Server :: Fedora Docs and believe I followed the instructions.
However when I run initdb I get the message:
initdb: error: directory “/var/lib/pgsql” exists but is not empty
initdb: detail: It contains a dot-prefixed/invisible file, perhaps due to it being a mount point.
initdb: hint: Using a mount point directly as the data directory is not recommended.
Create a subdirectory under the mount point.
pg_ctl: database system initialization failed
There is a warning that it is a bad idea to have /var/lib or /var/lib/pgsql as mount points.
My understanding is that the datadirectory is /var/lib/pgsql, and I cannot make a subdirectory under it.
Can someone clarify that the ‘postgres-setup’ webpage is still valid or if there is something I have misunderstood. .
What is your disk setup? Share lsblk -f
Where is the disk space you want to use?
It should be possible to use a separate partition for the postgresql database storage.
Have you read the postgresql docs on configuring storage?
The only issue I can think of with using mounted storage is to make sure systemd mounts the partition before postgresql service starts, which is easy to do.
Hi Barry,
I read the ‘setting up PostgresSQL Database Server’ mentioned above.
I have been through a number of combinations of starting and stopping the Postgres service, and mounting and unmounting the drive so do not believe the order in systemd is an problem.
I have a / partition and have set up a LVM partition, which I want to use as data directory.
An trimmed version of my df is: /dev/mapper/vg_store-pgsql 838451200 16088380 822362820 2% /var/lib/pgsql /dev/nvme1n1p2 201263328 46618312 144348596 25% /
I am familiar with the postgres documentation for moving the data directory, but my understanding is that Fedora forces initdb to use /var/lib/psql. The Fedora documentation indicates (and my experiance is) that initdb -D OTHER/PATH does not work.
I am running the current release system (fedora 6.14.9-300.fc42.x86_64)
You don’t really need to reinit the database.
Assuming that you have properly mounted the volume.
Stop the service, transfer the data, start the service:
Hopefully all working now.
I found the postgres log file and it said there was another service using the IP address. I went to the ‘Windows’ solution and did a hard reboot.
All good - thankyou.!