I've been working on a postgres database, with my data directory on my 8TB external USB drive. Occasionally, I need to restart the postgres instance to change configuration settings, but for some reason I can never get the service to restart.
- Everything works fine in Windows 7
- Can't restart postgres in Windows 10
- Data directory in D:\postgresdata\
Database is empty at the moment, just the default postgres instance
When windows starts, the database engine starts automatically, and functions correctly
- Running "show data_directory" returns D:/postgresdata/
- Opening services.msc and restarting my postgres service starts and stops, never successfully starting.
pg_ctl.exe start -D D:\postgresdatafails to start with these errors:
FATAL: could not access status of transaction 0
DETAIL: Could not open file "pg_notify/0000": Invalid argument.
Things I've tried:
- I've tested the same scenario on my C: drive, and it always starts and restarts correctly.
- I've run chkdsk on the D: drive, nothing is wrong with it.
- I've played around with permissions on D: and nothing makes any difference.
- I've made a second partition from my C: drive and verified that a data directory on it always starts and restarts correctly.
- Initializing a new database with pg_ctl init -D D:\someotherpath\ on the D: drive does not work either, same error as restarting in general.
I'm at a loss for what else to try. The weirdest thing is how the system always starts up and works at system boot time, but not in any other circumstance.
Update: I attempted to run postgres against a USB thumb drive and the error is the same.