How to test if two btrfs snapshots are identical or not?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












As far as I know, in order to determine if a snapshot is identical with another one or not, we should check if Received UUID of destination is equal to UUID of source snapshot or not.



But this time, this procedure can not be applied:



root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs send rootfs.20170705T1334/ | pv | btrfs receive /mnt/aea3/manual-snapshots/ 
At subvol rootfs.20170705T1334/
At subvol rootfs.20170705T1334
37.8GiB 0:37:27 [17.2MiB/s] [
root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show rootfs.20170705T1334/
/mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334
Name: rootfs.20170705T1334
UUID: e66ace1b-3efc-5d40-b3ca-af000110e89d
Parent UUID: 85bc19f1-9d61-da43-a4be-40c717aee652
Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
Creation time: 2017-07-10 12:47:16 +0300
Subvolume ID: 2561
Generation: 4331
Gen at creation: 4327
Parent ID: 257
Top level ID: 257
Flags: readonly
Snapshot(s):
snapshots/rootfs/rootfs.20170710T1242
root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show /mnt/aea3/manual-snapshots/rootfs.20170705T1334/
/mnt/aea3/manual-snapshots/rootfs.20170705T1334
Name: rootfs.20170705T1334
UUID: 53bc9463-2fe6-9a41-b17d-a0a8dc5e6086
Parent UUID: -
Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
Creation time: 2017-07-12 10:36:50 +0300
Subvolume ID: 1832
Generation: 64698
Gen at creation: 64627
Parent ID: 1831
Top level ID: 1831
Flags: readonly
Snapshot(s):
root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs --version
btrfs-progs v4.11


However, when I create and send a test snapshot and send it on the same drives on the same machine, it works as expected:



root@aea3:/mnt/zencefil/test# btrfs send mytest1/ | pv | btrfs receive /mnt/aea3/test/
At subvol mytest1/
At subvol mytest1
540 B 0:00:00 [73.1KiB/s] [ ]
root@aea3:/mnt/zencefil/test# btrfs sub show mytest1/
/mnt/zencefil/test/mytest1
Name: mytest1
UUID: 3a932406-8a81-5047-9a23-9333564752c2
Parent UUID: -
Received UUID: -
Creation time: 2017-07-12 11:41:22 +0300
Subvolume ID: 2567
Generation: 4369
Gen at creation: 4367
Parent ID: 5
Top level ID: 5
Flags: readonly
Snapshot(s):
root@aea3:/mnt/zencefil/test# btrfs sub show /mnt/aea3/test/mytest1/
/mnt/aea3/test/mytest1
Name: mytest1
UUID: 98d59473-5a47-7742-bcf7-47262b9cada2
Parent UUID: -
Received UUID: 3a932406-8a81-5047-9a23-9333564752c2
Creation time: 2017-07-12 11:44:16 +0300
Subvolume ID: 1844
Generation: 64738
Gen at creation: 64737
Parent ID: 5
Top level ID: 5
Flags: readonly
Snapshot(s):


What is the missing point here?










share|improve this question



























    up vote
    3
    down vote

    favorite












    As far as I know, in order to determine if a snapshot is identical with another one or not, we should check if Received UUID of destination is equal to UUID of source snapshot or not.



    But this time, this procedure can not be applied:



    root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs send rootfs.20170705T1334/ | pv | btrfs receive /mnt/aea3/manual-snapshots/ 
    At subvol rootfs.20170705T1334/
    At subvol rootfs.20170705T1334
    37.8GiB 0:37:27 [17.2MiB/s] [
    root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show rootfs.20170705T1334/
    /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334
    Name: rootfs.20170705T1334
    UUID: e66ace1b-3efc-5d40-b3ca-af000110e89d
    Parent UUID: 85bc19f1-9d61-da43-a4be-40c717aee652
    Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
    Creation time: 2017-07-10 12:47:16 +0300
    Subvolume ID: 2561
    Generation: 4331
    Gen at creation: 4327
    Parent ID: 257
    Top level ID: 257
    Flags: readonly
    Snapshot(s):
    snapshots/rootfs/rootfs.20170710T1242
    root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show /mnt/aea3/manual-snapshots/rootfs.20170705T1334/
    /mnt/aea3/manual-snapshots/rootfs.20170705T1334
    Name: rootfs.20170705T1334
    UUID: 53bc9463-2fe6-9a41-b17d-a0a8dc5e6086
    Parent UUID: -
    Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
    Creation time: 2017-07-12 10:36:50 +0300
    Subvolume ID: 1832
    Generation: 64698
    Gen at creation: 64627
    Parent ID: 1831
    Top level ID: 1831
    Flags: readonly
    Snapshot(s):
    root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs --version
    btrfs-progs v4.11


    However, when I create and send a test snapshot and send it on the same drives on the same machine, it works as expected:



    root@aea3:/mnt/zencefil/test# btrfs send mytest1/ | pv | btrfs receive /mnt/aea3/test/
    At subvol mytest1/
    At subvol mytest1
    540 B 0:00:00 [73.1KiB/s] [ ]
    root@aea3:/mnt/zencefil/test# btrfs sub show mytest1/
    /mnt/zencefil/test/mytest1
    Name: mytest1
    UUID: 3a932406-8a81-5047-9a23-9333564752c2
    Parent UUID: -
    Received UUID: -
    Creation time: 2017-07-12 11:41:22 +0300
    Subvolume ID: 2567
    Generation: 4369
    Gen at creation: 4367
    Parent ID: 5
    Top level ID: 5
    Flags: readonly
    Snapshot(s):
    root@aea3:/mnt/zencefil/test# btrfs sub show /mnt/aea3/test/mytest1/
    /mnt/aea3/test/mytest1
    Name: mytest1
    UUID: 98d59473-5a47-7742-bcf7-47262b9cada2
    Parent UUID: -
    Received UUID: 3a932406-8a81-5047-9a23-9333564752c2
    Creation time: 2017-07-12 11:44:16 +0300
    Subvolume ID: 1844
    Generation: 64738
    Gen at creation: 64737
    Parent ID: 5
    Top level ID: 5
    Flags: readonly
    Snapshot(s):


    What is the missing point here?










    share|improve this question

























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      As far as I know, in order to determine if a snapshot is identical with another one or not, we should check if Received UUID of destination is equal to UUID of source snapshot or not.



      But this time, this procedure can not be applied:



      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs send rootfs.20170705T1334/ | pv | btrfs receive /mnt/aea3/manual-snapshots/ 
      At subvol rootfs.20170705T1334/
      At subvol rootfs.20170705T1334
      37.8GiB 0:37:27 [17.2MiB/s] [
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show rootfs.20170705T1334/
      /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334
      Name: rootfs.20170705T1334
      UUID: e66ace1b-3efc-5d40-b3ca-af000110e89d
      Parent UUID: 85bc19f1-9d61-da43-a4be-40c717aee652
      Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
      Creation time: 2017-07-10 12:47:16 +0300
      Subvolume ID: 2561
      Generation: 4331
      Gen at creation: 4327
      Parent ID: 257
      Top level ID: 257
      Flags: readonly
      Snapshot(s):
      snapshots/rootfs/rootfs.20170710T1242
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show /mnt/aea3/manual-snapshots/rootfs.20170705T1334/
      /mnt/aea3/manual-snapshots/rootfs.20170705T1334
      Name: rootfs.20170705T1334
      UUID: 53bc9463-2fe6-9a41-b17d-a0a8dc5e6086
      Parent UUID: -
      Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
      Creation time: 2017-07-12 10:36:50 +0300
      Subvolume ID: 1832
      Generation: 64698
      Gen at creation: 64627
      Parent ID: 1831
      Top level ID: 1831
      Flags: readonly
      Snapshot(s):
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs --version
      btrfs-progs v4.11


      However, when I create and send a test snapshot and send it on the same drives on the same machine, it works as expected:



      root@aea3:/mnt/zencefil/test# btrfs send mytest1/ | pv | btrfs receive /mnt/aea3/test/
      At subvol mytest1/
      At subvol mytest1
      540 B 0:00:00 [73.1KiB/s] [ ]
      root@aea3:/mnt/zencefil/test# btrfs sub show mytest1/
      /mnt/zencefil/test/mytest1
      Name: mytest1
      UUID: 3a932406-8a81-5047-9a23-9333564752c2
      Parent UUID: -
      Received UUID: -
      Creation time: 2017-07-12 11:41:22 +0300
      Subvolume ID: 2567
      Generation: 4369
      Gen at creation: 4367
      Parent ID: 5
      Top level ID: 5
      Flags: readonly
      Snapshot(s):
      root@aea3:/mnt/zencefil/test# btrfs sub show /mnt/aea3/test/mytest1/
      /mnt/aea3/test/mytest1
      Name: mytest1
      UUID: 98d59473-5a47-7742-bcf7-47262b9cada2
      Parent UUID: -
      Received UUID: 3a932406-8a81-5047-9a23-9333564752c2
      Creation time: 2017-07-12 11:44:16 +0300
      Subvolume ID: 1844
      Generation: 64738
      Gen at creation: 64737
      Parent ID: 5
      Top level ID: 5
      Flags: readonly
      Snapshot(s):


      What is the missing point here?










      share|improve this question















      As far as I know, in order to determine if a snapshot is identical with another one or not, we should check if Received UUID of destination is equal to UUID of source snapshot or not.



      But this time, this procedure can not be applied:



      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs send rootfs.20170705T1334/ | pv | btrfs receive /mnt/aea3/manual-snapshots/ 
      At subvol rootfs.20170705T1334/
      At subvol rootfs.20170705T1334
      37.8GiB 0:37:27 [17.2MiB/s] [
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show rootfs.20170705T1334/
      /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334
      Name: rootfs.20170705T1334
      UUID: e66ace1b-3efc-5d40-b3ca-af000110e89d
      Parent UUID: 85bc19f1-9d61-da43-a4be-40c717aee652
      Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
      Creation time: 2017-07-10 12:47:16 +0300
      Subvolume ID: 2561
      Generation: 4331
      Gen at creation: 4327
      Parent ID: 257
      Top level ID: 257
      Flags: readonly
      Snapshot(s):
      snapshots/rootfs/rootfs.20170710T1242
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs sub show /mnt/aea3/manual-snapshots/rootfs.20170705T1334/
      /mnt/aea3/manual-snapshots/rootfs.20170705T1334
      Name: rootfs.20170705T1334
      UUID: 53bc9463-2fe6-9a41-b17d-a0a8dc5e6086
      Parent UUID: -
      Received UUID: c6f65496-f21d-c049-b2e2-44007b269dc6
      Creation time: 2017-07-12 10:36:50 +0300
      Subvolume ID: 1832
      Generation: 64698
      Gen at creation: 64627
      Parent ID: 1831
      Top level ID: 1831
      Flags: readonly
      Snapshot(s):
      root@aea3:/mnt/zencefil/snapshots/rootfs# btrfs --version
      btrfs-progs v4.11


      However, when I create and send a test snapshot and send it on the same drives on the same machine, it works as expected:



      root@aea3:/mnt/zencefil/test# btrfs send mytest1/ | pv | btrfs receive /mnt/aea3/test/
      At subvol mytest1/
      At subvol mytest1
      540 B 0:00:00 [73.1KiB/s] [ ]
      root@aea3:/mnt/zencefil/test# btrfs sub show mytest1/
      /mnt/zencefil/test/mytest1
      Name: mytest1
      UUID: 3a932406-8a81-5047-9a23-9333564752c2
      Parent UUID: -
      Received UUID: -
      Creation time: 2017-07-12 11:41:22 +0300
      Subvolume ID: 2567
      Generation: 4369
      Gen at creation: 4367
      Parent ID: 5
      Top level ID: 5
      Flags: readonly
      Snapshot(s):
      root@aea3:/mnt/zencefil/test# btrfs sub show /mnt/aea3/test/mytest1/
      /mnt/aea3/test/mytest1
      Name: mytest1
      UUID: 98d59473-5a47-7742-bcf7-47262b9cada2
      Parent UUID: -
      Received UUID: 3a932406-8a81-5047-9a23-9333564752c2
      Creation time: 2017-07-12 11:44:16 +0300
      Subvolume ID: 1844
      Generation: 64738
      Gen at creation: 64737
      Parent ID: 5
      Top level ID: 5
      Flags: readonly
      Snapshot(s):


      What is the missing point here?







      btrfs snapshot






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 6 mins ago

























      asked Jul 12 '17 at 8:56









      ceremcem

      5341421




      5341421




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          -1
          down vote













          In the first case the snapshot /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334 has been received from an other location before. The original UUID is stored as Received UUID. When transmitting this snapshot again this Received UUID is also used for the copy.



          Therefore in order to determine if a snapshot is identical with (that is copy of) another, check if Received UUID of destination is equal to Received UUID of source, if present, or UUID of source, otherwise.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f377914%2fhow-to-test-if-two-btrfs-snapshots-are-identical-or-not%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            -1
            down vote













            In the first case the snapshot /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334 has been received from an other location before. The original UUID is stored as Received UUID. When transmitting this snapshot again this Received UUID is also used for the copy.



            Therefore in order to determine if a snapshot is identical with (that is copy of) another, check if Received UUID of destination is equal to Received UUID of source, if present, or UUID of source, otherwise.






            share|improve this answer


























              up vote
              -1
              down vote













              In the first case the snapshot /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334 has been received from an other location before. The original UUID is stored as Received UUID. When transmitting this snapshot again this Received UUID is also used for the copy.



              Therefore in order to determine if a snapshot is identical with (that is copy of) another, check if Received UUID of destination is equal to Received UUID of source, if present, or UUID of source, otherwise.






              share|improve this answer
























                up vote
                -1
                down vote










                up vote
                -1
                down vote









                In the first case the snapshot /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334 has been received from an other location before. The original UUID is stored as Received UUID. When transmitting this snapshot again this Received UUID is also used for the copy.



                Therefore in order to determine if a snapshot is identical with (that is copy of) another, check if Received UUID of destination is equal to Received UUID of source, if present, or UUID of source, otherwise.






                share|improve this answer














                In the first case the snapshot /mnt/zencefil/snapshots/rootfs/rootfs.20170705T1334 has been received from an other location before. The original UUID is stored as Received UUID. When transmitting this snapshot again this Received UUID is also used for the copy.



                Therefore in order to determine if a snapshot is identical with (that is copy of) another, check if Received UUID of destination is equal to Received UUID of source, if present, or UUID of source, otherwise.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Oct 20 '17 at 20:35

























                answered Oct 20 '17 at 11:47









                David

                645




                645



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f377914%2fhow-to-test-if-two-btrfs-snapshots-are-identical-or-not%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)