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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-04-2013, 02:36 AM
|
#1
|
LQ Newbie
Registered: Aug 2013
Posts: 9
Rep: 
|
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
|
|
|
11-04-2013, 02:49 AM
|
#2
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Did you run the resize2fs command after resizing?
Have a look here as well: LVM Resizing Guide
|
|
1 members found this post helpful.
|
11-04-2013, 04:40 PM
|
#4
|
LQ Newbie
Registered: Aug 2013
Posts: 9
Original Poster
Rep: 
|
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?
|
|
|
11-05-2013, 02:42 AM
|
#5
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Quote:
Originally Posted by dirtyfishtank
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?
|
|
|
11-05-2013, 03:42 AM
|
#6
|
LQ Newbie
Registered: Aug 2013
Posts: 9
Original Poster
Rep: 
|
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
|
|
|
11-05-2013, 04:13 AM
|
#7
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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.
|
|
|
11-05-2013, 05:20 AM
|
#8
|
LQ Newbie
Registered: Aug 2013
Posts: 9
Original Poster
Rep: 
|
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
|
|
|
11-05-2013, 05:43 AM
|
#9
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
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
|
|
|
All times are GMT -5. The time now is 01:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|