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?

Paul White
95.4k30 gold badges440 silver badges689 bronze badges
asked Oct 30, 2020 at 14:30
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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.