a year ago
I have a pgvector template in raiway which has no volume. So everything I redeploy my data is gone ☹ I want to add a volume, but postgress crashes, after adding the volume.
The path is /var/lib/postgresql/data/pgdata but the error said:
- initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
- initdb: detail: It contains a lost+found directory, 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.
How to add a volume?
10 Replies
a year ago
Can you try updating the volume's mounting point to /var/lib/postgresql instead of /var/lib/postgresql/data and let me know if that works ?
Status changed to Awaiting User Response Railway • about 1 year ago
nico
Can you try updating the volume's mounting point to `/var/lib/postgresql` instead of `/var/lib/postgresql/data` and let me know if that works ?
a year ago
I was thinking about that one, but I think that the volume will be very big?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
sorry I meant /var/lib/postgresql/data instead of /var/lib/postgresql/data/pgdata, which you said you were using
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
psql would need access to the entire /var/lib/postgresql/data and not just the pgdatasubdirectory
nico
psql would need access to the entire `/var/lib/postgresql/data` and not just the `pgdata`subdirectory
a year ago
the same error :(
Status changed to Awaiting Railway Response Railway • about 1 year ago
Status changed to Awaiting User Response Railway • about 1 year ago
nico
I don't see a volume on the pgvector service 🤔
a year ago
I removed it after it crsahed
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Its working now, I had to create a subfolder within the volume. Can be closed.
a year ago
I had to create subfolder within the volume
As in manually ? In any case, glad to hear you're unlocked.
If you want to share some more details I'm sure it'll help us unblock the next person 🙂
If not, feel free to leave the thread as-is; our system will close it out.
Thanks,
Nico
Status changed to Awaiting User Response Railway • about 1 year ago
nico
> I had to create subfolder within the volume As in manually ? In any case, glad to hear you're unlocked. If you want to share some more details I'm sure it'll help us unblock the next person 🙂 If not, feel free to leave the thread as-is; our system will close it out. Thanks, Nico
a year ago
Its easy. just create the volume with mount path for example /mnt/pgvolume
Set the variable PGDATA in postgres to /mnt/pgvolume/dbdata.
the subfolder is important. then redeploy all.
Status changed to Awaiting Railway Response Railway • about 1 year ago
Status changed to Solved nico • about 1 year ago