How To Mount postgresql Data folder on SAN
by sahab on Dec.15, 2009, under Database
Yesteday I got a problem for mounting postgresql data on Dell EMC Storage Area Network. The OS I have installed is RHEL 5.4, postgresql version is 8.4.
First I have map the SAN partition in to the server using navisphere agent. It map in to the server like
/dev/emcpower or /dev/sdb1
Using the command fdisk -l, we can check if the SAN mounted or not
I have tried to mount the /data folder into the server that time I got the issue like
Destination not writable, Readonly filesystem
Then I plan to install postgresql on SAN, That time I got the below error
–
The storage area network mounted on /database folder.
After that I have reformated storage device,
#mkfs.ext3 /dev/sdb1
Then mount the device on data folder of postgresql
#mount /dev/sdb1 /opt/postgresql/8.4/data
then copy all the data content to SAN
#cp -rp /opt/postgresql/8.4/data/* /opt/postgresql/8.4/data
Then restart the postgresql database server, if it is not start check with error message. Mostly the error comes with permission. The data folder permission is 700 owner and group is “postgres”.
rwx——- postgres:postgres data
Finally add the entry in /etc/fstab for permenant mount
/dev/sdb1 /opt/postgresql/8.4/data/ ext3 defaults 0 0