[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] pvresize not working?



I'm trying to shrink a PV and it just does not seem to want to work.

My disk has to partitions, hda1 and hda2.  hda1 is a regular primary
partition and so is hda2.  hda1 has an ext3 filesystem and hda2 is an
LVM PV.

After booting from a livecd, I used pvdisplay /dev/hda2 to observe that
it was 4886 extents long and each extent is 4M.  Through trial and error
I discovered I could reduce it to 4761 extents.  So I went ahead and did
that.

I then shrank the partition (through a delete and add operation for
partition #2) by 10 cylinders where each cylinder is 8225280 bytes long.
I observed through /proc/partitions before and after the fdisk operation
that the partition table change was effective to the kernel.

Considering I reduced the PV by 524,288,000 bytes, reducing the
partition by 82,252,800 should be quite safe.  Or so I thought.

After reducing the partition and observing the reduction
through /proc/partitions, a vgscan was giving me errors:

lseek: 20497235968 failed: Invalid ... (EINVAL)

Now for the life of me I cannot figure out why vgscan would be trying to
seek to 20,497,235,968 considering that is beyond the end of even 4886
4M extents (20,493,369,344).  But even still, why would it be trying to
seek what is obviously beyond the end of the partition considering I
told it that the PV is now smaller?

Any thoughts?

b.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]