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 1ultGs-006uLo-HN for pgsql-general@arkaria.postgresql.org; Tue, 12 Aug 2025 17:58:50 +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 1ultGp-0094Lg-K9 for pgsql-general@arkaria.postgresql.org; Tue, 12 Aug 2025 17:58:47 +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 1ultGp-0094LY-9E for pgsql-general@lists.postgresql.org; Tue, 12 Aug 2025 17:58:47 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ultGm-000E9n-2K for pgsql-general@lists.postgresql.org; Tue, 12 Aug 2025 17:58:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=98DiRmOWesQI68WD6QQP615R/oujDGHjvNHRn94HkkA=; b=iurbb13WS/ccfhx2H06Rz9zX1+ pTV6ROrV6Y2NRyUqKBosYPgj25G0Vk1Xm+9/SemVbnC3xbCpWZUg9TZT+p4I/NsC5uzC4afbx+uML tDzP0g8FkD/RPqkmKIOSHnDzQzlQuG9j4OBHus6XpDsa4V6hcSqwtdEXofbe6I4EqonN1QzxeB0sZ eCWf0wFRlwaj0NBpa0j+cwJFyA5vgLwt6YBlRrmcEcEAfgy1gAG9jOyYrgF7fZPSneAEF1WEvwpmq V8gF/ytMp+2QJMUiymDl9KI8aT3DqdkgDDDhqw3RJPBp6egST2fDNSxtVn2E7iyZLw1NXIHX28dCq SL+SJvog==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1ultGl-00ABPJ-2q; Tue, 12 Aug 2025 13:58:43 -0400 Date: Tue, 12 Aug 2025 13:58:43 -0400 From: Bruce Momjian To: Greg Sabino Mullane Cc: Nick Cleaton , PostgreSQL General Subject: Re: Backups with filesystem snapshots Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 11, 2025 at 12:41:12PM -0400, Greg Sabino Mullane wrote: > On Mon, Aug 11, 2025 at 9:01 AM Nick Cleaton wrote: > > If I take an instantaneous filesystem-level snapshot of the postgres > data directory underneath a running postgres server, is that a safe > backup without doing any pg_start_backup/pg_stop_backup ? > > > Safe, yes[*], but not particularly recommended except for special cases, like > spinning up a fast QA cluster. For backups, use a Postgres-aware battle tested > system like pgBackRest that offers more flexibility and more safeguards. > > * Assuming your hardware/OS drivers are being honest with you about fsync > > > starting up from that snapshot should look the same as recovering from an > unclean postgres shutdown > due to a kernel panic. > > > Yes, for all practical purposes it would be identical. Technically more similar > to pulling the plug on the server. :) Also, be careful that any tablespaces are also in the same snapshot. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.