linux,ubuntu linux,ubuntu guide,linux technical documentation

How To Mount postgresql Data folder on SAN

by admin 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

Installing
0% ______________ 50% ______________ 100%
#############################Error copying file from packed archive /root/Desktop/keltron/postgresql-8.4.1-1-linux-x64.bin to /database/PostgreSQL/8.4/pgAdmin3/share/pgadmin3/docs/sl_SI/hints/fki.html
:D estination not writable
[root@localhost database]# touch tt
touch: cannot touch `tt’: Read-only file system

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


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...