You can mount sdb1 anywhere on the "tree". The default CentOS 7.x data directory for postgresql is /var/lib/pgsql and IMHO would keep it the same location i.e just mount sdb1 at /var/lib/pgsql.
I assume that postgresql is currently installed.
Shutdown postgresql
rsync the existing data to /mnt (since it is already mounted there)
Remount sdb1 /var/lib/pgsql
Restart postgresql
The old data still exists on the / but you can go back and delete it by shutting down the server and unmounting sdb1.
It depends on what you mean by accessible and viewable. Any application would use an existing API to access the database i.e libreoffice, php, c program etc or even pg_dump. The only reason I ever directly access the /var/lib/pgsql/.. would be to change a configuration file.
Last edited by michaelk; 07-02-2020 at 01:34 PM.
|