Skip to contentSkip to conversation

Why can't I extend a LV after many times extends?

linux-lvm lepton 3 participants 5 messages Mar 2, 2004 – Mar 3, 2004

lore
Share & tools
lore

lepton

author
#0 lore raw
LVM version:     2.00.08 (2003-11-14)
Library version: 1.00.07-ioctl (2003-11-21)
Driver version:  4.0.0

I am using linux kernel 2.6.3

For making my data can balance on all of my three scsi disk, I use such methods to create my LV:
lvcreate -l 32 -n test vg /dev/sda1
lvextend -l +32 /dev/vg/test /dev/sdb1
lvextend -l +32 /dev/vg/test /dev/sdc1
lvextend -l +32 /dev/vg/test /dev/sda1
......

(I use a shell script to do these)

But When I extend a Logic Volumn to 26.5G, it saids:
....
Logical volume boards successfully resized Extending logical volume boards to 26.75 GB VG amd64 metadata writing failed
Extending logical volume boards to 26.75 GB

(lvextend using sdb1 and sdc1 will fail, but lvextend using sda1 will sucess)

It is strange I have three scsi disk which are the same.

vgdisplay
--- Volume group ---
VG Name amd64
System ID

  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  1585
  VG Access             read/write
  VG Status             resizable
  MAX LV                255
  Cur LV                8
  Open LV               0
  Max PV                255
  Cur PV                3
  Act PV                3
  VG Size               102.54 GB
  PE Size               4.00 MB
  Total PE              26250
  Alloc PE / Size       20032 / 78.25 GB
  Free  PE / Size       6218 / 24.29 GB
  VG UUID               RSR1JG-3vRE-4esH-m8dI-rY4B-WG0p-XweADh

pvdisplay /dev/sda1
--- Physical volume ---

  PV Name               /dev/sda1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               2286
  Allocated PE          6464
  PV UUID               YAKwOe-oJlA-CbzF-5IwO-ReqH-JZiw-LdhtT7

pvdisplay /dev/sdb1
--- Physical volume ---

  PV Name               /dev/sdb1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               1966
  Allocated PE          6784
  PV UUID               FkVeuL-7JAW-UurK-GFcZ-e642-inMT-5MYYMq

pvdisplay /dev/sdc1
--- Physical volume ---

  PV Name               /dev/sdc1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               1966
  Allocated PE          6784
  PV UUID               sRSor7-r4KP-1PNr-nESn-sZPS-aKMx-7s3CU
#1 lore raw

Package: lvm2
Version: 2.00.08-4

Ok , now I found the problem.

There is a limit in code of lvm2 tools.
Author has seen it as a problem... but no one has fixed it yet.

In lib/format_text/format-text.c ...

around line 309

  /* FIXME Essential fix! Make dynamic (realloc? pool?) */
  char buf[65536];
  int found = 0;

The buf size of 65536 is too small for me...

I change it to 655360 then everyting is ok.

The following is my quick patch, it can make things a little better.

diff -urN lvm2-2.00.08/lib/format_text/format-text.c lvm2-2.00.08-new/lib/format_text/format-text.c --- lvm2-2.00.08/lib/format_text/format-text.c 2004-03-03 15:29:47.190121864 +0800
+++ lvm2-2.00.08-new/lib/format_text/format-text.c 2004-03-03
15:15:18.720149368 +0800
@@ -306,7 +306,7 @@

        uint32_t new_wrap = 0, old_wrap = 0;

        /* FIXME Essential fix! Make dynamic (realloc? pool?) */
-       char buf[65536];
+       char buf[655360];
        int found = 0;

        /* Ignore any mda on a PV outside the VG. vgsplit relies on this */
Quoted 86 lines · lepton
LVM version:     2.00.08 (2003-11-14)
Library version: 1.00.07-ioctl (2003-11-21)
Driver version:  4.0.0

I am using linux kernel 2.6.3

For making my data can balance on all of my three scsi disk, I use such methods to create my LV:
lvcreate -l 32 -n test vg /dev/sda1
lvextend -l +32 /dev/vg/test /dev/sdb1
lvextend -l +32 /dev/vg/test /dev/sdc1
lvextend -l +32 /dev/vg/test /dev/sda1
......

(I use a shell script to do these)

But When I extend a Logic Volumn to 26.5G, it saids:
....
Logical volume boards successfully resized Extending logical volume boards to 26.75 GB VG amd64 metadata writing failed
Extending logical volume boards to 26.75 GB

(lvextend using sdb1 and sdc1 will fail, but lvextend using sda1 will sucess)

It is strange I have three scsi disk which are the same.

vgdisplay
--- Volume group ---
VG Name amd64
System ID

  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  1585
  VG Access             read/write
  VG Status             resizable
  MAX LV                255
  Cur LV                8
  Open LV               0
  Max PV                255
  Cur PV                3
  Act PV                3
  VG Size               102.54 GB
  PE Size               4.00 MB
  Total PE              26250
  Alloc PE / Size       20032 / 78.25 GB
  Free  PE / Size       6218 / 24.29 GB
  VG UUID               RSR1JG-3vRE-4esH-m8dI-rY4B-WG0p-XweADh

pvdisplay /dev/sda1
--- Physical volume ---

  PV Name               /dev/sda1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               2286
  Allocated PE          6464
  PV UUID               YAKwOe-oJlA-CbzF-5IwO-ReqH-JZiw-LdhtT7

pvdisplay /dev/sdb1
--- Physical volume ---

  PV Name               /dev/sdb1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               1966
  Allocated PE          6784
  PV UUID               FkVeuL-7JAW-UurK-GFcZ-e642-inMT-5MYYMq

pvdisplay /dev/sdc1
--- Physical volume ---

  PV Name               /dev/sdc1
  VG Name               amd64
  PV Size               34.18 GB / not usable 0   
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              8750
  Free PE               1966
  Allocated PE          6784
  PV UUID               sRSor7-r4KP-1PNr-nESn-sZPS-aKMx-7s3CU
author
#2 lore raw

Another problem after I change the buf size

1. After some lvextend operations.. when my lv size is about 48G

my vg is lost suddently...

2. I think perhaps it has some relation about the default size mempool size of "10*1024" is not big enough, I changed it to "200*1024"

(lib/config/config.c line 88)

3. Now when I lvextend, it complains :

VG amd64 metadata too large for circular buffer

(lib/format_text/format_text.c line 363)

Any advice?

Quoted 41 lines · ����

Package: lvm2
Version: 2.00.08-4

Ok , now I found the problem.

There is a limit in code of lvm2 tools.
Author has seen it as a problem... but no one has fixed it yet.

In lib/format_text/format-text.c ...

around line 309

  /* FIXME Essential fix! Make dynamic (realloc? pool?) */
  char buf[65536];
  int found = 0;

The buf size of 65536 is too small for me...

I change it to 655360 then everyting is ok.

The following is my quick patch, it can make things a little better.

diff -urN lvm2-2.00.08/lib/format_text/format-text.c lvm2-2.00.08-new/lib/format_text/format-text.c --- lvm2-2.00.08/lib/format_text/format-text.c 2004-03-03 15:29:47.190121864 +0800
+++ lvm2-2.00.08-new/lib/format_text/format-text.c 2004-03-03
15:15:18.720149368 +0800

(quoted diff) +1 -1
@@ -306,7 +306,7 @@
        uint32_t new_wrap = 0, old_wrap = 0;
 
        /* FIXME Essential fix! Make dynamic (realloc? pool?) */
-       char buf[65536];
+       char buf[655360];
        int found = 0;
 
        /* Ignore any mda on a PV outside the VG. vgsplit relies on this */

On Tue, Mar 02, 2004 at 11:34:51PM +0800, lepton wrote:

#3 lore raw
Quoted 5 lines · lepton

3. Now when I lvextend, it complains :

VG amd64 metadata too large for circular buffer

(lib/format_text/format_text.c line 363)

If you *really* want to do things this way, you'll also need to make your on-disk metadata area (which contains the "circular buffer" that message refers to) several times bigger before you start:
see pvcreate --metadatasize

Alasdair

Signature · 1 line
[email protected]
#4 lore raw
In reply to lepton
Quoted 7 lines · lepton

For making my data can balance on all of my three scsi disk, I use such methods to create my LV:
lvcreate -l 32 -n test vg /dev/sda1
lvextend -l +32 /dev/vg/test /dev/sdb1
lvextend -l +32 /dev/vg/test /dev/sdc1
lvextend -l +32 /dev/vg/test /dev/sda1
......

Why not use LVM striping directly?
(lvcreate -i 3)

Alasdair

Signature · 1 line
[email protected]