All of lore.kernel.org
 help / color / mirror / Atom feed
* How to change/fix 'Received UUID'
@ 2018-03-05 16:16 Marc MERLIN
  2018-03-05 19:38 ` Andrei Borzenkov
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-05 16:16 UTC (permalink / raw)
  To: linux-btrfs, fdmanana

Howdy,

I did a bunch of copies and moving around subvolumes between disks and
at some point, I did a snapshot dir1/Win_ro.20180205_21:18:31 dir2/Win_ro.20180205_21:18:31

As a result, I lost the ro flag, and apparently 'Received UUID' which is
now preventing me from restarting the btrfs send/receive.

I changed the snapshot back to 'ro' but that's not enough:

Source:
        Name:                   Win_ro.20180205_21:18:31
        UUID:                   23ccf2bd-f494-e348-b34e-1f28486b2540
        Parent UUID:            -
        Received UUID:          3cc327e1-358f-284e-92e2-4e4fde92b16f
        Creation time:          2018-02-15 20:14:42 -0800
        Subvolume ID:           964
        Generation:             4062
        Gen at creation:        459
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly

Dest:
        Name:                   Win_ro.20180205_21:18:31
        UUID:                   a1e8777c-c52b-af4e-9ce2-45ca4d4d2df8
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2018-02-17 22:20:25 -0800
        Subvolume ID:           94826
        Generation:             250714
        Gen at creation:        250540
        Parent ID:              89160
        Top level ID:           89160
        Flags:                  readonly

If I absolutely know that the data is the same on both sides, how do I
either
1) force back in a 'Received UUID' value on the destination
2) force a btrfs receive to work despite the lack of matching 'Received
UUID' 

Yes, I could discard and start over, but my 2nd such subvolume is 8TB,
so I'd really rather not :)

Any ideas?

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-05 16:16 How to change/fix 'Received UUID' Marc MERLIN
@ 2018-03-05 19:38 ` Andrei Borzenkov
  2018-03-05 19:47   ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Andrei Borzenkov @ 2018-03-05 19:38 UTC (permalink / raw)
  To: Marc MERLIN, linux-btrfs, fdmanana

05.03.2018 19:16, Marc MERLIN пишет:
> Howdy,
> 
> I did a bunch of copies and moving around subvolumes between disks and
> at some point, I did a snapshot dir1/Win_ro.20180205_21:18:31 dir2/Win_ro.20180205_21:18:31
> 
> As a result, I lost the ro flag, and apparently 'Received UUID' which is
> now preventing me from restarting the btrfs send/receive.
> 
> I changed the snapshot back to 'ro' but that's not enough:
> 
> Source:
>         Name:                   Win_ro.20180205_21:18:31
>         UUID:                   23ccf2bd-f494-e348-b34e-1f28486b2540
>         Parent UUID:            -
>         Received UUID:          3cc327e1-358f-284e-92e2-4e4fde92b16f
>         Creation time:          2018-02-15 20:14:42 -0800
>         Subvolume ID:           964
>         Generation:             4062
>         Gen at creation:        459
>         Parent ID:              5
>         Top level ID:           5
>         Flags:                  readonly
> 
> Dest:
>         Name:                   Win_ro.20180205_21:18:31
>         UUID:                   a1e8777c-c52b-af4e-9ce2-45ca4d4d2df8
>         Parent UUID:            -
>         Received UUID:          -
>         Creation time:          2018-02-17 22:20:25 -0800
>         Subvolume ID:           94826
>         Generation:             250714
>         Gen at creation:        250540
>         Parent ID:              89160
>         Top level ID:           89160
>         Flags:                  readonly
> 
> If I absolutely know that the data is the same on both sides, how do I
> either
> 1) force back in a 'Received UUID' value on the destination

I suppose the most simple is to write small program that does it using
BTRFS_IOC_SET_RECEIVED_SUBVOL.

