Thread: How to safely remove a corrupted cluster?
If the saying "to learn you have to make mistakes", I'm "learning"...:
I removed a cluster's folder without using pg_dropcluster... sio now I have a corrupted cluster. How can I safely remove it?
(base) marco@pc:~$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
11 fabmnet 5433 down <unknown> /var/lib/postgresql/11/fabmnet /var/log/postgresql/postgresql-11-fabmnet.log
11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
Ver Cluster Port Status Owner Data directory Log file
11 fabmnet 5433 down <unknown> /var/lib/postgresql/11/fabmnet /var/log/postgresql/postgresql-11-fabmnet.log
11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
(base) marco@pc:~$ pg_dropcluster 11 fabmnet
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reload
(base) marco@pc:~$ sudo systemctl daemon-reload
[sudo] password for marco:
(base) marco@pc:~$ pg_dropcluster 11 fabmnet
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reload
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reload
(base) marco@pc:~$ sudo systemctl daemon-reload
[sudo] password for marco:
(base) marco@pc:~$ pg_dropcluster 11 fabmnet
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reload
Marco
Solved by repeating the execution of (base) postgres@pc:~$ pg_dropcluster --stop 11 fabmnet :
(base) postgres@pc:~$ pg_dropcluster --stop 11 fabmnet
Error: specified cluster does not exist
Error: specified cluster does not exist
Marco
Il giorno gio 19 set 2019 alle ore 13:02 Marco Ippolito <ippolito.marco@gmail.com> ha scritto:
If the saying "to learn you have to make mistakes", I'm "learning"...:I removed a cluster's folder without using pg_dropcluster... sio now I have a corrupted cluster. How can I safely remove it?(base) marco@pc:~$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
11 fabmnet 5433 down <unknown> /var/lib/postgresql/11/fabmnet /var/log/postgresql/postgresql-11-fabmnet.log
11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log(base) marco@pc:~$ pg_dropcluster 11 fabmnet
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reload
(base) marco@pc:~$ sudo systemctl daemon-reload
[sudo] password for marco:
(base) marco@pc:~$ pg_dropcluster 11 fabmnet
Warning: corrupted cluster: data directory does not exist
Warning: systemd was not informed about the removed cluster yet. Operations like "service postgresql start" might fail. To fix, run:
sudo systemctl daemon-reloadMarco