All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] How to Fix Bad PV Allocation
@ 2009-10-14  1:45 Eddie
  2009-10-14  1:50 ` Stuart D. Gathman
  0 siblings, 1 reply; 3+ messages in thread
From: Eddie @ 2009-10-14  1:45 UTC (permalink / raw)
  To: linux-lvm

I have a PV allocated, that is larger than the actual volume it resides on.

Somehow, and I've not been able to ascertain how, when fdisk was run, on 
a new RAID array it produced the following partition size:

fdisk -l -u /dev/sda

Disk /dev/sda: 1499.9 GB, 1499999502336 bytes
255 heads, 63 sectors/track, 182364 cylinders, total 2929686528 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0003d809

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63  2930304194  1465152066   8e  Linux LVM

The complete /dev/sda1 was then allocated to a PV.

Later, at boot time, I noticed warnings about the partition allocation 
being larger than the actual disk, which led me to investigate what was 
wrong.  After correcting this, fisk now reports the correct size for the 
partition:

fdisk -l -u /dev/sda

Disk /dev/sda: 1499.9 GB, 1499999502336 bytes
255 heads, 63 sectors/track, 182364 cylinders, total 2929686528 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0003d809

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63  2929677659  1464838798+  8e  Linux LVM

However, the PV allocations are still based on the "incorrect" partition 
sizing, and hence, they are also incorrect:

pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               raid_vg
  PV Size               1.36 TB / not usable 2.97 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              357627
  Free PE               76027
  Allocated PE          281600
  PV UUID               OOBb0e-8fyt-mhfr-Oshw-mS8d-Mcay-t2ixBb

This shows a "Total PE" of 357627, which according to my maths, comes 
out to 1,464,840,102 Blocks, or 2,929,680,384 Sectors, on the device.  
This is larger that the actual disk.

How can I correct the PV allocations, so that they reflect the actual 
device, not the "incorrect" sizes, that were present when PVCREATE was 
originally run.

Cheers,
Eddie

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

* Re: [linux-lvm] How to Fix Bad PV Allocation
  2009-10-14  1:45 [linux-lvm] How to Fix Bad PV Allocation Eddie
@ 2009-10-14  1:50 ` Stuart D. Gathman
  2009-10-14  2:46   ` Eddie
  0 siblings, 1 reply; 3+ messages in thread
From: Stuart D. Gathman @ 2009-10-14  1:50 UTC (permalink / raw)
  To: stunnel, LVM general discussion and development

On Tue, 13 Oct 2009, Eddie wrote:

> How can I correct the PV allocations, so that they reflect the actual device,
> not the "incorrect" sizes, that were present when PVCREATE was originally run.

pvresize

-- 
	      Stuart D. Gathman <stuart@bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

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

* Re: [linux-lvm] How to Fix Bad PV Allocation
  2009-10-14  1:50 ` Stuart D. Gathman
@ 2009-10-14  2:46   ` Eddie
  0 siblings, 0 replies; 3+ messages in thread
From: Eddie @ 2009-10-14  2:46 UTC (permalink / raw)
  To: LVM general discussion and development

Stuart D. Gathman wrote:
> On Tue, 13 Oct 2009, Eddie wrote:
>
>   
>> How can I correct the PV allocations, so that they reflect the actual device,
>> not the "incorrect" sizes, that were present when PVCREATE was originally run.
>>     
>
> pvresize
>
>   
I didn't see that one mentioned in the HOWTO, but thanks.  That was 
easy.  :)

Cheers,
Eddie

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

end of thread, other threads:[~2009-10-14  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-14  1:45 [linux-lvm] How to Fix Bad PV Allocation Eddie
2009-10-14  1:50 ` Stuart D. Gathman
2009-10-14  2:46   ` Eddie

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.