0

The OS is Ubuntu 20.04. I moved the data directory to a secondary disk. In the "Disks" utility, I clicked "Edit Mount Options", turned off "User Session Defaults", and specified a hard-coded Mount Point like /mnt/database, because by default it was mounted at something like /media/[user name]/disk label. "Mount at system startup" had been checked (unchanged from default).

Now, postgresql's automatic start at the system startup fails with a message like: "[data directory] is not accessible or does not exist". If I manually start it, by executing sudo systemctl start postgresql it starts fine. I suspect that the system tried to start postgresql before the secondary disk was automatically mounted. Is that so? If that is the case, how can I make it start after the secondary disk has been mounted?

0

1 Answer 1

0

I solved it. It was the order.

Open the service file:

sudo nano /lib/systemd/system/[email protected]

Add the disk's name at:

After=network.target mnt-[disk name].mount

If the disk name is "database", then it is mnt-database.mount. - https://dba.stackexchange.com/users/217951

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.