1

I need some free space on a VM, so I added 50GB using ESXi.
Now I have to make a partition use this new free space.
The problem is that the VM already has 4 primary partitions, so I can't make a new one.
Then I should extend one.
The partition I want to resize is in a VolGroup00 / LogVol00.
It is initially 70Gb, and I want to make it 120Gb...

What I tried / errors occuring (based on those article among others : source1 and source2) :

  • fdisk /dev/sda
  • p

output :

Disk /dev/sda: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cd2dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3750    30113792   83  Linux
/dev/sda2            3750        3917     1340417    5  Extended
/dev/sda3            3917        9137    41936696+  83  Linux
/dev/sda4            9138       13054    31463302+  83  Linux
/dev/sda5            3750        3917     1340416   82  Linux swap / Solaris
  • d
  • 4 (deleted partition sda4)
  • n (let's make a new partition sda4)
  • p
  • enter twice (using blocks 9138-19581 => more space is available than the original one)
    /dev/sda4 9138 19581 83891430 83 Linux

  • t (to change type of partition to Linux lvm ?)

  • 4 (for sda4)
  • 8e (lvm)
  • (I tried with and without the 3 lines above, nothing changes...)
  • w (write changes)

output :

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
  • CTRL C (to exit fdisk)
  • shutdown -r now (restart as asked...)
  • pvcreate /dev/sda4
    Can't initialize physical volume "/dev/sda4" of volume group "VolGroup00" without -ff
  • pvcreate /dev/sda4 -ff
    Can't open /dev/sda4 exclusively. Mounted filesystem?
  • umount /dev/sda4
    umount: /dev/sda4: not mounted
  • pvremove /dev/sda4 -ff WARNING: Wiping physical volume label from /dev/sda4 of volume group "VolGroup00" Can't open /dev/sda4 exclusively - not removing. Mounted filesystem?
  • vgextend VolGroup00 /dev/sda4
    Physical volume '/dev/sda4' is already in volume group 'VolGroup00' Unable to add physical volume '/dev/sda4' to volume group 'VolGroup00'.
  • vgdisplay

output:

  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               70,00 GiB
  PE Size               4,00 MiB
  Total PE              17919
  Alloc PE / Size       17919 / 70,00 GiB
  Free  PE / Size       0 / 0
  VG UUID               DilwAt-lYkm-lwIU-ngE4-1slV-gZR9-G4jStd

We see here there is no free space for the Volume Group... so dead end...

I tried to stop processes like mysql / apache / tomcat (which may use this partition, which contains the DB...) but nothing changes...

1

1 Answer 1

0

A workmate finally saved me by suggesting to make a new drive, instead on enlarging the actual one.
So the VM now has 2 hard drives, and it is easy to make a new partition on it, and include it to VolGroup00/LogVol00, following steps detailed in the question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .