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 1s1xtD-00GNbh-Ac for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2024 00:32:03 +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 1s1xtA-009WhK-RH for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2024 00:32:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1xtA-009WhC-EM for pgsql-general@lists.postgresql.org; Wed, 01 May 2024 00:32:01 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1xt7-000vZp-Rv for pgsql-general@lists.postgresql.org; Wed, 01 May 2024 00:32:00 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6ee2fda66easo1471657a34.3 for ; Tue, 30 Apr 2024 17:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714523516; x=1715128316; 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=l84DqzbPoW+yLRCWO9ElJMXt/iO2sT5tbu30INBFWd8=; b=N+MuaO2gNnYaBwdPG7PWUsdUGN4HvyLmcHP0Bcv/OgnevE4ANw8M03g1+p65Bu6su5 BrBgv1bJiE/HNtfAgG+fcN2qaDev/+UaPkfshXPRdsauYGjix+3k1WGQZgeaZQ6NPVpn OCL1bN2QPIka8FNMgCwDwR+dhCUb7dau6aFR4M7O058fuJKm+cm9Gf2xFL0JhKZW7ttB 6BNNpf7EUR/sLX8cJ2etVfycMHaWvnP/C4uqbO+RVIFHEgijA8mlRF3agkG7llvSzNyK sqeHD2UlBMjUrbQkDrU9os6hcrbYsFaxcMqZkfMjRB07kn+wnG0zfhj1HWkQ/impWmEM QakQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714523516; x=1715128316; 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=l84DqzbPoW+yLRCWO9ElJMXt/iO2sT5tbu30INBFWd8=; b=BVhLjP0gx/uy0PrJSw7HF2CXgNr0t6S9jWc4JCPQbPzYDVpoLKBUydnDBTiJF9NXgh Wdly9cr2zYNHlqwkGb+evZsdRys2tuofNWIDrbfrcLIhkwop7L+0kbPOLPqiMktHDhQT dU64y2sD+A1Gg/CsbDOmvp15KwnBG3EdYiO7x5Kg3aHEKTwm7Um03Buk1w/Jm/FX5CL5 iJoRW11rlV/ZGLCCDO9K/NtPxaTRhq5D4qGAzxAcLajX9HnqmqcYWJT8CM49fvk0Vw38 c9YcVB22lrY6oyTVJMnxyWnwTep91wt0td+CdW1fTajFY1zdaMfbuxJBpfMsIT3DsSaV pR5g== X-Gm-Message-State: AOJu0YxgC46cDvmvbWgA4RG2KAUZr0Ym7bfbf8cCtwm/xkW01dXdOIYb 7f8fQBrcronQDCIcKum7zROzfEk3P/qrIX2UE6dGQ3WP0ma9Ip1fTk6nJaT5wxjzxwlbETc6dAy DQxiUyvWwf85lXz/Sf9Ah5JREEH04OTKn X-Google-Smtp-Source: AGHT+IFEdjZUyN3iPsn6uskLh82/4OR7j7265impxmc30Z1PJ+ZdioFfXXor/RzNNhQwIh+1qe9LWGw+QAb7Aep7EUg= X-Received: by 2002:a05:6870:c14d:b0:23d:5285:5dc6 with SMTP id g13-20020a056870c14d00b0023d52855dc6mr1101917oad.52.1714523515796; Tue, 30 Apr 2024 17:31:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Tue, 30 Apr 2024 20:31:45 -0400 Message-ID: Subject: Re: Linked directory or explicit reference To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000001e44810617599d0c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001e44810617599d0c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 30, 2024 at 7:00=E2=80=AFPM Senor Cervesa wrote: > Hi All; > > When doing an initial install of PostgreSQL on RHEL 7 or 8 derived OS via > rpm, what are pros, cons and recommendations of these 2 procedures for > utilizing a second disk? > > Secondary SSD or RAID mounted at /disk2. > > Option #1 > > 1. install the rpm which creates basic user and home > 2. Create symlink /var/lib/pgsql/15/data --> /disk2/data > 3. initdb with no special options > > Or Option #2 > > 1. install the rpm which creates basic user and home > 2. initdb with --pgdata=3D/disk2/data > Probably using included 'postgresql-12-setup' script > > I also link /var/lib/pgsql/data --> ../15/data so automation can > reference postgresql.conf without knowing version (legacy stuff). > In my experience,The PgBackRest restore feature does not like symlinks. > The install is automated with a bash script which handles several options > including whether there is a second disk for DB. Scripting the install wi= th > or without the second disk is straight forward but I'm concerned with > either scenario causing unforeseen differences. > > I don't think there's a benefit to using tablespace here but I have no > experience with it. The systemd service is configured with a dependency o= n > the disk mount so I don't think there are different risks for starting > postgres with missing data directory. > > I've run postgres in both scenarios and not had any issues. I'm intereste= d > in comments from others on their experience using these or other options. > Is the mount point just "/disk2" when using "--pgdata=3D/disk2/data"? I've gotten "directory not empty" errors when the mount point is "/Database/x.y/data". --0000000000001e44810617599d0c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Apr 30, 2024 at 7:00=E2=80=AFPM S= enor Cervesa <frio_cervesa@h= otmail.com> wrote:
=20

Hi All;

When doing an initial install of PostgreSQL on RHEL 7 or 8 derived OS via rpm, what are pros, cons and recommendations of these 2 procedures for utilizing a second disk?

Secondary SSD or RAID mounted at /disk2.

Option #1

  1. install the rpm which creates basic user and home
  2. Create symlink /var/lib/pgsql/15/data --> /disk2/data
  3. initdb with no special options

Or Option #2

  1. install the rpm which creates basic user and home
  2. initdb with --pgdata=3D/disk2/data
    Probably using included 'postgresql-12-setup' script

I also link /var/lib/pgsql/data=C2=A0 --> ../15/data so automatio= n can reference postgresql.conf without knowing version (legacy stuff).


In my experience,Th= e PgBackRest restore feature does not like symlinks.
=C2=A0

The install i= s automated with a bash script which handles several options including whether there is a second disk for DB. Scripting the install with or without the second disk is straight forward but I'm concerned with either scenario causing unforeseen differences.

I don't think there's a benefit to using tablespace here but= I have no experience with it. The systemd service is configured with a dependency on the disk mount so I don't think there are different risks for starting postgres with missing data directory.

I've run postgres in both scenarios and not had any issues. I= 9;m interested in comments from others on their experience using these or other options.

Is the mount point just = "/disk2" when using "--pgdata=3D/disk2/data"?=C2=A0 I&#= 39;ve gotten "directory not empty" errors when the mount point is= "/Database/x.y/data".

--0000000000001e44810617599d0c--