0

I didn't pay attention when i installed postgresql with aptitude, but it installed the databases in the wrong partition.

Now my partitions look like this:

# df -h Filesystem Size Used Avail Use% Mounted on /dev/md1 10G 8.7G 793M 92% / tmpfs 2.0G 0 2.0G 0% /lib/init/rw udev 10M 176K 9.9M 2% /dev tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/md2 683G 197M 649G 1% /home 

I checked and postgresql data is installed on /dev/md1

This will be a problem in no time, and I would like to fix this. What is the best approach ? Can i simply move the postgresql directory and patch some configuration file ? Can I extend the size of the partition dev/md1 ?

I'm looking for a way to do any of this successfully.

1
  • Yes you can. No problem. Commented Jan 12, 2012 at 21:46

1 Answer 1

1

Shut down postgresql, move its directory to a new location, then either create a symlink from the old to the new location, or edit the configuration file, make sure the permissions are correct after moving (!). Finally start postgresql.

I have done this many times with mysql, or even oracle, it's perfectly fine as long as you don't mind the downtime. Don't try it on a running database server of course. In that case use the ways provided by the server to move files around. But at least in oracle's case you will still cause a bit of interruption of service since you'd have to take tablespace temporarily offline.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.