Search Postgresql Archives

general fear question about move PGDATA from one Disc to another

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux