Skip to contentSkip to conversation

--alloc seems to be ignored by lvextend

DISCUSSION ben 2 participants 4 messages Jul 7, 2011 – Jul 8, 2011

lore
Share & tools
lore

ben

author
#0 lore raw

When extending volumes with lvextend the allocation policy option --alloc seems to be ignored. The policy remains unchanged.

LVM version: 2.02.86(2)-cvs (2011-04-29)
Library version: 1.02.65-cvs (2011-04-29)
Driver version: 4.20.0

Thank you.

#1 lore raw
Quoted 5 lines · ben

When extending volumes with lvextend the allocation policy option --alloc seems to be ignored. The policy remains unchanged.
LVM version: 2.02.86(2)-cvs (2011-04-29)
Library version: 1.02.65-cvs (2011-04-29)
Driver version: 4.20.0

Specific example?

Alasdair

author
#2 lore raw
Quoted 4 lines · Alasdair G Kergon
Quoted 3 lines · ben

When extending volumes with lvextend the allocation policy option --alloc seems to be ignored. The policy remains unchanged.

Quoted 8 lines
Quoted 3 lines

LVM version: 2.02.86(2)-cvs (2011-04-29)
Library version: 1.02.65-cvs (2011-04-29)
Driver version: 4.20.0

Specific example?

Alasdair

An example:

bedroom:~/stuff# lvcreate --alloc normal --size 1g --name test newvg
  Logical volume "test" created
bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg -wn-a- 1.00g                                      
bedroom:~/stuff# lvextend --alloc anywhere --size +1g  newvg/test
  Extending logical volume test to 2.00 GiB
  Logical volume test successfully resized

It is still "normal" here:

bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg -wn-a- 2.00g                                      
bedroom:~/stuff# lvchange --alloc anywhere   newvg/test
  Logical volume "test" changed

Now it is "anywhere":

bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg -wa-a- 2.00g                                      

Adding a mirror leg has the same issue:

bedroom:~/stuff# lvcreate --alloc normal --size 1g --name test newvg
  Logical volume "test" created
bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg -wn-a- 1.00g                                      
bedroom:~/stuff# lvconvert --alloc anywhere --corelog --mirrors 1 newvg/test
  newvg/test: Converted: 0.0%
  newvg/test: Converted: 59.2%
  newvg/test: Converted: 67.2%
  newvg/test: Converted: 74.9%
  newvg/test: Converted: 82.7%
  newvg/test: Converted: 90.6%
  newvg/test: Converted: 98.2%
  newvg/test: Converted: 100.0%
bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg mwn-a- 1.00g                        100.00        
bedroom:~/stuff# lvchange --alloc anywhere   newvg/test
  Logical volume "test" changed
bedroom:~/stuff# lvs newvg
  LV   VG    Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test newvg mwa-a- 1.00g                        100.00        
#3 lore raw
Quoted 3 lines · ben
bedroom:~/stuff# lvextend --alloc anywhere --size +1g  newvg/test
It is still "normal" here:
  test newvg -wn-a- 2.00g                                      

That's correct:
lvchange changes the default value for that LV permanently.
- That is what lvs displays.
With lvextend, you are just overriding that default for the single command.

Alasdair