[CentOS] Freeing pv space for snapshots (Subject change from LVM2 stuff)

Wed Dec 27 03:48:26 UTC 2006
Paul <unix at bikesn4x4s.com>

On Thu, December 21, 2006 2:50 pm, Paul wrote:
> On Thu, December 21, 2006 1:00 pm, Aleksandar Milivojevic wrote:> Logical
> volume name should be specified as /dev/VolGroup00/LogVol00.
>>
>> Also, you might prefer to use pvdisplay, vgdisplay and lvdisplay.  For
>> example, it will print sizes in physical extents too (in case you want
>> to use -l instead of -L option).
>
> Thank you, Aleksander!  All well.  Thanks for you explanations, presented
> very easy to understand.
>
> Only downtime, was to reboot once after fdisk.
>
> # df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/mapper/VolGroup00-LogVol00
>                        36G  5.7G   29G  17% /
> /dev/hda1              99M   22M   73M  24% /boot
> none                  506M     0  506M   0% /dev/shm
>
> My commands were:
>
> 1. fdisk /dev/hda
> 2. init 6
> 3. pvresize
> 4. lvresize
> 5. ext2online

Now that this was successful, I am now wishing I left some space for doing
snapshots.  Is there a way to free up some space so I can get some free
PE?

Right now I have this:
# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               38.22 GB
  PE Size               32.00 MB
  Total PE              1223
  Alloc PE / Size       1223 / 38.22 GB
  Free  PE / Size       0 / 0
  VG UUID               0mB18U-4VRo-1GMC-oKdf-ZndA-slFy-eOQtYD

So, it won't let me do this:
# lvcreate -L1G -s -n fullbakup /dev/VolGroup00/LogVol00
  Insufficient free extents (0) in volume group VolGroup00: 32 required

Ext2online will not reduce size, so the man page says and I also tried it
for the fun of it.

lvresize won't work either.