Dear listmembers,

I need to move

/var/lib/postgresql/8.4/main

from the / partion to another disc.

Based on the

http://wiki.postgresql.org/wiki/Simple_Configuration_Recommendation#File_System_Layouts

I plan the following.

0.) Mount new pgroot, are there any hints for the mount command?

mount -t ext4 -o noatime,nodiratime,nodev,noexec,nosuid /dev/sde1 /pgroot

    output from mount

/dev/sde1 on /pgroot type ext4 (rw,nosuid,nodev,noexec,noatime,nodiratime,barrier=1,data=ordered)


1.) create a full backup of the current DB

/usr/bin/pg_dumpall --file=/tmp/backup_before_part_move.tar --format=tar --oids --verbose --username=postgres

2.) Stop the database and the Apps which use the DB
    /etc/init.d/postgresql stop
    ....

3.) copy the current /var/lib/postgresql/8.4/main to the new dir as user postgres
    cd /var/lib/postgresql/
    tar cvf - . | (cd /pgroot/pgdata && tar xvf -)

4.) sync filesystems
    sync

5.) change data_directory to /pgroot/pgdata/8.4/main

6.) Start postgres
    /etc/init.d/postgresql start

OS: ubuntu 11.04
PG: postgresql-8.4 8.4.14-0ubuntu11.04

Please can anybody take a look about my planned process and tell me if I have
forgotten something and maybe point me to the right Doc, thanks.

Thanks for feedback.

Best regards
Aleks


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to