LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-04-2013, 02:36 AM   #1
dirtyfishtank
LQ Newbie
 
Registered: Aug 2013
Posts: 9

Rep: Reputation: Disabled
Increase LVM partition in virtual machine


Hey all.
I've been running Fedora in a virtual machine (VMware Workstation) as a development environment. When I first set it up I allocated 30GB of hard disk space but naturally I need to expand it. I expanded the VM through the VM settings to 100GB and ran gparted to expand the main LVM partition also. This was successful however when running df -h it still shows only 30GB. fdisk tells me that the disk is over 100gb (which is more accurate). Any idea what else I need to do to increase disk space permanently.

Code:
[md@fedora ~]$ df -h
Filesystem                          Size  Used Avail Use% Mounted on
rootfs                               28G   12G   16G  43% /
devtmpfs                            1.5G     0  1.5G   0% /dev
tmpfs                               1.5G   80K  1.5G   1% /dev/shm
tmpfs                               1.5G  1.1M  1.5G   1% /run
/dev/mapper/vg_md--fedora-lv_root   28G   12G   16G  43% /
tmpfs                               1.5G     0  1.5G   0% /sys/fs/cgroup
tmpfs                               1.5G     0  1.5G   0% /media
/dev/sda1                           485M   92M  368M  20% /boot
[moe@moe-fedora ~]$
Code:
Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders, total 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e1a69

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   204290047   101632000   8e  Linux LVM
/dev/sda3       204290048   209715199     2712576   82  Linux swap / Solaris
 
Old 11-04-2013, 02:49 AM   #2
anon237
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Did you run the resize2fs command after resizing?

Have a look here as well: LVM Resizing Guide
 
1 members found this post helpful.
Old 11-04-2013, 03:54 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,290

Rep: Reputation: 467Reputation: 467Reputation: 467Reputation: 467Reputation: 467
I guess you also need to increase the virtual hdd storage on VMWare.

check out this link:
http://kb.vmware.com/selfservice/mic...rnalId=1017662
 
1 members found this post helpful.
Old 11-04-2013, 04:40 PM   #4
dirtyfishtank
LQ Newbie
 
Registered: Aug 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
I've tried everything the above links suggest. Gparted shows over 70GB of free space, as does vmware. But when I run lvextend in Fedora and try to increase the LVM partition 10GB (which is already allocated) it always complains about not enough extends. Am I missing something obvious here?
 
Old 11-05-2013, 02:42 AM   #5
anon237
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by dirtyfishtank View Post
I've tried everything the above links suggest. Gparted shows over 70GB of free space, as does vmware. But when I run lvextend in Fedora and try to increase the LVM partition 10GB (which is already allocated) it always complains about not enough extends. Am I missing something obvious here?
You don't post any details, could you post the output of the following commands:
Code:
disk space usage:
# df -Ph | grep "^/dev

physical volumes info:
# pvs

volume groups info:
# vgs

logical volumes info:
# lvs
# lvdisplay /dev/mapper/vg_md--fedora-lv_root

volume groups attributes:
# vgdisplay lv_root
Make sure that the brown part is what is shown in the lvdisplay output (the VG Name part).

You also mention using lvextend, which isn't used in the links, did you mix up lvextend and lvresize?
 
Old 11-05-2013, 03:42 AM   #6
dirtyfishtank
LQ Newbie
 
Registered: Aug 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks for your response. Here is the output and apologies for not including this earlier.
Code:
# df -Ph | grep "^/dev"
/dev/mapper/vg_moe--fedora-lv_root   28G   12G   16G  43% /
/dev/sda1                           485M   92M  368M  20% /boot

# pvs
  PV         VG            Fmt  Attr PSize  PFree 
  /dev/sda2  vg_moe-fedora lvm2 a--  96.91g 44.94g

# vgs
  VG            #PV #LV #SN Attr   VSize  VFree 
  vg_moe-fedora   1   2   0 wz--n- 96.91g 44.94g

# lvs
  LV      VG            Attr     LSize  Pool Origin Data%  Move Log Copy%  Convert
  lv_root vg_moe-fedora -wi-ao-- 50.00g                                           
  lv_swap vg_moe-fedora -wi-ao--  1.97g     

# lvdisplay /dev/vg_moe-fedora/lv_root 
  --- Logical volume ---
  LV Path                /dev/vg_moe-fedora/lv_root
  LV Name                lv_root
  VG Name                vg_moe-fedora
  LV UUID                njvBIh-lo7P-thWB-fDBb-wWmy-me5K-voC2jm
  LV Write Access        read/write
  LV Creation host, time moe-fedora, 2012-09-23 06:08:17 +1000
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             1600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
   

# vgdisplay vg_moe-fedora 
  --- Volume group ---
  VG Name               vg_moe-fedora
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  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               96.91 GiB
  PE Size               32.00 MiB
  Total PE              3101
  Alloc PE / Size       1663 / 51.97 GiB
  Free  PE / Size       1438 / 44.94 GiB
  VG UUID               gb999D-8OWO-mW0l-ncg6-XjKQ-e7vu-Auzslm
 
Old 11-05-2013, 04:13 AM   #7
anon237
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
If I look at the df -Ph output then the size is still reported as being 28G, which is the "old" size.

I can only assume that you did not run the resize2fs -p /dev/mapper/vg_moe--fedora-lv_root command at the appropriate time.

Without knowing exactly which commands you did and did not execute to get to this point and what you did since doing these commands (lvextend being one) I'm not sure if you can just execute the resize2fs command at this time.

Make sure you have a working back-up available before you try.
 
Old 11-05-2013, 05:20 AM   #8
dirtyfishtank
LQ Newbie
 
Registered: Aug 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
I copied the entire VM, ran lvextend -L99GB <path>; resize2fs -p /dev/mapper/vg_moe--fedora-lv_root and that seemed to have solved that problem. VM is now using full hard disk space. Thanks for your help
 
Old 11-05-2013, 05:43 AM   #9
anon237
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You're welcome.

Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Increase size of an encrypted LVM partition jjthomas Slackware 2 01-13-2013 04:10 AM
Increase size of KVM/QEMU .img virtual machine Nick_C Linux - Virtualization and Cloud 6 10-24-2012 05:28 PM
is surfing through a virtual machine can increase security? hydepark2734 Linux - Security 4 01-31-2012 05:37 PM
Extend Partition and Linux LVM on a virtual Server Steve_Aug Linux - Virtualization and Cloud 1 12-16-2011 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration