digint / digint/btrbk

perform more extensive checks on dryrun

Open
#27 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Perl
Stars
2.1k
Forks
139
PR merge metrics
No merged PRs in 30d

Description

So i was in the process of encrypting my entire system and recreating all my btrfs volumes/subvolumes in the process i made a mistake and created my snapshot dir as @Backup instead of @Backups like was set up originally and defined in btrbk.conf. When i ran dryrun it did not show me any errors:

```
btrbk -c /etc/btrbk/btrbk.conf dryrun
--------------------------------------------------------------------------------
Backup Summary (btrbk command line client, version 0.19.2)

Date: Thu Jun 11 08:43:35 2015
Config: /etc/btrbk/btrbk.conf

Legend:
=== up-to-date subvolume (source snapshot)
+++ created subvolume (source snapshot)
--- deleted subvolume
*** received subvolume (non-incremental)
>>> received subvolume (incremental)
--------------------------------------------------------------------------------
/mnt/btrfsroot/@Home
+++ /mnt/btrfsroot/@Backups/@Home.20150611
*** /media/Storage3/Backup/@HomeBackup/@Home.20150611

/mnt/btrfsroot/@Storage
+++ /mnt/btrfsroot/@Backups/@Storage.20150611
*** /media/Storage3/Backup/@StorageBackup/@Storage.20150611

NOTE: Dryrun was active, none of the operations above were actually executed!
```

but then when i ran run it failed(as it should since the @Backups subvol is not present):

```
btrbk -v -c /etc/btrbk/btrbk.conf run
btrbk command line client, version 0.19.2 (Thu Jun 11 08:44:04 2015)
Using configuration: /etc/btrbk/btrbk.conf
Creating subvolume snapshot for: /mnt/btrfsroot/@Home
>>> /mnt/btrfsroot/@Backups/@Home.20150611
ERROR: can't access '/mnt/btrfsroot/@Backups'
ERROR: Failed to create btrfs subvolume snapshot: /mnt/btrfsroot/@Home -> /mnt/btrfsroot/@Backups/@Home.20150611
WARNING: Skipping subvolume section: Failed to create snapshot: /mnt/btrfsroot/@Home -> /mnt/btrfsroot/@Backups/@Home.20150611
Creating subvolume snapshot for: /mnt/btrfsroot/@Storage
>>> /mnt/btrfsroot/@Backups/@Storage.20150611
ERROR: can't access '/mnt/btrfsroot/@Backups'
ERROR: Failed to create btrfs subvolume snapshot: /mnt/btrfsroot/@Storage -> /mnt/btrfsroot/@Backups/@Storage.20150611
WARNING: Skipping subvolume section: Failed to create snapshot: /mnt/btrfsroot/@Storage -> /mnt/btrfsroot/@Backups/@Storage.20150611
Completed within: 0s (Thu Jun 11 08:44:04 2015)
--------------------------------------------------------------------------------
Backup Summary (btrbk command line client, version 0.19.2)

Date: Thu Jun 11 08:44:04 2015
Config: /etc/btrbk/btrbk.conf

Legend:
=== up-to-date subvolume (source snapshot)
+++ created subvolume (source snapshot)
--- deleted subvolume
*** received subvolume (non-incremental)
>>> received subvolume (incremental)
--------------------------------------------------------------------------------
/mnt/btrfsroot/@Home
!!! Aborted: Failed to create snapshot: /mnt/btrfsroot/@Home -> /mnt/btrfsroot/@Backups/@Home.20150611

/mnt/btrfsroot/@Storage
!!! Aborted: Failed to create snapshot: /mnt/btrfsroot/@Storage -> /mnt/btrfsroot/@Backups/@Storage.20150611

NOTE: Some errors occurred, which may result in missing backups!
```

So it seems that some part of dryrun is not testing for the presence of the snapshot dir as it should.

```
btrfs subvol list /mnt/btrfsroot
ID 259 gen 9 top level 5 path @Backup
ID 646 gen 1303 top level 5 path @Home
ID 901 gen 1307 top level 5 path @Storage
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported case with `btrbk -c /etc/btrbk/btrbk.conf dryrun` and compare it with `btrbk -v -c /etc/btrbk/btrbk.conf run` when `@Backup` exists but `@Backups` does not. Trace the dry-run handling for the snapshot destination; done when dryrun reports the missing directory instead of presenting operations that run will fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.