Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Restore of snapshot: No dependencies are shown #7

Closed
Daniel-at-git opened this issue Jan 2, 2022 · 4 comments
Closed

After Restore of snapshot: No dependencies are shown #7

Daniel-at-git opened this issue Jan 2, 2022 · 4 comments
Labels

Comments

@Daniel-at-git
Copy link

After I restored a snapshot the dependencies are not shown.

To reproduce the issue...
Generate a test volume and some snapshots

btrfs subvolume create test   # Create new subvolume
btrfs subvolume snapshot test test-backup  # Do a backup
btrfs subvolume snapshot test test-backup2   # Another backup

Show it with btrfs-list

btrfs-list /mnt/pro/ |grep -E 'NAME|single|test'
NAME                                          TYPE    REFER     EXCL  MOUNTPOINT
b04de56b                                        fs       -   374.04G (single, 546.00G free)
   test                                     subvol   16.00k   16.00k 
      test-backup                             snap   16.00k   16.00k 
      test-backup2                            snap   16.00k   16.00k 

If you now have to restore your test-backup2 you do

btrfs subvolume delete test
Delete subvolume (no-commit): '/mnt/pro/test'
btrfs subvolume snapshot test-backup2 test
Create a snapshot of 'test-backup2' in './test'

And after some days create a new backup
btrfs subvolume snapshot test test-backup-after-restore

Now btrfs-list didn't show dependencies ("test-backup-after-restore" should depend to "test")

btrfs-list /mnt/pro/ |grep -E 'NAME|single|test'
NAME                                          TYPE    REFER     EXCL  MOUNTPOINT
b04de56b                                        fs       -   374.04G (single, 546.00G free)
test-backup2                                  snap   16.00k   16.00k 
test                                          snap   16.00k   16.00k 
test-backup                                   snap   16.00k   16.00k 
test-backup-after-restore                     snap   16.00k   16.00k 

"test-backup-after-restore" is shown as snapshot with normal btrfs tool:

btrfs subvolume show test
test
        Name:                   test
        UUID:                   8db29b7d-5331-7742-af40-92b65eb22884
        Parent UUID:            57fadfee-483f-0b42-9229-c68bf12ddabc
        Received UUID:          -
        Creation time:          2022-01-02 10:41:07 +0100
        Subvolume ID:           474
        Generation:             87841
        Gen at creation:        87834
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2022-01-02 10:41:07 +0100
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
                                test-backup-after-restore
        Quota group:            0/474
          Limit referenced:     -
          Limit exclusive:      -
          Usage referenced:     16.00KiB
          Usage exclusive:      16.00KiB
@speed47
Copy link
Owner

speed47 commented Jan 2, 2022

Thanks for the bug report and detailed reproducer, will look into it!

@speed47
Copy link
Owner

speed47 commented Jan 2, 2022

Could you try the better_search branch? I reworked the parent searching algorithms to better take into account orphan volumes (with disappeared parent volumes)

https://github.com/speed47/btrfs-list/blob/better_search/btrfs-list

@speed47
Copy link
Owner

speed47 commented Jan 2, 2022

You might want to also try the (new) --deleted option

@Daniel-at-git
Copy link
Author

Could you try the better_search branch?

Awesome !

./btrfs-list /mnt/pro/ |grep -E 'NAME|single|test'
NAME                                             TYPE    REFER     EXCL  MOUNTPOINT
b04de56b                                           fs       -   378.87G (single, 541.17G free)
   test-backup2                                  snap   16.00k   16.00k 
      test                                       snap   16.00k   16.00k 
         test-backup-after-restore               snap   16.00k   16.00k 
   test-backup                                   snap   16.00k   16.00k 

Thanks very much!
And also thanks for the delete option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants