All of lore.kernel.org
 help / color / mirror / Atom feed
* Reducing size of thin spare metadata, thin metadata
@ 2014-10-06  7:28 Patrik Horník
  2014-10-06  7:39 ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Patrik Horník @ 2014-10-06  7:28 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: device-mapper development

Hi,

is it possible to (safely) reduce size of thin metadata and / or thin
spare metadata? What size of spare metadata is needed? Can it be
smaller than size of pool metadata?

Thanks.

Patrik

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  7:28 Reducing size of thin spare metadata, thin metadata Patrik Horník
@ 2014-10-06  7:39 ` Zdenek Kabelac
  2014-10-06  7:59   ` Patrik Horník
  0 siblings, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2014-10-06  7:39 UTC (permalink / raw)
  To: patrik; +Cc: device-mapper development

Dne 6.10.2014 v 09:28 Patrik Horník napsal(a):
> Hi,
>
> is it possible to (safely) reduce size of thin metadata and / or thin
> spare metadata? What size of spare metadata is needed? Can it be
> smaller than size of pool metadata?
>

You could remove pool spare volume anytime  - lvremove.
(it's only used for automated lvconvert --repair)

Repair needs free space in VG - if there is no free space - well tool can't be 
used.

You could also reduce size of thin pool metadata in case it's too big, just 
not online.


With offline thinpool with these manual steps
(will be later automated with tool as well):

--

make a temporary LV of any size.
swap this temp LV with  pool metadata

# lvconvert --thinpool  vg/mypool   --poolmetadata mytemplv

Create your volume for metadata with new reduced size
(unsure which size is your target - but some calcs based on estimated usage 
are necessary)

Activate   mytemplv  which has now real metadata from thinpool.

# thin_repair  -i /dev/vg/mytemplv   -o /dev/vg/mynewsizemeta

# thin_check  /dev/vg/mynewsizemeta


If all is green - swap new meta into your thinpool

# lvconvert --thinpool  vg/mypool   --poolmetadata mynewsizemeta


If all works great you are done :)
In all other cases you have your backup at hand :)

Yeah - you still have old metadata in mytemplv - this volume you may remove
later if all works well - otherwise you may try to swap this volume back.

Zdenek

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  7:39 ` Zdenek Kabelac
@ 2014-10-06  7:59   ` Patrik Horník
  2014-10-06  8:05     ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Patrik Horník @ 2014-10-06  7:59 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: device-mapper development

Hi,

2014-10-06 9:39 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
> Dne 6.10.2014 v 09:28 Patrik Horník napsal(a):
>
>> Hi,
>>
>> is it possible to (safely) reduce size of thin metadata and / or thin
>> spare metadata? What size of spare metadata is needed? Can it be
>> smaller than size of pool metadata?
>>
>
> You could remove pool spare volume anytime  - lvremove.
> (it's only used for automated lvconvert --repair)
>
> Repair needs free space in VG - if there is no free space - well tool can't
> be used.

when does automated lvconvert --repair kick in? Can I do it manually
if it cannot continue automatically? (I actually have space for spare
metadata so I want it there if it useful but smaller. I only need to
decrease size of my volume group by couple of 100s MB because of
moving to new device. My spare is 8 GB as is regular metadata.)

> You could also reduce size of thin pool metadata in case it's too big, just
> not online.
>
>
> With offline thinpool with these manual steps
> (will be later automated with tool as well):
>
> --
>
> make a temporary LV of any size.
> swap this temp LV with  pool metadata
>
> # lvconvert --thinpool  vg/mypool   --poolmetadata mytemplv
>

Does not lvconvert only change metadata volume not copying data to it?
So isn't there missing step to copy metadata from current metadata to
mytemplv? Why do u use mytemplv anyway and dont copy metadata directly
from current metadata to new smaller LV?

Anyway I prefer to reduce spare metadata if possible and not risk
reducing real metadata, it should be enough for me.

Thanks.

Patrik

> Create your volume for metadata with new reduced size
> (unsure which size is your target - but some calcs based on estimated usage
> are necessary)
>
> Activate   mytemplv  which has now real metadata from thinpool.
>
> # thin_repair  -i /dev/vg/mytemplv   -o /dev/vg/mynewsizemeta
>
> # thin_check  /dev/vg/mynewsizemeta
>
>
> If all is green - swap new meta into your thinpool
>
> # lvconvert --thinpool  vg/mypool   --poolmetadata mynewsizemeta
>
>
> If all works great you are done :)
> In all other cases you have your backup at hand :)
>
> Yeah - you still have old metadata in mytemplv - this volume you may remove
> later if all works well - otherwise you may try to swap this volume back.
>
> Zdenek
>

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  7:59   ` Patrik Horník
@ 2014-10-06  8:05     ` Zdenek Kabelac
  2014-10-06  8:12       ` Patrik Horník
  0 siblings, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2014-10-06  8:05 UTC (permalink / raw)
  To: patrik; +Cc: device-mapper development

Dne 6.10.2014 v 09:59 Patrik Horník napsal(a):
> Hi,
>
> 2014-10-06 9:39 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
>> Dne 6.10.2014 v 09:28 Patrik Horník napsal(a):
>>
>>> Hi,
>>>
>>> is it possible to (safely) reduce size of thin metadata and / or thin
>>> spare metadata? What size of spare metadata is needed? Can it be
>>> smaller than size of pool metadata?
>>>
>>
>> You could remove pool spare volume anytime  - lvremove.
>> (it's only used for automated lvconvert --repair)
>>
>> Repair needs free space in VG - if there is no free space - well tool can't
>> be used.
>
> when does automated lvconvert --repair kick in? Can I do it manually
> if it cannot continue automatically? (I actually have space for spare
> metadata so I want it there if it useful but smaller. I only need to
> decrease size of my volume group by couple of 100s MB because of
> moving to new device. My spare is 8 GB as is regular metadata.)

When thin-pool does not pass 'thin-check' during thin-pool activation,
you could try to use this  'lvconvert --repair' at first.

Basically it automates steps described in previous mail - except it will try 
to use bigger 'replaceable' LV.

Yet the functionality is not really any better then that - it's still missing
many validation checks between user-land lvm2 metadata and kernel-land 
thin-pool metadata.

But it's being improved.
Meanwhile any 'major' damage of thin-pool metadata do need  'hand' work repair 
- since human can do far better decision then this initial implementation.

Also note - any pool damage is still important to be reported - as
thin pool metadata should be nearly impossible to break in the first place ;)

Zdenek

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  8:05     ` Zdenek Kabelac
@ 2014-10-06  8:12       ` Patrik Horník
  2014-10-06  8:31         ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Patrik Horník @ 2014-10-06  8:12 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: device-mapper development

OK, I see. So the result is that pool is not activated when it does
not pass check and there is no spare? So is it totally safe to have no
spare?

And so is there a way to reduce size of spare / create spare of
specified (smaller) size after its removal?

2014-10-06 10:05 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
> Dne 6.10.2014 v 09:59 Patrik Horník napsal(a):
>>
>> Hi,
>>
>> 2014-10-06 9:39 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
>>>
>>> Dne 6.10.2014 v 09:28 Patrik Horník napsal(a):
>>>
>>>> Hi,
>>>>
>>>> is it possible to (safely) reduce size of thin metadata and / or thin
>>>> spare metadata? What size of spare metadata is needed? Can it be
>>>> smaller than size of pool metadata?
>>>>
>>>
>>> You could remove pool spare volume anytime  - lvremove.
>>> (it's only used for automated lvconvert --repair)
>>>
>>> Repair needs free space in VG - if there is no free space - well tool
>>> can't
>>> be used.
>>
>>
>> when does automated lvconvert --repair kick in? Can I do it manually
>> if it cannot continue automatically? (I actually have space for spare
>> metadata so I want it there if it useful but smaller. I only need to
>> decrease size of my volume group by couple of 100s MB because of
>> moving to new device. My spare is 8 GB as is regular metadata.)
>
>
> When thin-pool does not pass 'thin-check' during thin-pool activation,
> you could try to use this  'lvconvert --repair' at first.
>
> Basically it automates steps described in previous mail - except it will try
> to use bigger 'replaceable' LV.
>
> Yet the functionality is not really any better then that - it's still
> missing
> many validation checks between user-land lvm2 metadata and kernel-land
> thin-pool metadata.
>
> But it's being improved.
> Meanwhile any 'major' damage of thin-pool metadata do need  'hand' work
> repair - since human can do far better decision then this initial
> implementation.
>
> Also note - any pool damage is still important to be reported - as
> thin pool metadata should be nearly impossible to break in the first place
> ;)
>
> Zdenek
>

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  8:12       ` Patrik Horník
@ 2014-10-06  8:31         ` Zdenek Kabelac
  2014-10-06  8:48           ` Patrik Horník
  0 siblings, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2014-10-06  8:31 UTC (permalink / raw)
  To: patrik; +Cc: device-mapper development

Dne 6.10.2014 v 10:12 Patrik Horník napsal(a):
> OK, I see. So the result is that pool is not activated when it does
> not pass check and there is no spare? So is it totally safe to have no
> spare?
>
> And so is there a way to reduce size of spare / create spare of
> specified (smaller) size after its removal?
>

Idea behind spare is to have 'reserved' space for pool metadata recovery.
(it's like hidden space in filesystem)

When the pool gets broken and you don't have reserved space for repair
you need to add new free space for recovery.

And at this moment it's getting quite complex (well beyond autonomous 
'lvconvert --repair').

So as long as you know what you are doing and you could repair
metadata manually - you are fine.
(You could disable creation of spare volume in lvm.conf)

But lvm2 requires to have reserved space to proceed for --repair.
After all - the size of pool metadata should be pretty small compared with the 
rest of VG.

Zdenek

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  8:31         ` Zdenek Kabelac
@ 2014-10-06  8:48           ` Patrik Horník
  2014-10-06  8:57             ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Patrik Horník @ 2014-10-06  8:48 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: device-mapper development

Thanks Zdenku. But you did not answer some of my questions, which I
need to know to decide... So is there a way I can create smaller spare
metadata LV? In mentioned manual steps what do I need mytemplv for and
why cant I use original pool metadata as input of thin_repair?

Thanks.

2014-10-06 10:31 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
> Dne 6.10.2014 v 10:12 Patrik Horník napsal(a):
>>
>> OK, I see. So the result is that pool is not activated when it does
>> not pass check and there is no spare? So is it totally safe to have no
>> spare?
>>
>> And so is there a way to reduce size of spare / create spare of
>> specified (smaller) size after its removal?
>>
>
> Idea behind spare is to have 'reserved' space for pool metadata recovery.
> (it's like hidden space in filesystem)
>
> When the pool gets broken and you don't have reserved space for repair
> you need to add new free space for recovery.
>
> And at this moment it's getting quite complex (well beyond autonomous
> 'lvconvert --repair').
>
> So as long as you know what you are doing and you could repair
> metadata manually - you are fine.
> (You could disable creation of spare volume in lvm.conf)
>
> But lvm2 requires to have reserved space to proceed for --repair.
> After all - the size of pool metadata should be pretty small compared with
> the rest of VG.
>
> Zdenek
>

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

* Re: Reducing size of thin spare metadata, thin metadata
  2014-10-06  8:48           ` Patrik Horník
@ 2014-10-06  8:57             ` Zdenek Kabelac
       [not found]               ` <CAAOsTS=j1mUA+caJ35ChDvpQJTu2m8OHVPCEZFTJHdn9cgdhsw@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2014-10-06  8:57 UTC (permalink / raw)
  To: patrik; +Cc: device-mapper development

Dne 6.10.2014 v 10:48 Patrik Horník napsal(a):
> Thanks Zdenku. But you did not answer some of my questions, which I
> need to know to decide... So is there a way I can create smaller spare
> metadata LV? In mentioned manual steps what do I need mytemplv for and
> why cant I use original pool metadata as input of thin_repair?

Spare volume is maintained to have the size at least as the biggest
pool metadata volume in VG.

There is no point to keep smaller reserved space.

We do not allow to activate 'subvolumes' - thus you cannot activate
just 'thin pool metadata'  - that's why you need to swap _tmeta
out thin pool.

Zdenek

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

* Fwd: Reducing size of thin spare metadata, thin metadata
       [not found]               ` <CAAOsTS=j1mUA+caJ35ChDvpQJTu2m8OHVPCEZFTJHdn9cgdhsw@mail.gmail.com>
