corpspaster.blogg.se

Change default file location ubuntu
Change default file location ubuntu













change default file location ubuntu

Oct 06 02:46:08 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Starting PostgreSQL RDBMS. Main PID: 2379 (code=exited, status=0/SUCCESS) Process: 2379 ExecStart=/bin/true (code=exited, status=0/SUCCESS) # whoamiĪctive: active (exited) since Sun 02:46:08 UTC 8s ago Now I can start the postgresql service and query the database cluster to show the data_directory to make sure the change was successful. # option or PGDATA environment variable, represented here as ConfigDir.ĭata_directory = '/pgdata/main' # use data in another directory # The default values of these variables are driven from the -D command-line

Change default file location ubuntu update#

Then I update the data_directory variable in the /etc/postgresql/11/main/nf config file to point to the new directory. rsync -av /var/lib/postgresql/11/main /pgdata Next I use rsync file transfer program to copy contents of the data directory to the /pgdata volume as follows. # lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINTīefore transferring any files I must make the /pgdata directory have the same ownership and permissions as the default data directory. Oct 05 14:55:39 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Stopped PostgreSQL RDBMS.įor this example I have attached to my Ubuntu server an isolated storage volume and mounted it to the /pgdata directory which will be the target for transfering the default data directory to. Oct 05 13:46:23 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloaded PostgreSQL RDBMS. Oct 05 13:46:23 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloading PostgreSQL RDBMS.

change default file location ubuntu change default file location ubuntu

Oct 05 01:52:53 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloaded PostgreSQL RDBMS. Oct 05 01:52:53 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloading PostgreSQL RDBMS. Oct 05 01:33:21 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloaded PostgreSQL RDBMS. Oct 05 01:33:21 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloading PostgreSQL RDBMS. Oct 05 01:32:01 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloaded PostgreSQL RDBMS. Oct 05 01:32:01 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Reloading PostgreSQL RDBMS. Sep 28 03:18:45 ubuntu-s-1vcpu-1gb-nyc3-01 systemd: Started PostgreSQL RDBMS. Main PID: 17504 (code=exited, status=0/SUCCESS) Process: 30500 ExecReload=/bin/true (code=exited, status=0/SUCCESS) Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled)Īctive: inactive (dead) since Sat 14:55:39 UTC 9s ago rw- 1 postgres postgres 130 Sep 28 03:18 postmaster.optsĪfterwards I need to stop the postgresql service which I do as root (or any other user with sudo privilleges). rw- 1 postgres postgres 88 Sep 28 03:18 rw- 1 postgres postgres 3 Sep 28 03:18 PG_VERSIONĭrwx- 7 postgres postgres 4096 Oct 5 02:24 baseĭrwx- 2 postgres postgres 4096 Sep 28 04:38 globalĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_commit_tsĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_dynshmemĭrwx- 4 postgres postgres 4096 Oct 5 14:55 pg_logicalĭrwx- 4 postgres postgres 4096 Sep 28 03:18 pg_multixactĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_notifyĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_replslotĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_serialĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_snapshotsĭrwx- 2 postgres postgres 4096 Oct 5 14:55 pg_statĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_stat_tmpĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_subtransĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_tblspcĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_twophaseĭrwx- 3 postgres postgres 4096 Sep 28 03:18 pg_walĭrwx- 2 postgres postgres 4096 Sep 28 03:18 pg_xact It is important to take note of the ownership and permissions of the data directory because I need to make sure the new directory matches them. Changing the Default Data Directory on Ubuntuįirst things first I identify the location of the default data directory by querying the database cluster for the value of data_directory as the postgres Linux superuser.















Change default file location ubuntu