> 2) force a btrfs receive to work despite the lack of matching 'Received
> UUID' 
> 
> Yes, I could discard and start over, but my 2nd such subvolume is 8TB,
> so I'd really rather not :)
> 
> Any ideas?
> 
> Thanks,
> Marc
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-05 19:38 ` Andrei Borzenkov
@ 2018-03-05 19:47   ` Marc MERLIN
  2018-03-06 19:12     ` Hans van Kranenburg
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-05 19:47 UTC (permalink / raw)
  To: Andrei Borzenkov, David Sterba; +Cc: linux-btrfs, fdmanana

On Mon, Mar 05, 2018 at 10:38:16PM +0300, Andrei Borzenkov wrote:
> > If I absolutely know that the data is the same on both sides, how do I
> > either
> > 1) force back in a 'Received UUID' value on the destination
> 
> I suppose the most simple is to write small program that does it using
> BTRFS_IOC_SET_RECEIVED_SUBVOL.

Understdood.
Given that I have not worked with the code at all, what is the best 
tool in btrfs progs, to add this to?

btrfstune?
btrfs propery set?
other?

David, is this something you'd be willing to add support for?
(to be honest, it'll be quicker for someone who knows the code to add than
for me, but if no one has the time, I'l see if I can have a shot at it)

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-05 19:47   ` Marc MERLIN
@ 2018-03-06 19:12     ` Hans van Kranenburg
  2018-03-06 20:02       ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Hans van Kranenburg @ 2018-03-06 19:12 UTC (permalink / raw)
  To: Marc MERLIN, Andrei Borzenkov, David Sterba; +Cc: linux-btrfs, fdmanana

On 05/03/2018 20:47, Marc MERLIN wrote:
> On Mon, Mar 05, 2018 at 10:38:16PM +0300, Andrei Borzenkov wrote:
>>> If I absolutely know that the data is the same on both sides, how do I
>>> either
>>> 1) force back in a 'Received UUID' value on the destination
>>
>> I suppose the most simple is to write small program that does it using
>> BTRFS_IOC_SET_RECEIVED_SUBVOL.
> 
> Understdood.
> Given that I have not worked with the code at all, what is the best 
> tool in btrfs progs, to add this to?
> 
> btrfstune?
> btrfs propery set?
> other?
> 
> David, is this something you'd be willing to add support for?
> (to be honest, it'll be quicker for someone who knows the code to add than
> for me, but if no one has the time, I'l see if I can have a shot at it)

If you want something right now that works, so you can continue doing
your backups, python-btrfs also has the ioctl, since v9, together with
an example of using it:

https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d

P.S. even when coding it in C, the documentation in that commit message
might be useful. :)

fwiw,
Hans

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-06 19:12     ` Hans van Kranenburg
@ 2018-03-06 20:02       ` Marc MERLIN
  2018-03-08  6:06         ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-06 20:02 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: Andrei Borzenkov, David Sterba, linux-btrfs, fdmanana

On Tue, Mar 06, 2018 at 08:12:15PM +0100, Hans van Kranenburg wrote:
> On 05/03/2018 20:47, Marc MERLIN wrote:
> > On Mon, Mar 05, 2018 at 10:38:16PM +0300, Andrei Borzenkov wrote:
> >>> If I absolutely know that the data is the same on both sides, how do I
> >>> either
> >>> 1) force back in a 'Received UUID' value on the destination
> >>
> >> I suppose the most simple is to write small program that does it using
> >> BTRFS_IOC_SET_RECEIVED_SUBVOL.
> > 
> > Understdood.
> > Given that I have not worked with the code at all, what is the best 
> > tool in btrfs progs, to add this to?
> > 
> > btrfstune?
> > btrfs propery set?
> > other?
> > 
> > David, is this something you'd be willing to add support for?
> > (to be honest, it'll be quicker for someone who knows the code to add than
> > for me, but if no one has the time, I'l see if I can have a shot at it)
> 
> If you want something right now that works, so you can continue doing
> your backups, python-btrfs also has the ioctl, since v9, together with
> an example of using it:
> 
> https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d

Well, I had never heard about it until now, thank you.

I'll see if I can make it work when I get a bit of time.

Dear btrfs-progs folks, this would be great to add to the canonical
btrfs-progs too :)

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-06 20:02       ` Marc MERLIN
@ 2018-03-08  6:06         ` Marc MERLIN
  2018-03-08  6:34           ` Andrei Borzenkov
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-08  6:06 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: Andrei Borzenkov, David Sterba, linux-btrfs, fdmanana

