<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Resize LVM2 partition under VMware</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
I have installed a CentOS5 with default partitioning using LVM2 into a VMware (Using VMware Free Server under Linux Fedora Core 7 as host). I now need to extend my VMware disk and partition from 20G to 30G.<BR>
<BR>
What I did previously:<BR>
- I successfully extend the VMware disk (.vmdk using the VMware dedicated command: vmware-vdiskmanager).<BR>
- Then I have booted my VMware with a Knoppix to run fdisk and extend the partition /dev/sda2 from 20G to 30G.<BR>
- I have rebooted on my VMware disk and now try to extend the partition inside CentOS 5...<BR>
<BR>
I first check the size of the disk:<BR>
<BR>
[root@devcentos5 ~]# fdisk /dev/sda<BR>
<BR>
The number of cylinders for this disk is set to 3916.<BR>
There is nothing wrong with that, but this is larger than 1024,<BR>
and could in certain setups cause problems with:<BR>
1) software that runs at boot time (e.g., old versions of LILO)<BR>
2) booting and partitioning software from other OSs<BR>
   (e.g., DOS FDISK, OS/2 FDISK)<BR>
<BR>
Command (m for help): p<BR>
<BR>
Disk /dev/sda: 32.2 GB, 32212254720 bytes<BR>
255 heads, 63 sectors/track, 3916 cylinders<BR>
Units = cylinders of 16065 * 512 = 8225280 bytes<BR>
<BR>
   Device Boot      Start         End      Blocks   Id  System<BR>
/dev/sda1   *           1          13      104391   83  Linux<BR>
/dev/sda2              14        3916    31350847+  83  Linux<BR>
<BR>
OK. /dev/sda2 is extended to 3916 which corresponds to 30G (the size I set using fdisk on Knoppix).<BR>
<BR>
The LVM2 config:<BR>
<BR>
[root@devcentos5 ~]# lvscan<BR>
  ACTIVE            '/dev/VolGroup00/LogVol00' [17.94 GB] inherit<BR>
  ACTIVE            '/dev/VolGroup00/LogVol01' [1.94 GB] inherit<BR>
<BR>
My main partition is /dev/VolGroup00/LogVol00, the original size corresponds to 20G (17.94 GB once formatted). It uses /dev/sda2 as physical volume.<BR>
<BR>
[root@devcentos5 ~]# lvdisplay<BR>
  --- Logical volume ---<BR>
  LV Name                /dev/VolGroup00/LogVol00<BR>
  VG Name                VolGroup00<BR>
  LV UUID                m2HK0N-BIYP-F1QR-dLtO-BQ76-421H-2p5aXN<BR>
  LV Write Access        read/write<BR>
  LV Status              available<BR>
  # open                 1<BR>
  LV Size                17.94 GB<BR>
  Current LE             574<BR>
  Segments               1<BR>
  Allocation             inherit<BR>
  Read ahead sectors     0<BR>
  Block device           253:0<BR>
  <BR>
  --- Logical volume ---<BR>
  LV Name                /dev/VolGroup00/LogVol01<BR>
  VG Name                VolGroup00<BR>
  LV UUID                vWw6Dm-7b4V-3SLL-6Uaq-WCc0-R91u-Eu1ABP<BR>
  LV Write Access        read/write<BR>
  LV Status              available<BR>
  # open                 1<BR>
  LV Size                1.94 GB<BR>
  Current LE             62<BR>
  Segments               1<BR>
  Allocation             inherit<BR>
  Read ahead sectors     0<BR>
  Block device           253:1<BR>
<BR>
Now I try to extend my volume using lvextend command:<BR>
<BR>
[root@devcentos5 ~]# lvextend -L+10G /dev/VolGroup00/LogVol00<BR>
  Extending logical volume LogVol00 to 27.94 GB<BR>
  Insufficient free space: 320 extents needed, but only 0 available<BR>
<BR>
I tried system-config-lvm utility, but there is no unallocated space to use.<BR>
<BR>
How can I get the additional 10G that I added to the /dev/sda2 partition?<BR>
<BR>
Any idea?<BR>
<BR>
Best,<BR>
<BR>
Chris<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>