Skip to contentSkip to conversation

Unable to add new drive to LV

linux-lvm Paul Waldo 4 participants 8 messages Oct 13, 2006 – Oct 16, 2006

lore
Share & tools
lore

Paul Waldo

author
#0 lore raw

Hi all,

I'm trying to add a shiny new drive (/dev/hdd) to an existing Logical Volume to no avail. The HOWTO says I should be able to do this. Googling indicates
that others have had this problem, but tells of no recorded resolution. I
was hoping someone could point me to solution. Info below. Thanks in advance!

Paul

root@backup:~# lvextend --size +149G -t /dev/ide_disks/bacula
  Test mode: Metadata will NOT be updated.
  Incorrect metadata area header checksum
  Using stripesize of last segment 4KB
  Rounding size (147200 extents) down to stripe boundary size for segment 
(147198 extents)
  Extending logical volume bacula to 574.99 GB
  Insufficient allocatable extents suitable for parallel use for logical 
volume bacula: 147198 required
root@backup:~# lvdisplay -vm /dev/ide_disks/bacula
    Using logical volume(s) on command line
  Incorrect metadata area header checksum
  --- Logical volume ---
  LV Name                /dev/ide_disks/bacula
  VG Name                ide_disks
  LV UUID                36N6XE-wDXh-8wZ1-uoVz-MW0h-6uvP-DWUiow
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                426.00 GB
  Current LE             109056
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:2

--- Segments ---
Logical extent 0 to 109055:

    Type                striped
    Stripes             3
    Stripe size         4 KB

Stripe 0:
Physical volume /dev/hdb
Physical extents 1750 to 38101
Stripe 1:
Physical volume /dev/hdc
Physical extents 1750 to 38101
Stripe 2:
Physical volume /dev/hda2
Physical extents 1750 to 38101

root@backup:~# vgdisplay ide_disks
  Incorrect metadata area header checksum
  --- Volume group ---
  VG Name               ide_disks
  System ID
  Format                lvm2
  Metadata Areas        4
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                4
  Act PV                4
  VG Size               595.99 GB
  PE Size               4.00 MB
  Total PE              152573
  Alloc PE / Size       114306 / 446.51 GB
  Free  PE / Size       38267 / 149.48 GB
  VG UUID               nbF5of-R5sV-u8mc-IVhK-GnAL-xZyO-7AQzh9
root@backup:~# pvdisplay
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               ide_disks
  PV Size               148.86 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38109
  Free PE               7
  Allocated PE          38102
  PV UUID               E8EsjG-gvEw-vpMI-nPH5-4TSe-iY1N-kZERc2

--- Physical volume ---

  PV Name               /dev/hdb
  VG Name               ide_disks
  PV Size               149.05 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38156
  Free PE               54
  Allocated PE          38102
  PV UUID               910g9r-zVmg-ZMHR-Qe7y-rkyQ-7Jrg-iV6X4I

--- Physical volume ---

  PV Name               /dev/hdc
  VG Name               ide_disks
  PV Size               149.05 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38156
  Free PE               54
  Allocated PE          38102
  PV UUID               q4C4sK-bdLY-SfMX-1CnC-r2Yi-MaJU-29GWef

--- Physical volume ---

  PV Name               /dev/hdd1
  VG Name               ide_disks
  PV Size               149.03 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38152
  Free PE               38152
  Allocated PE          0
  PV UUID               XxOREs-3k4B-jhky-lhGD-zQx5-xhE3-HPqG0L

--- NEW Physical volume ---
PV Name /dev/hda1
VG Name

  PV Size               149.05 GB
  Allocatable           NO
  PE Size (KByte)       0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               PWBpiN-xxgY-m0Ck-A67u-a78Z-JwCx-Arh4dG
root@backup:~# fdisk -l /dev/hdd

Disk /dev/hdd: 160.0 GB, 160029999616 bytes
255 heads, 63 sectors/track, 19455 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1               1       19455   156272256   8e  Linux LVM
#1 lore raw
Quoted 7 lines · Paul Waldo

Hi all,

I'm trying to add a shiny new drive (/dev/hdd) to an existing Logical Volume to no avail. The HOWTO says I should be able to do this. Googling indicates
that others have had this problem, but tells of no recorded resolution. I
was hoping someone could point me to solution. Info below. Thanks in advance!

Hi Paul,

look's like you didn't get the LVM architecture :-(.
You can't add a drive to a LV, no matter how brand new and shiny it is and no matter how deprerate you try.

If you read the LVM-HOWTO's from the beginning, you'll see that LVM is collecting physical-volumes ( your drives or partitions on drives ) in logical volume groups ( so called VG's, your ide_disks ) which are the home of the logical volumes ( LV's, your bacula ).

So, to be able to extend your LV to use the space on your new disk, you must first add the new disk to the VG with vgextend ( setting the partition-type is not enough :-) ). If this doen't work, do a pvcreate on the new disk first and try vgextend again.

Cheers
Klaus

Quoted 126 lines

Paul

root@backup:~# lvextend --size +149G -t /dev/ide_disks/bacula
  Test mode: Metadata will NOT be updated.
  Incorrect metadata area header checksum
  Using stripesize of last segment 4KB
  Rounding size (147200 extents) down to stripe boundary size for segment 
(147198 extents)
  Extending logical volume bacula to 574.99 GB
  Insufficient allocatable extents suitable for parallel use for logical 
volume bacula: 147198 required
root@backup:~# lvdisplay -vm /dev/ide_disks/bacula
    Using logical volume(s) on command line
  Incorrect metadata area header checksum
  --- Logical volume ---
  LV Name                /dev/ide_disks/bacula
  VG Name                ide_disks
  LV UUID                36N6XE-wDXh-8wZ1-uoVz-MW0h-6uvP-DWUiow
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                426.00 GB
  Current LE             109056
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:2

--- Segments ---
Logical extent 0 to 109055:

    Type                striped
    Stripes             3
    Stripe size         4 KB

Stripe 0:
Physical volume /dev/hdb
Physical extents 1750 to 38101
Stripe 1:
Physical volume /dev/hdc
Physical extents 1750 to 38101
Stripe 2:
Physical volume /dev/hda2
Physical extents 1750 to 38101

root@backup:~# vgdisplay ide_disks
  Incorrect metadata area header checksum
  --- Volume group ---
  VG Name               ide_disks
  System ID
  Format                lvm2
  Metadata Areas        4
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               2
  Max PV                0
  Cur PV                4
  Act PV                4
  VG Size               595.99 GB
  PE Size               4.00 MB
  Total PE              152573
  Alloc PE / Size       114306 / 446.51 GB
  Free  PE / Size       38267 / 149.48 GB
  VG UUID               nbF5of-R5sV-u8mc-IVhK-GnAL-xZyO-7AQzh9
root@backup:~# pvdisplay
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               ide_disks
  PV Size               148.86 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38109
  Free PE               7
  Allocated PE          38102
  PV UUID               E8EsjG-gvEw-vpMI-nPH5-4TSe-iY1N-kZERc2

--- Physical volume ---

  PV Name               /dev/hdb
  VG Name               ide_disks
  PV Size               149.05 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38156
  Free PE               54
  Allocated PE          38102
  PV UUID               910g9r-zVmg-ZMHR-Qe7y-rkyQ-7Jrg-iV6X4I

--- Physical volume ---

  PV Name               /dev/hdc
  VG Name               ide_disks
  PV Size               149.05 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38156
  Free PE               54
  Allocated PE          38102
  PV UUID               q4C4sK-bdLY-SfMX-1CnC-r2Yi-MaJU-29GWef

--- Physical volume ---

  PV Name               /dev/hdd1
  VG Name               ide_disks
  PV Size               149.03 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38152
  Free PE               38152
  Allocated PE          0
  PV UUID               XxOREs-3k4B-jhky-lhGD-zQx5-xhE3-HPqG0L

--- NEW Physical volume ---
PV Name /dev/hda1
VG Name

  PV Size               149.05 GB
  Allocatable           NO
  PE Size (KByte)       0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               PWBpiN-xxgY-m0Ck-A67u-a78Z-JwCx-Arh4dG
Signature · 8 lines
Mit freundlichen Gr�ssen / best regards

Klaus Strebel, Dipl.-Inform. (FH), mailto:[email protected]

/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Klaus Strebel

Hi Paul,

look's like you didn't get the LVM architecture :-(.
You can't add a drive to a LV, no matter how brand new and shiny it is and no matter how deprerate you try.

Hi Klaus,

Looks like you didn't read the mail :-(.

Paul has already added hdd1 as a PV to the ide_disks VG:

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

--- Physical volume ---

  PV Name               /dev/hdd1
  VG Name               ide_disks <------------------
  PV Size               149.03 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38152
  Free PE               38152
  Allocated PE          0
  PV UUID               XxOREs-3k4B-jhky-lhGD-zQx5-xhE3-HPqG0L

The problem here is that the LV is using striped allocation across 3 PVs:

Quoted 9 lines
root@backup:~# lvextend --size +149G -t /dev/ide_disks/bacula
  Test mode: Metadata will NOT be updated.
  Incorrect metadata area header checksum
  Using stripesize of last segment 4KB
  Rounding size (147200 extents) down to stripe boundary size for segment 
(147198 extents)
  Extending logical volume bacula to 574.99 GB
  Insufficient allocatable extents suitable for parallel use for logical 
volume bacula: 147198 required

So, in order to extend it and maintain that allocation, you need to have 3 PVs with sufficient space to allocate three parallel stripes.

Cheers,

Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFL7yq6YSQoMYUY94RAlJ/AKDZaaaz+P6zQozq0mDfx5SRBxiUsQCgsVVb MCl5XVqXGsEH+ZrYFHEAdps=
=mQWJ
-----END PGP SIGNATURE-----

author
#3 lore raw

Bryn M. Reeves wrote:
[snip]

Quoted 2 lines

The problem here is that the LV is using striped allocation across 3 PVs:

[snip]

Quoted 7 lines

So, in order to extend it and maintain that allocation, you need to have 3 PVs with sufficient space to allocate three parallel stripes.

Cheers,

Bryn.

Thanks for the reply, Bryn.

OK, I'm confused.

The LVM Howto says "In LVM 2, striped LVs can be extended by concatenating another set of devices onto the end of the first set. So you can get into a situation where your LV is a 2 stripe set concatenated with a linear set concatenated with a 4 stripe set. Are you confused yet?"

I interpret the above to mean that I can concatenate the single drive after the existing stripped array. Is that an incorrect interpretation?

Being as this LV stores backups, I don't really care too much that it is stripped--my goal is to have lots of disk space. Is my only option trashing the existing LV and making it contiguous (non-stripped)? Thanks!

Paul

#4 lore raw
Quoted 2 lines · Paul Waldo

I interpret the above to mean that I can concatenate the single drive after the existing stripped array.

Add -i1 to extend in a single stripe. (man lvextend)

Alasdair

Signature · 1 line
[email protected]
author
#5 lore raw
Quoted 6 lines · Alasdair G Kergon
Quoted 1 line · Paul Waldo

I interpret the above to mean that I can concatenate the single drive after the existing stripped array.

Add -i1 to extend in a single stripe. (man lvextend)

Alasdair

That did the trick. Thanks!

#6 lore raw
In reply to Bryn M. Reeves
Quoted 7 lines · Bryn M. Reeves
Quoted 5 lines · Klaus Strebel

Hi Paul,

look's like you didn't get the LVM architecture :-(.
You can't add a drive to a LV, no matter how brand new and shiny it is and no matter how desperate you try.

Quoted 16 lines

Hi Klaus,

Looks like you didn't read the mail :-(.

Paul has already added hdd1 as a PV to the ide_disks VG:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

--- Physical volume ---

  PV Name               /dev/hdd1
  VG Name               ide_disks <------------------
  PV Size               149.03 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38152
  Free PE               38152
  Allocated PE          0
  PV UUID               XxOREs-3k4B-jhky-lhGD-zQx5-xhE3-HPqG0L

Hi all ( esp. Paul ),

mea culpa, i really missed that bit :-(.

Cheers
Klaus

Signature · 8 lines
Mit freundlichen Gr�ssen / best regards

Klaus Strebel, Dipl.-Inform. (FH), mailto:[email protected]

/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
author
#7 lore raw
Quoted 22 lines · Klaus Strebel
Quoted 5 lines · Bryn M. Reeves
Quoted 4 lines · Klaus Strebel

Hi Paul,
look's like you didn't get the LVM architecture :-(.
You can't add a drive to a LV, no matter how brand new and shiny it is and no matter how desperate you try.

Quoted 16 lines

Hi Klaus,

Looks like you didn't read the mail :-(.

Paul has already added hdd1 as a PV to the ide_disks VG:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

--- Physical volume ---

  PV Name               /dev/hdd1
  VG Name               ide_disks <------------------
  PV Size               149.03 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              38152
  Free PE               38152
  Allocated PE          0
  PV UUID               XxOREs-3k4B-jhky-lhGD-zQx5-xhE3-HPqG0L
Quoted 6 lines

Hi all ( esp. Paul ),

mea culpa, i really missed that bit :-(.

Cheers
Klaus

Not a problem, Klaus! Everybody helps, and that's the point!

Paul