@ 2014-10-06  9:05                 ` Patrik Horník
  2014-10-07  7:17                   ` Marian Csontos
  0 siblings, 1 reply; 10+ messages in thread
From: Patrik Horník @ 2014-10-06  9:05 UTC (permalink / raw)
  To: Zdenek Kabelac; +Cc: device-mapper development

Thank you very much, now I understand.

But apparently I dont understand exact function of " lvconvert
--thinpool  vg/mypool   --poolmetadata mytemplv" So it also copies
metadata from current metadata LV to mytemplv?

Then what about "lvconvert --thinpool  vg/mypool   --poolmetadata
mynewsizemeta"? It does not do that because mynewsizemeta is smaller
than current metadata mytemplv or?


2014-10-06 10:57 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
> Dne 6.10.2014 v 10:48 Patrik Horník napsal(a):
>>
>> Thanks Zdenku. But you did not answer some of my questions, which I
>> need to know to decide... So is there a way I can create smaller spare
>> metadata LV? In mentioned manual steps what do I need mytemplv for and
>> why cant I use original pool metadata as input of thin_repair?
>
>
> Spare volume is maintained to have the size at least as the biggest
> pool metadata volume in VG.
>
> There is no point to keep smaller reserved space.
>
> We do not allow to activate 'subvolumes' - thus you cannot activate
> just 'thin pool metadata'  - that's why you need to swap _tmeta
> out thin pool.
>
> Zdenek
>

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

* Re: Fwd: Reducing size of thin spare metadata, thin metadata
  2014-10-06  9:05                 ` Fwd: " Patrik Horník
@ 2014-10-07  7:17                   ` Marian Csontos
  0 siblings, 0 replies; 10+ messages in thread
From: Marian Csontos @ 2014-10-07  7:17 UTC (permalink / raw)
  To: patrik, device-mapper development, Zdenek Kabelac

On 10/06/2014 11:05 AM, Patrik Horník wrote:
> Thank you very much, now I understand.
>
> But apparently I dont understand exact function of " lvconvert
> --thinpool  vg/mypool   --poolmetadata mytemplv" So it also copies
> metadata from current metadata LV to mytemplv?

Nope, the metadata are copied by `thin_repair` step:

# thin_repair  -i /dev/vg/mytemplv   -o /dev/vg/mynewsizemeta

The lvconvert "only" swaps LVs.

-- Martian

>
> Then what about "lvconvert --thinpool  vg/mypool   --poolmetadata
> mynewsizemeta"? It does not do that because mynewsizemeta is smaller
> than current metadata mytemplv or?
>
>
> 2014-10-06 10:57 GMT+02:00 Zdenek Kabelac <zkabelac@redhat.com>:
>> Dne 6.10.2014 v 10:48 Patrik Horník napsal(a):
>>>
>>> Thanks Zdenku. But you did not answer some of my questions, which I
>>> need to know to decide... So is there a way I can create smaller spare
>>> metadata LV? In mentioned manual steps what do I need mytemplv for and
>>> why cant I use original pool metadata as input of thin_repair?
>>
>>
>> Spare volume is maintained to have the size at least as the biggest
>> pool metadata volume in VG.
>>
>> There is no point to keep smaller reserved space.
>>
>> We do not allow to activate 'subvolumes' - thus you cannot activate
>> just 'thin pool metadata'  - that's why you need to swap _tmeta
>> out thin pool.
>>
>> Zdenek
>>
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

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

end of thread, other threads:[~2014-10-07  7:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06  7:28 Reducing size of thin spare metadata, thin metadata Patrik Horník
2014-10-06  7:39 ` Zdenek Kabelac
2014-10-06  7:59   ` Patrik Horník
2014-10-06  8:05     ` Zdenek Kabelac
2014-10-06  8:12       ` Patrik Horník
2014-10-06  8:31         ` Zdenek Kabelac
2014-10-06  8:48           ` Patrik Horník
2014-10-06  8:57             ` Zdenek Kabelac
     [not found]               ` <CAAOsTS=j1mUA+caJ35ChDvpQJTu2m8OHVPCEZFTJHdn9cgdhsw@mail.gmail.com>
2014-10-06  9:05                 ` Fwd: " Patrik Horník
2014-10-07  7:17                   ` Marian Csontos

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.