Expanding LVM drives in VMWare
When I created this most recent batch of webservers, I got a little stingy with the drive space. I skimped on the “/” partition, and as you can see, I’m paying for it now:
[root@server ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
2.5G 2.3G 80M 97% /
/dev/mapper/VolGroup00-LogVol04
29G 9.1G 19G 33% /apps
/dev/sda1 99M 13M 82M 14% /boot
none 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/VolGroup00-LogVol03
2.9G 37M 2.8G 2% /opt
/dev/mapper/VolGroup00-LogVol02
1008M 933M 25M 98% /var
Here’s how I was able to solve my problem.
1) Turn off the VM and expand the drive. (I’m adding 5 Gigs to “/” for a total of 7.5). I’m doing this thru the vmware VirtualCenter management software, but the documentation recommends the following command:
vmware-vdiskmanager -x 10GB /path/machineName.vmdk
2) After powering the VM back on, I now have to create a partition that will incorporate the new space:
[root@server ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 5874.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (5222-5874, default 5222):
Using default value 5222
Last cylinder or +size or +sizeM or +sizeK (5222-5874, default 5874):
Using default value 5874
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): w
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.
Syncing disks.
Command (m for help): p
Disk /dev/sda: 48.3 GB, 48318382080 bytes
255 heads, 63 sectors/track, 5874 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 5221 41833260 8e Linux LVM
/dev/sda3 5222 5874 5245222+ 8e Linux LVM
Command (m for help): q
I now have 3 partitions, including my most recent, partition 3 that has been formatted to use LVM. Now I must reboot my VM so that it will include this partition in the table at reboot.
3) Now I must create a physical volume so that I can access my partition with LVM.
[root@server ~]# pvcreate /dev/sda3
Physical volume “/dev/sda3″ successfully created
4) Following that, I need to extend my VolGroup into my new physical Volume:
[root@server ~]# vgextend VolGroup00 /dev/sda3
Volume group “VolGroup00″ successfully extended
5) With that complete, I need to extend the logical volume into the newly created space. I know that I planned to give myself 5 gigs, but I want to see how the system is really going to give me, so I’m going to run:
[root@server ~]# vgdisplay | grep ‘Free’
Free PE / Size 165 / 5.16 GB
So now I can be sure that I have 5 GB to work with. I can run lvextend to grow my logical volume across the new partition:
[root@server ~]# lvextend -L+5G /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 7.47 GB
Logical volume LogVol00 successfully resized
With that completed, I now have the Logical Volume sitting at 7.47 Gigs. I now need to expand the file system to take advantage of the space that was created. This step is normally taken care of with the resize2fs command, but since I’m running RHEL 4, I can take advantage of ext2online command and don’t have to take the filesystem down. I like this idea much better:
[root@server ~]# ext2online /dev/VolGroup00/LogVol00
ext2online v1.1.18 – 2001/03/18 for EXT2FS 0.5b
That’s it! Now when I run my df -h, I have all the space I was needing:
[root@oasslcwpa01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
7.4G 2.2G 4.9G 31% /
/dev/mapper/VolGroup00-LogVol04
29G 7.3G 21G 27% /apps
/dev/sda1 99M 13M 82M 14% /boot
none 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/VolGroup00-LogVol03
2.9G 192M 2.6G 7% /opt
/dev/mapper/VolGroup00-LogVol02
1008M 447M 511M 47% /var
Special thanks to swizzling.org, who’s tutorial I modified minimally for my own benefit here.
July 21st, 2010 at 10:43 pm
Buy:Prednisolone.Zovirax.Human Growth Hormone.Actos.Zyban.Lumigan.Prevacid.Synthroid.Mega Hoodia.Retin-A.Petcam (Metacam) Oral Suspension.100% Pure Okinawan Coral Calcium.Valtrex.Accutane.Arimidex.Nexium….
September 6th, 2010 at 8:19 pm
Buy:Retin-A.100% Pure Okinawan Coral Calcium.Prevacid.Zyban.Actos.Accutane.Mega Hoodia.Zovirax.Nexium.Lumigan.Petcam (Metacam) Oral Suspension.Synthroid.Human Growth Hormone.Valtrex.Prednisolone.Arimidex….
November 11th, 2010 at 4:28 am
…
BUY FASHION. TOP BRANDS: GUCCI, DOLCE&GABBANA, BURBERRY, DIESEL, ICEBERG, ROBERTO CAVALLI, EMPORIO ARMANI, VERSACE…
December 17th, 2010 at 7:05 pm
████████►BUY VIAGRA◀███████…
████████▲▲▲▲▲▲▲▲▲████████…
December 20th, 2010 at 5:17 pm
abilify side effects in children…
Buydrugs without prescription…
December 23rd, 2010 at 10:51 am
Cialis UK…
Buygeneric meds…
December 23rd, 2010 at 5:44 pm
Cialis UK…
Buynow it…
December 23rd, 2010 at 11:21 pm
order cialis in canada online…
Buyno prescription…
December 28th, 2010 at 9:06 pm
Advair@official.site” rel=”nofollow”>.…
Buynow it…
December 29th, 2010 at 6:21 am
aggrenox@1.now” rel=”nofollow”>.…
Buygeneric meds…
December 29th, 2010 at 6:52 am
dosage@of.albenza.for.human.hookworm.infection” rel=”nofollow”>..…
Buyno prescription…
December 29th, 2010 at 11:32 am
cost@of.alesse” rel=”nofollow”>..…
Buyit now…
December 29th, 2010 at 3:34 pm
aloe@vera.gel.indicatii” rel=”nofollow”>……
Buygeneric drugs…
December 30th, 2010 at 3:16 pm
Ampicillin@official.site” rel=”nofollow”>.…
Buynow it…
December 30th, 2010 at 10:27 pm
avodart@in.usa” rel=”nofollow”>.…
Buyno prescription…
December 31st, 2010 at 7:04 am
..…
Buygeneric drugs…
January 1st, 2011 at 12:46 am
Aricept@official.site” rel=”nofollow”>.…
Buynow…
January 1st, 2011 at 1:02 pm
Augmentin@official.site” rel=”nofollow”>.…
Buywithout prescription…
January 1st, 2011 at 9:35 pm
Clonidine@official.site” rel=”nofollow”>……
Buynow…
January 2nd, 2011 at 9:43 am
celexa@canada.now” rel=”nofollow”>.…
Buynow…
January 2nd, 2011 at 10:53 pm
cipro@250.mg” rel=”nofollow”>..…
Buygeneric meds…
January 4th, 2011 at 8:30 pm
generic@Cialis.now” rel=”nofollow”>.…
Buynow…
January 5th, 2011 at 4:57 am
buy@Viagra.now” rel=”nofollow”>……
Buygeneric pills…
January 5th, 2011 at 1:19 pm
< a href="http://my.gardenguides.com/members/buy-Cialis? buy@Cialis.now…
Buydrugs without prescription…
January 6th, 2011 at 9:52 am
cheap@Viagra.now” rel=”nofollow”>……
Buygeneric pills…
January 17th, 2011 at 9:00 am
Abilify@official.site” rel=”nofollow”>……
Buynow…
January 17th, 2011 at 11:58 am
Abilify@official.site” rel=”nofollow”>……
Buynow it…
January 21st, 2011 at 9:04 pm
depakote@classification.now” rel=”nofollow”>..…
Buygeneric drugs…
February 4th, 2011 at 5:53 pm
e-code for zometa…
Buyit now…
February 5th, 2011 at 4:39 am
zofran odt…
Buynow it…
February 5th, 2011 at 8:22 am
Zocor…
Buygeneric meds…
February 5th, 2011 at 10:16 pm
zyrtec in dialysis patients…
Buywithout prescription…
February 6th, 2011 at 8:16 pm
cats zanaflex…
Buydrugs without prescription…
February 6th, 2011 at 11:26 pm
Zaditor…
Buydrugs without prescription…
February 7th, 2011 at 2:23 pm
what is the generic drug for wellbutrin 150 sr…
Buyno prescription…
February 7th, 2011 at 4:13 pm
Vytorin…
Buynow…
March 3rd, 2011 at 4:36 am
Zyvox…
Buydrugs without prescription…
March 3rd, 2011 at 6:37 am
buy liposomal lidocaine 4% cream maxilene…
Buywithout prescription…
March 3rd, 2011 at 7:23 am
Zoloft…
Buyit now…
March 3rd, 2011 at 6:04 pm
zyrtec anticolinergici effect…
Buyno prescription…
March 4th, 2011 at 12:29 am
Zyrtec…
Buyit now…
March 4th, 2011 at 9:10 am
gilbert’s syndrome tylenol…
Buygeneric meds…
March 4th, 2011 at 1:23 pm
Zyprexa…
Buydrugs without prescription…
March 5th, 2011 at 3:22 am
rumalaya forte…
Buywithout prescription…
March 5th, 2011 at 4:14 am
Rogaine…
Buygeneric meds…
March 5th, 2011 at 8:06 am
zyprexa relprevv j-code…
Buygeneric drugs…
March 5th, 2011 at 8:57 am
side effect of zoloft…
Buyno prescription…
March 6th, 2011 at 12:25 pm
Retin A…
Buygeneric drugs…
March 7th, 2011 at 11:00 am
Omeprazole…
Buygeneric pills…
March 8th, 2011 at 4:48 pm
Pyridium…
Buydrugs without prescription…
March 8th, 2011 at 6:48 pm
Pyrantel Pamoate…
Buygeneric meds…
March 9th, 2011 at 6:55 am
howard county purim carnival 2010…
Buyno prescription…
March 9th, 2011 at 2:11 pm
Zyprexa…
Buynow it…
March 9th, 2011 at 9:06 pm
is overdosing on seroquel painful…
Buydrugs without prescription…
March 10th, 2011 at 9:19 am
rogaine for thicker eyebrows…
Buynow…
March 10th, 2011 at 11:24 am
risperdal and carbatrol interactions…
Buygeneric pills…
March 10th, 2011 at 1:22 pm
prozac breast feeding…
Buydrugs without prescription…
March 11th, 2011 at 1:00 am
Prozac…
Buygeneric meds…
March 11th, 2011 at 5:50 am
low dose haldol and paxil…
Buygeneric drugs…
March 28th, 2011 at 4:14 pm
Pyrantel@Pamoate.now” rel=”nofollow”>..…
Buygeneric pills…
March 29th, 2011 at 12:32 am
Tylenol@Tylenol.Tylenol” rel=”nofollow”>……
Buygeneric meds…
March 29th, 2011 at 2:14 am
Topamax@Topamax.Topamax” rel=”nofollow”>.…
Buyit now…
March 29th, 2011 at 1:28 pm
Tri@Cyclen.now” rel=”nofollow”>……
Buyno prescription…
March 29th, 2011 at 9:26 pm
Soma@Soma.Soma” rel=”nofollow”>.…
Buyno prescription…
March 30th, 2011 at 2:54 pm
Purim@Purim.Purim” rel=”nofollow”>……
Buygeneric drugs…
March 30th, 2011 at 10:41 pm
Yaz…
Buygeneric pills…
March 31st, 2011 at 12:26 am
Singulair@Singulair.Singulair” rel=”nofollow”>……
Buygeneric pills…
March 31st, 2011 at 1:07 am
Prozac@Prozac.Prozac” rel=”nofollow”>.…
Buygeneric pills…
March 31st, 2011 at 3:27 am
risperdal@warnings.for.elderly” rel=”nofollow”>……
Buynow it…
March 31st, 2011 at 5:35 am
Cozaar@Cozaar.Cozaar” rel=”nofollow”>.…
Buynow it…
March 31st, 2011 at 1:16 pm
Prozac@Prozac.Prozac” rel=”nofollow”>.…
Buygeneric drugs…
March 31st, 2011 at 1:40 pm
Claritin@Claritin.Claritin” rel=”nofollow”>..…
Buyit now…
March 31st, 2011 at 4:01 pm
Singulair@Singulair.Singulair” rel=”nofollow”>.…
Buygeneric drugs…
April 1st, 2011 at 2:06 pm
coral@calcium.ultra” rel=”nofollow”>……
Buygeneric drugs…
April 1st, 2011 at 3:15 pm
buy@human.growth.hormone.product” rel=”nofollow”>……
Buygeneric drugs…
April 2nd, 2011 at 2:12 am
early@childhood.purim.crafts” rel=”nofollow”>.…
Buygeneric drugs…
April 2nd, 2011 at 2:40 pm
..…
Buygeneric drugs…
April 2nd, 2011 at 4:19 pm
……
Buydrugs without prescription…
April 2nd, 2011 at 4:21 pm
allegra@print.colorado.springs” rel=”nofollow”>……
Buygeneric drugs…
April 3rd, 2011 at 8:47 am
.…
Buynow…
April 3rd, 2011 at 2:18 pm
.…
Buywithout prescription…
April 3rd, 2011 at 5:47 pm
rhinocort@vs.beconase” rel=”nofollow”>.…
Buyno prescription…
April 3rd, 2011 at 6:36 pm
dried@neem.leaves” rel=”nofollow”>……
Buywithout prescription…
April 3rd, 2011 at 7:07 pm
crestor@statin.drugs” rel=”nofollow”>……
Buyit now…
April 4th, 2011 at 11:26 am
.…
Buyno prescription…
April 4th, 2011 at 3:43 pm
can@you.take.vicodin.with.prednisolone” rel=”nofollow”>.…
Buynow…
April 4th, 2011 at 4:51 pm
effexor@drug.interaction” rel=”nofollow”>.…
Buygeneric pills…
April 4th, 2011 at 5:25 pm
alternatives@to.premarin” rel=”nofollow”>……
Buygeneric pills…
April 4th, 2011 at 8:33 pm
long@term.prilosec.use” rel=”nofollow”>.…
Buygeneric drugs…
April 4th, 2011 at 11:58 pm
is@prometrium.and.blood.clots” rel=”nofollow”>..…
Buywithout prescription…
April 5th, 2011 at 1:28 am
cutting@proscar.tablets” rel=”nofollow”>.…
Buygeneric pills…
April 5th, 2011 at 3:15 am
.…
Buygeneric drugs…
April 5th, 2011 at 4:37 am
altace@generic.name” rel=”nofollow”>.…
Buynow it…
April 5th, 2011 at 9:26 am
buy@online.amoxicillin” rel=”nofollow”>.…
Buywithout prescription…
April 5th, 2011 at 10:07 am
methotrexate@and.placenta.acretia” rel=”nofollow”>.…
Buygeneric drugs…
April 5th, 2011 at 5:27 pm
neurontin@dyskinesia.tardive.dystonia” rel=”nofollow”>.…
Buygeneric drugs…
April 5th, 2011 at 7:09 pm
how@well.does.nexium.cure.barretts.esophagus” rel=”nofollow”>.…
Buygeneric drugs…
April 5th, 2011 at 11:57 pm
changing@from.paxil.to.paxil.cr” rel=”nofollow”>.…
Buyno prescription…
April 6th, 2011 at 3:34 am
side@effects.of.dog.medication.famotidine.and.flagyl” rel=”nofollow”>……
Buygeneric drugs…
April 7th, 2011 at 9:10 am
……
Buygeneric drugs…