Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjoOl-004GWl-0l for pgsql-admin@arkaria.postgresql.org; Thu, 29 Aug 2024 23:17:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sjoOi-009CtC-Ra for pgsql-admin@arkaria.postgresql.org; Thu, 29 Aug 2024 23:17:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sjoOi-009Ct4-Bv for pgsql-admin@lists.postgresql.org; Thu, 29 Aug 2024 23:17:49 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sjoOg-0025IQ-5A for pgsql-admin@lists.postgresql.org; Thu, 29 Aug 2024 23:17:47 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-27032e6dbf2so705573fac.1 for ; Thu, 29 Aug 2024 16:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724973465; x=1725578265; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=LYyN6admv12zQWwqdrWX3rJ9G/iBZlDUamRJbKzis/E=; b=fpn4M/RXSiJ0ZvFvBPK7agbW5sEt09DFsduQ07PkJi4ANDeQiqTFtmI5raaK7RicUK rqBnE2CqfRYX/yg6On4LYos2HyA8MsimyAYnoe0Gw5iLzD4Va7NhqHWjzpn/VPAbHg07 gSOQRoGU0TYdXHGJNcJwNiBOn2hRrmMx4zlM6t/qGh7tukptz09UIIV+zugtfBu/KKXB 0Ual2ggHnFobMlpmN7dYmkUwr4xraW5RKIXlrt/I0RpJ0UoLReqHLCo2C65fpXi2g4kq Hm88u42cjiTFxUbNDvFPjI8hrlRB+1diC57bYqXtA7ZEX5lrrQyJgYdktvRCF9Z0NVJ2 5QWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724973465; x=1725578265; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LYyN6admv12zQWwqdrWX3rJ9G/iBZlDUamRJbKzis/E=; b=h+GUfcJQxPGfPjJOi+V5IbpmfqVYx2wW7qvZmbuKxYeXF2ESc/WusYjHbG6PwfFrnw Or/BIq9LebOMhNkOK8mhOP4K/Lzo1T8FaSKEdP1Bqq1I4Os7AI+dZJnPFz2ytMgAdQkU XXdzvIauu0N9EpEGPm/oSxdz3nf3cT0vdFNMiOYvTC3y2kVTKB9+PJ1dLB/4UQzW/FWD iBRW9XrUC35lH3arhnsodQlojn86xPQyHx+9F6d4fFhJRuds8jeMo9MHqRZ20frc47L2 W1DPDlBO6meSjh+cCbjGx7wVLRKj57+hGI/7D+yt2D752JIvJKm7iQ5kzvCq7PuxY7fc xDBQ== X-Gm-Message-State: AOJu0YzrW9dFyVqVmpsipaBTGwLjBDeKWFXSU4QVLafUaW8oAYZU8sCa 9uinPOUYZ9dJiv40mtZ9nNHLcT4iUU7QBCnkTWRvLqPAjQZlC1L/hDMjo/Bz+W/WGuZNZHJbsE9 MZe5rb6erIzA+4NnWd/BurtoIl8t8pHxA X-Google-Smtp-Source: AGHT+IFcmdKnqAWBSgsFgeIABCMMAgeEivxrw9NVySLTC6llVULnN+ugGoMWk12bEPn56dRG6gF8DeFylqkzGX3vdjk= X-Received: by 2002:a05:6870:c115:b0:25d:ff4c:bc64 with SMTP id 586e51a60fabf-2779006f435mr5210060fac.6.1724973465259; Thu, 29 Aug 2024 16:17:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 29 Aug 2024 19:17:34 -0400 Message-ID: Subject: Re: Alternate Datafile Location To: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000a4d7210620daaeb2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a4d7210620daaeb2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 29, 2024 at 7:11=E2=80=AFPM Sam Stearns w= rote: > Howdy, > > Here's our filesystems: > > [postgres@xxx data]$ df -h > Filesystem Size Used Avail Use% Mounted on > devtmpfs 80G 0 80G 0% /dev > tmpfs 80G 44M 80G 1% /dev/shm > tmpfs 80G 716K 80G 1% /run > tmpfs 80G 0 80G 0% /sys/fs/cgroup > /dev/mapper/rhel-root 28G 4.5G 23G 17% / > tmpfs 80G 8.0K 80G 1% /tmp > /dev/sda2 1014M 457M 558M 46% /boot > /dev/sda1 599M 5.9M 594M 1% /boot/efi > /dev/mapper/pgwalvg-pgwalvol 570G 28K 541G 1% /PG_WAL > /dev/mapper/pgdatavg-pgdatavol 2.3T 28K 2.2T 1% /PGDATA > tmpfs 16G 0 16G 0% /run/user/124265122= 2 > tmpfs 16G 0 16G 0% /run/user/127124686= 8 > [postgres@xxx data]$ > > "df -Ph -x tmpfs -x devtmpfs" would make that look a lot neater. > Our Postgres software install and data directory is on root: > > [postgres@xxx data]$ pwd > /var/lib/pgsql/16/data > [postgres@thiludbapql01 data]$ df -h . > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/rhel-root 28G 4.5G 23G 17% / > [postgres@xxx data]$ > > > We want our database datafile storage to be on /PGDATA. > Making the $PGDATA environment variable the same as the directory name is bound to lead to shell errors. > I don't see anything in the version 16 documentation on how to accomplish > this. > Where did you look? How was the instance (aka cluster) created? > I must be missing it somewhere. Could someone please advise? > https://www.postgresql.org/docs/16/app-initdb.html -D *directory* --pgdata=3D*directory* This option specifies the directory where the database cluster should be stored. This is the only information required by initdb, but you can avoid writing it by setting the PGDATA environment variable, which can be convenient since the database server (postgres) can find the data directory later by the same variable. --=20 Death to America, and butter sauce. Iraq lobster! --000000000000a4d7210620daaeb2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Aug 29, 2024 at 7:11=E2=80=AFPM S= am Stearns <sam.stearns@dat.com> wrote:
Howdy,

