0

my postgresql (9.3.4) was running on Ubuntu, and suddenly stopped tonight. When I try to stop it, logged in as postgres, I get

~$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop;
pg_ctl: could not send stop signal (PID: 9242): No such process

when I try to start it, I get

$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql  /data/postgresql.log start;
pg_ctl: another server might be running; trying to start server anyway
server starting
sh: 1: cannot create /usr/local/pgsql/data/postgresql.log: Read-only file system

So it doesn't start, and oddly enough, I get this complaint about postgresql.log too.

~$ ls -l /usr/local/pgsql/data/postgresql.log
-rw------- 1 postgres postgres 351089 May 21 16:45 /usr/local/pgsql/data/postgresql.log

Strange that it complains about it being a read-only file system..? Even stranger, even as root, I cannot delete that file ...

~# rm /usr/local/pgsql/data/postgresql.log
rm: cannot remove `/usr/local/pgsql/data/postgresql.log': Read-only file system

Same goes for the postmaster.pid

# rm -f /usr/local/pgsql/data/postmaster.pid
rm: cannot remove `/usr/local/pgsql/data/postmaster.pid': Read-only file system

How could I get my postgresql back to running?

user410932
  • 155
  • 2
  • 7

1 Answers1

0

You will need to fix the read only filesystem problem. I would ensure that my backups are good before trying to do anything else, you may end up having to use them anyway.

This could be as easy as

mount -o remount,rw filesystem

It may be much more complicated and involve having to unmount the filesystem and run filesystem checks via fsck.

If for some reason you can't unmount the filesysem, you can try

touch /forcefsck
reboot

which will cause the system to run automatic filesystem checks as part of the boot sequent.

Did I mention backups - I hope you have known good ones.

user9517
  • 115,471
  • 20
  • 215
  • 297