On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote:
> > https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d
> 
> Well, I had never heard about it until now, thank you.
> 
> I'll see if I can make it work when I get a bit of time.

Sorry, I missed the fact that there was no code to write at all.
gargamel:/var/local/src/python-btrfs/examples# ./set_received_uuid.py 2afc7a5e-107f-d54b-8929-197b80b70828 31337 1234.5678 /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
Current subvolume information:
  subvol_id: 94887
  received_uuid: 00000000-0000-0000-0000-000000000000
  stime: 0.0 (1970-01-01T00:00:00)
  stransid: 0  
  rtime: 0.0 (1970-01-01T00:00:00)
  rtransid: 0  

Setting received subvolume...

Resulting subvolume information:
  subvol_id: 94887
  received_uuid: 2afc7a5e-107f-d54b-8929-197b80b70828
  stime: 1234.5678 (1970-01-01T00:20:34.567800)
  stransid: 31337
  rtime: 1520488877.415709329 (2018-03-08T06:01:17.415709)
  rtransid: 255755

gargamel:/var/local/src/python-btrfs/examples# btrfs property set -ts /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41 ro true


ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180205_21:05:15 Video_ro.20180307_22:03:03 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
At subvol Video_ro.20180307_22:03:03
At snapshot Video_ro.20180307_22:03:03
ERROR: cannot find parent subvolume

gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_pool1/Video_ro.20180220_21\:03\:41/
Video_ro.20180220_21:03:41
        Name:                   Video_ro.20180220_21:03:41
        UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828
        Parent UUID:            e5ec5c1e-6b49-084e-8820-5a8cfaa1b089
        Received UUID:          0e220a4f-6426-4745-8399-0da0084f8b23
        Creation time:          2018-02-20 21:03:42 -0800
        Subvolume ID:           11228
        Generation:             4174
        Gen at creation:        4150
        Parent ID:              5
        Top level ID:           5
        Flags:                  readonly
        Snapshot(s):
                                Video_rw.20180220_21:03:41
                                Video


Wasn't I supposed to set 2afc7a5e-107f-d54b-8929-197b80b70828 onto the destination?

Doesn't that look ok now? Is there something else I'm missing?
gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
DS1/Video_ro.20180220_21:03:41
        Name:                   Video_ro.20180220_21:03:41
        UUID:                   cb4f343c-5e79-7f49-adf0-7ce0b29f23b3
        Parent UUID:            0e220a4f-6426-4745-8399-0da0084f8b23
        Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828
        Creation time:          2018-02-20 21:13:36 -0800
        Subvolume ID:           94887
        Generation:             250689
        Gen at creation:        250689
        Parent ID:              89160
        Top level ID:           89160
        Flags:                  readonly
        Snapshot(s):

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-08  6:06         ` Marc MERLIN
@ 2018-03-08  6:34           ` Andrei Borzenkov
  2018-03-08 16:02             ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Andrei Borzenkov @ 2018-03-08  6:34 UTC (permalink / raw)
  To: Marc MERLIN, Hans van Kranenburg; +Cc: David Sterba, linux-btrfs, fdmanana