Here= 9;s our filesystems:

[postgres@xxx data]$ df -hFilesystem =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0Size =C2=A0Used Avail Use% Mounted on
devtmpfs =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 8= 0G =C2=A0 =C2=A0 0 =C2=A0 80G =C2=A0 0% /dev
tmpfs =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A080G =C2=A0 44M =C2=A0 80G =C2=A0 1% /dev/shm
tmpfs =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A080G =C2=A0716K =C2=A0 80G =C2=A0 1% /run
tmpfs =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A080G =C2=A0 =C2=A0 0 =C2=A0 80G =C2=A0 0% /sys/fs/cgroup
/dev/mappe= r/rhel-root =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A028G =C2=A04.5G =C2=A0 = 23G =C2=A017% /
tmpfs =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A080G =C2=A08.0K =C2=A0 80G = =C2=A0 1% /tmp
/dev/sda2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01014M =C2=A0457M =C2=A0558M =C2=A046% /boot<= br>/dev/sda1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 599M =C2=A05.9M =C2=A0594M =C2=A0 1% /boot/efi
/dev/mappe= r/pgwalvg-pgwalvol =C2=A0 =C2=A0570G =C2=A0 28K =C2=A0541G =C2=A0 1% /PG_WA= L
/dev/mapper/pgdatavg-pgdatavol =C2=A02.3T =C2=A0 28K =C2=A02.2T =C2=A0= 1% /PGDATA
tmpfs =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A016G =C2=A0 =C2=A0 0 =C2=A0 16G= =C2=A0 0% /run/user/1242651222
tmpfs =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A016G =C2=A0 = =C2=A0 0 =C2=A0 16G =C2=A0 0% /run/user/1271246868
[postgres@xxx data]$<= br>


I don't = see anything in the version 16 documentation on how to accomplish this.=C2= =A0

Where did you look?



-D=C2=A0directory
--pgdata=3Ddirectory=C2=A0=

This option specifies the directory where the database cluster= should be stored. This is the only information required by=C2=A0initdb, but you can avoid writing it by setting the=C2=A0PGDATA=C2=A0environment va= riable, which can be convenient since the database server (postgres) c= an find the data directory later by the same variable.

<= br>
--
Death to America, and = butter sauce.
Iraq lobster!
--000000000000a4d7210620daaeb2--