2
0
Эх сурвалжийг харах

Create LVM snapshots as read-write to avoid an error when snapshotting ext4 filesystems with orphaned files that need recovery (#1126).

Dan Helfman 3 долоо хоног өмнө
parent
commit
36d6619099

+ 2 - 0
NEWS

@@ -2,6 +2,8 @@
  * #1114: Document systemd configuration changes for the ZFS filesystem hook.
  * #1118: Fix a bug in which Borg hangs during database backup when different filesystems are in
    use.
+ * #1126: Create LVM snapshots as read-write to avoid an error when snapshotting ext4 filesystems
+   with orphaned files that need recovery.
  * When running tests, use Ruff for faster and more comprehensive code linting and formatting,
    replacing Flake8, Black, isort, etc.
  * Switch from pipx to uv for installing development tools, and added tox-uv for speeding up test

+ 1 - 1
borgmatic/hooks/data_source/lvm.py

@@ -106,7 +106,7 @@ def snapshot_logical_volume(
             ('--extents' if '%' in snapshot_size else '--size'),
             snapshot_size,
             '--permission',
-            'r',  # Read-only.
+            'rw',  # Read-write in case an ext4 filesystem has orphaned files that need recovery.
             '--name',
             snapshot_name,
             logical_volume_device,

+ 2 - 2
tests/unit/hooks/data_source/test_lvm.py

@@ -212,7 +212,7 @@ def test_snapshot_logical_volume_with_percentage_snapshot_name_uses_lvcreate_ext
             '--extents',
             '10%ORIGIN',
             '--permission',
-            'r',
+            'rw',
             '--name',
             'snap',
             '/dev/snap',
@@ -232,7 +232,7 @@ def test_snapshot_logical_volume_with_non_percentage_snapshot_name_uses_lvcreate
             '--size',
             '10TB',
             '--permission',
-            'r',
+            'rw',
             '--name',
             'snap',
             '/dev/snap',