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?
Asked
Active
Viewed 102 times
0

Jonas
- 337
- 2
- 10
-
what speaks against a mysql dump? – djdomi Mar 17 '23 at 19:53
-
@djdomi It being postgresql? – vidarlo Mar 17 '23 at 20:54
-
The database identifies itself as PostgreSQL, there is little I can do. – Jonas Mar 18 '23 at 05:20
1 Answers
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
-
I am moving away from pg_dump as it takes too long to restore a large database. – Jonas Mar 18 '23 at 08:12