08.03.2018 09:06, Marc MERLIN пишет:
> On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote:
>>> https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d
>>
>> Well, I had never heard about it until now, thank you.
>>
>> I'll see if I can make it work when I get a bit of time.
> 
> Sorry, I missed the fact that there was no code to write at all.
> gargamel:/var/local/src/python-btrfs/examples# ./set_received_uuid.py 2afc7a5e-107f-d54b-8929-197b80b70828 31337 1234.5678 /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
> Current subvolume information:
>   subvol_id: 94887
>   received_uuid: 00000000-0000-0000-0000-000000000000
>   stime: 0.0 (1970-01-01T00:00:00)
>   stransid: 0  
>   rtime: 0.0 (1970-01-01T00:00:00)
>   rtransid: 0  
> 
> Setting received subvolume...
> 
> Resulting subvolume information:
>   subvol_id: 94887
>   received_uuid: 2afc7a5e-107f-d54b-8929-197b80b70828
>   stime: 1234.5678 (1970-01-01T00:20:34.567800)
>   stransid: 31337
>   rtime: 1520488877.415709329 (2018-03-08T06:01:17.415709)
>   rtransid: 255755
> 
> gargamel:/var/local/src/python-btrfs/examples# btrfs property set -ts /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41 ro true
> 
> 
> ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180205_21:05:15 Video_ro.20180307_22:03:03 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
> At subvol Video_ro.20180307_22:03:03
> At snapshot Video_ro.20180307_22:03:03
> ERROR: cannot find parent subvolume
> 
> gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_pool1/Video_ro.20180220_21\:03\:41/
> Video_ro.20180220_21:03:41

Not sure I understand how this subvolume is related. You send
differences between Video_ro.20180205_21:05:15 and
Video_ro.20180307_22:03:03, so you need to have (replica of)
Video_ro.20180205_21:05:15 on destination. How exactly
Video_ro.20180220_21:03:41 comes in picture here?

