0

There is a Postgres database on BTRFS. I need to make a backup of the database while it is running. Should I do btrfs filesystem sync before the snapshot or btrfs subvolume snapshot does it for me automatically?

Jonas
  • 337
  • 2
  • 10

1 Answers1

2

From the btrfs-subvolume man page:

Subvolume creation needs to flush dirty data that belong to the subvolume

So yes, btrfs subvolume snapshot will take care of it for you if we stick to your question.

Given that you're attempting to backup a PostgreSQL database, depending on the scenario you might also be interested in the pg_dump utility instead or PostgreSQL WAL-shipping if you need point-in-time recovery.

Ginnungagap
  • 2,595
  • 10
  • 13