>         Name:                   Video_ro.20180220_21:03:41
>         UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828
>         Parent UUID:            e5ec5c1e-6b49-084e-8820-5a8cfaa1b089
>         Received UUID:          0e220a4f-6426-4745-8399-0da0084f8b23>         Creation time:          2018-02-20 21:03:42 -0800
>         Subvolume ID:           11228
>         Generation:             4174
>         Gen at creation:        4150
>         Parent ID:              5
>         Top level ID:           5
>         Flags:                  readonly
>         Snapshot(s):
>                                 Video_rw.20180220_21:03:41
>                                 Video
> 
> 
> Wasn't I supposed to set 2afc7a5e-107f-d54b-8929-197b80b70828 onto the destination?
> 
> Doesn't that look ok now? Is there something else I'm missing?
> gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
> DS1/Video_ro.20180220_21:03:41
>         Name:                   Video_ro.20180220_21:03:41
>         UUID:                   cb4f343c-5e79-7f49-adf0-7ce0b29f23b3
>         Parent UUID:            0e220a4f-6426-4745-8399-0da0084f8b23
>         Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828
>         Creation time:          2018-02-20 21:13:36 -0800
>         Subvolume ID:           94887
>         Generation:             250689
>         Gen at creation:        250689
>         Parent ID:              89160
>         Top level ID:           89160
>         Flags:                  readonly
>         Snapshot(s):
> 
> Thanks,
> Marc
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-08  6:34           ` Andrei Borzenkov
@ 2018-03-08 16:02             ` Marc MERLIN
  2018-03-08 18:36               ` Andrei Borzenkov
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-08 16:02 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: Hans van Kranenburg, David Sterba, linux-btrfs, fdmanana

On Thu, Mar 08, 2018 at 09:34:45AM +0300, Andrei Borzenkov wrote:
> 08.03.2018 09:06, Marc MERLIN пишет:
> > On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote:
> >>> https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d
> >>
> >> Well, I had never heard about it until now, thank you.
> >>
> >> I'll see if I can make it work when I get a bit of time.
> > 
> > Sorry, I missed the fact that there was no code to write at all.
> > gargamel:/var/local/src/python-btrfs/examples# ./set_received_uuid.py 2afc7a5e-107f-d54b-8929-197b80b70828 31337 1234.5678 /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
> > Current subvolume information:
> >   subvol_id: 94887
> >   received_uuid: 00000000-0000-0000-0000-000000000000
> >   stime: 0.0 (1970-01-01T00:00:00)
> >   stransid: 0  
> >   rtime: 0.0 (1970-01-01T00:00:00)
> >   rtransid: 0  
> > 
> > Setting received subvolume...
> > 
> > Resulting subvolume information:
> >   subvol_id: 94887
> >   received_uuid: 2afc7a5e-107f-d54b-8929-197b80b70828
> >   stime: 1234.5678 (1970-01-01T00:20:34.567800)
> >   stransid: 31337
> >   rtime: 1520488877.415709329 (2018-03-08T06:01:17.415709)
> >   rtransid: 255755
> > 
> > gargamel:/var/local/src/python-btrfs/examples# btrfs property set -ts /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41 ro true
> > 
> > 
> > ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180205_21:05:15 Video_ro.20180307_22:03:03 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
> > At subvol Video_ro.20180307_22:03:03
> > At snapshot Video_ro.20180307_22:03:03
> > ERROR: cannot find parent subvolume
> > 
> > gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_pool1/Video_ro.20180220_21\:03\:41/
> > Video_ro.20180220_21:03:41
> 
> Not sure I understand how this subvolume is related. You send
> differences between Video_ro.20180205_21:05:15 and
> Video_ro.20180307_22:03:03, so you need to have (replica of)
> Video_ro.20180205_21:05:15 on destination. How exactly
> Video_ro.20180220_21:03:41 comes in picture here?
 
Sorry, I pasted the wrong thing.
ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180220_21:03:41 Video_ro.20180308_07:50:06 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
At subvol Video_ro.20180308_07:50:06
At snapshot Video_ro.20180308_07:50:06
ERROR: cannot find parent subvolume

Same problem basically, just copied the wrong attempt, sorry about that.

Do I need to make sure of more than
DS1/Video_ro.20180220_21:03:41
Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828

be equal to
Name:                   Video_ro.20180220_21:03:41
UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828

Thanks,
Marc


> >         Name:                   Video_ro.20180220_21:03:41
> >         UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828
> >         Parent UUID:            e5ec5c1e-6b49-084e-8820-5a8cfaa1b089
> >         Received UUID:          0e220a4f-6426-4745-8399-0da0084f8b23>         Creation time:          2018-02-20 21:03:42 -0800
> >         Subvolume ID:           11228
> >         Generation:             4174
> >         Gen at creation:        4150
> >         Parent ID:              5
> >         Top level ID:           5
> >         Flags:                  readonly
> >         Snapshot(s):
> >                                 Video_rw.20180220_21:03:41
> >                                 Video
> > 
> > 
> > Wasn't I supposed to set 2afc7a5e-107f-d54b-8929-197b80b70828 onto the destination?
> > 
> > Doesn't that look ok now? Is there something else I'm missing?
> > gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
> > DS1/Video_ro.20180220_21:03:41
> >         Name:                   Video_ro.20180220_21:03:41
> >         UUID:                   cb4f343c-5e79-7f49-adf0-7ce0b29f23b3
> >         Parent UUID:            0e220a4f-6426-4745-8399-0da0084f8b23
> >         Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828
> >         Creation time:          2018-02-20 21:13:36 -0800
> >         Subvolume ID:           94887
> >         Generation:             250689
> >         Gen at creation:        250689
> >         Parent ID:              89160
> >         Top level ID:           89160
> >         Flags:                  readonly
> >         Snapshot(s):
> > 
> > Thanks,
> > Marc
> > 
> 
> 

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-08 16:02             ` Marc MERLIN
@ 2018-03-08 18:36               ` Andrei Borzenkov
  2018-03-08 19:26                 ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Andrei Borzenkov @ 2018-03-08 18:36 UTC (permalink / raw)
  To: Marc MERLIN; +Cc: Hans van Kranenburg, David Sterba, linux-btrfs, fdmanana

08.03.2018 19:02, Marc MERLIN пишет:
> On Thu, Mar 08, 2018 at 09:34:45AM +0300, Andrei Borzenkov wrote:
>> 08.03.2018 09:06, Marc MERLIN пишет:
>>> On Tue, Mar 06, 2018 at 12:02:47PM -0800, Marc MERLIN wrote:
>>>>> https://github.com/knorrie/python-btrfs/commit/1ace623f95300ecf581b1182780fd6432a46b24d
>>>>
>>>> Well, I had never heard about it until now, thank you.
>>>>
>>>> I'll see if I can make it work when I get a bit of time.
>>>
>>> Sorry, I missed the fact that there was no code to write at all.
>>> gargamel:/var/local/src/python-btrfs/examples# ./set_received_uuid.py 2afc7a5e-107f-d54b-8929-197b80b70828 31337 1234.5678 /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
>>> Current subvolume information:
>>>   subvol_id: 94887
>>>   received_uuid: 00000000-0000-0000-0000-000000000000
>>>   stime: 0.0 (1970-01-01T00:00:00)
>>>   stransid: 0  
>>>   rtime: 0.0 (1970-01-01T00:00:00)
>>>   rtransid: 0  
>>>
>>> Setting received subvolume...
>>>
>>> Resulting subvolume information:
>>>   subvol_id: 94887
>>>   received_uuid: 2afc7a5e-107f-d54b-8929-197b80b70828
>>>   stime: 1234.5678 (1970-01-01T00:20:34.567800)
>>>   stransid: 31337
>>>   rtime: 1520488877.415709329 (2018-03-08T06:01:17.415709)
>>>   rtransid: 255755
>>>
>>> gargamel:/var/local/src/python-btrfs/examples# btrfs property set -ts /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41 ro true
>>>
>>>
>>> ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180205_21:05:15 Video_ro.20180307_22:03:03 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
>>> At subvol Video_ro.20180307_22:03:03
>>> At snapshot Video_ro.20180307_22:03:03
>>> ERROR: cannot find parent subvolume
>>>
>>> gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_pool1/Video_ro.20180220_21\:03\:41/
>>> Video_ro.20180220_21:03:41
>>
>> Not sure I understand how this subvolume is related. You send
>> differences between Video_ro.20180205_21:05:15 and
>> Video_ro.20180307_22:03:03, so you need to have (replica of)
>> Video_ro.20180205_21:05:15 on destination. How exactly
>> Video_ro.20180220_21:03:41 comes in picture here?
>  
> Sorry, I pasted the wrong thing.
> ABORT: btrfs send -p /mnt/btrfs_pool1/Video_ro.20180220_21:03:41 Video_ro.20180308_07:50:06 |  btrfs receive /mnt/btrfs_bigbackup/DS1//. failed
> At subvol Video_ro.20180308_07:50:06
> At snapshot Video_ro.20180308_07:50:06
> ERROR: cannot find parent subvolume
> 
> Same problem basically, just copied the wrong attempt, sorry about that.
> 
> Do I need to make sure of more than
> DS1/Video_ro.20180220_21:03:41
> Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828
> 
> be equal to
> Name:                   Video_ro.20180220_21:03:41
> UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828
> 

Yes. Your source has Received UUID. In this case btrfs send will
transmit received UUID instead of subvolume UUID as reference to base
snapshot. You need to either clear received UUID on source or set
received UUID on destination to received UUID of source (not to
subvolume UUID of source).

> Thanks,
> Marc
> 
> 
>>>         Name:                   Video_ro.20180220_21:03:41
>>>         UUID:                   2afc7a5e-107f-d54b-8929-197b80b70828
>>>         Parent UUID:            e5ec5c1e-6b49-084e-8820-5a8cfaa1b089
>>>         Received UUID:          0e220a4f-6426-4745-8399-0da0084f8b23
I mean this:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>>>         Creation time:          2018-02-20 21:03:42 -0800
>>>         Subvolume ID:           11228
>>>         Generation:             4174
>>>         Gen at creation:        4150
>>>         Parent ID:              5
>>>         Top level ID:           5
>>>         Flags:                  readonly
>>>         Snapshot(s):
>>>                                 Video_rw.20180220_21:03:41
>>>                                 Video
>>>
>>>
>>> Wasn't I supposed to set 2afc7a5e-107f-d54b-8929-197b80b70828 onto the destination?
>>>
>>> Doesn't that look ok now? Is there something else I'm missing?
>>> gargamel:/mnt/btrfs_pool1# btrfs subvolume show /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41
>>> DS1/Video_ro.20180220_21:03:41
>>>         Name:                   Video_ro.20180220_21:03:41
>>>         UUID:                   cb4f343c-5e79-7f49-adf0-7ce0b29f23b3
>>>         Parent UUID:            0e220a4f-6426-4745-8399-0da0084f8b23
>>>         Received UUID:          2afc7a5e-107f-d54b-8929-197b80b70828
>>>         Creation time:          2018-02-20 21:13:36 -0800
>>>         Subvolume ID:           94887
>>>         Generation:             250689
>>>         Gen at creation:        250689
>>>         Parent ID:              89160
>>>         Top level ID:           89160
>>>         Flags:                  readonly
>>>         Snapshot(s):
>>>
>>> Thanks,
>>> Marc
>>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-08 18:36               ` Andrei Borzenkov
@ 2018-03-08 19:26                 ` Marc MERLIN
  2018-03-10 18:23                   ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2018-03-08 19:26 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: Hans van Kranenburg, David Sterba, linux-btrfs, fdmanana

On Thu, Mar 08, 2018 at 09:36:49PM +0300, Andrei Borzenkov wrote:
> Yes. Your source has Received UUID. In this case btrfs send will
> transmit received UUID instead of subvolume UUID as reference to base
> snapshot. You need to either clear received UUID on source or set
> received UUID on destination to received UUID of source (not to
> subvolume UUID of source).

gargamel:/var/local/src/python-btrfs/examples# ./set_received_uuid.py 0e220a4f-6426-4745-8399-0da0084f8b23 313
37 1234.5678 /mnt/btrfs_bigbackup/DS1/Video_ro.20180220_21:03:41                                              
Current subvolume information:                                                                                
  subvol_id: 94887                                                                                            
  received_uuid: 2afc7a5e-107f-d54b-8929-197b80b70828                                                         
  stime: 1234.5678 (1970-01-01T00:20:34.567800)                                                               
  stransid: 31337                                                                                             
  rtime: 1520488877.415709329 (2018-03-08T06:01:17.415709)                                                    
  rtransid: 255755                                                                                            
                                                                                                              
Setting received subvolume...                                                                                 
                                                                                                              
Resulting subvolume information:                                                                              
  subvol_id: 94887                                                                                            
  received_uuid: 0e220a4f-6426-4745-8399-0da0084f8b23                                                         
  stime: 1234.5678 (1970-01-01T00:20:34.567800)                                                               
  stransid: 31337                                                                                             
  rtime: 1520537034.890253770 (2018-03-08T19:23:54.890254)                                                    
  rtransid: 256119                                                                                            
                                                                                                              
gargamel:/var/local/src/python-btrfs/examples# btrfs property set -ts /mnt/btrfs_bigbackup/DS1/Video_ro.201802
20_21:03:41 ro true

This worked fine, thank you so much.
I now have an incremental send that is going on and will take a few dozen minutes instead
of days for 8TB+ :)

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to change/fix 'Received UUID'
  2018-03-08 19:26                 ` Marc MERLIN
@ 2018-03-10 18:23                   ` Marc MERLIN
  0 siblings, 0 replies; 11+ messages in thread
From: Marc MERLIN @ 2018-03-10 18:23 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: Hans van Kranenburg, David Sterba, linux-btrfs, fdmanana

Thanks all for the help again.
I just wrote a blog post to explain the process to others should anyone
need this later.

http://marc.merlins.org/perso/btrfs/post_2018-03-09_Btrfs-Tips_-Rescuing-A-Btrfs-Send-Receive-Relationship.html

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-03-10 18:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 16:16 How to change/fix 'Received UUID' Marc MERLIN
2018-03-05 19:38 ` Andrei Borzenkov
2018-03-05 19:47   ` Marc MERLIN
2018-03-06 19:12     ` Hans van Kranenburg
2018-03-06 20:02       ` Marc MERLIN
2018-03-08  6:06         ` Marc MERLIN
2018-03-08  6:34           ` Andrei Borzenkov
2018-03-08 16:02             ` Marc MERLIN
2018-03-08 18:36               ` Andrei Borzenkov
2018-03-08 19:26                 ` Marc MERLIN
2018-03-10 18:23                   ` Marc MERLIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.