LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-24-2013, 05:57 AM   #1
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Rep: Reputation: Disabled
vgextend - lvm resizing


my guest OS ubuntu server was installed with 16GB default, on my vsphere i added 4GB. now im trying to merge my logical volume, but im getting the error

Code:
root@media:~# lvextend -l 100%FREE /dev/media/root
  New size given (6 extents) not larger than existing size (3773 extents)
  Run `lvextend --help' for more information.

root@media:~# pvdisplay
Code:
  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               media
  PV Size               15.76 GiB / not usable 2.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              4034
  Free PE               6
  Allocated PE          4028
  PV UUID               3Wb6q0-6MI7-Ltdv-g014-DbVk-ldRY-4yHgKC
   
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               media
  PV Size               1023.00 KiB
  Allocatable           NO
  PE Size               4.00 MiB
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               wvlrjC-STIH-oSyw-hQji-TElm-BTVq-sxaWFV
root@media:~# vgdisplay
Code:
root@media:~# vgdisplay 
  --- Volume group ---
  VG Name               media
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               15.76 GiB
  PE Size               4.00 MiB
  Total PE              4034
  Alloc PE / Size       4028 / 15.73 GiB
  Free  PE / Size       6 / 24.00 MiB
  VG UUID               07YA6U-woMS-aRTh-TlIL-0Yuk-DrJ3-dFs3Mo
root@media:~# lvdisplay
Code:
 --- Logical volume ---
  LV Name                /dev/media/root
  VG Name                media
  LV UUID                jlT97A-4Dye-UCZX-5kkL-7yYq-0Z7g-I36xHQ
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                14.74 GiB
  Current LE             3773
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
   
  --- Logical volume ---
  LV Name                /dev/media/swap_1
  VG Name                media
  LV UUID                PeEKTg-2sVo-tPcY-vMKk-m9vJ-YXYm-9cl15Y
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                1020.00 MiB
  Current LE             255
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1
 
Old 05-24-2013, 04:29 PM   #2
goarilla
LQ Newbie
 
Registered: Sep 2005
Location: Belgium
Distribution: slackware 10
Posts: 13

Rep: Reputation: 2
try: lvextend -l +100%FREE dev/media/root
 
Old 05-24-2013, 07:40 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Yes, goarilla is right.

The command "lvextend -l 100%FREE /dev/media/root" says "make the volume the EXACT SIZE of the existing unallocated space in the vg". Not what you want. Adding that + sign alters the meaning to "ADD the amount of the existing unallocated space to the existing volumes size".

After extending the LV size, you will also need to resize the filesystem that exists on that LV.

Last edited by haertig; 05-24-2013 at 07:41 PM.
 
Old 05-25-2013, 12:35 AM   #4
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
Quote:
was installed with 16GB default, on my vsphere i added 4GB.
Where is Physical volume of 4gb? your pvdisplay command shows only 2 PVs - 16gb and 1mb. create physical volume of 4gb first.
Code:
# pvcreate /dev/sdxx
Then, add newly created PV to volume group.
Code:
# vgextend media /dev/sdxx
Verify it - you should be shown 4gb as VFree space.
Code:
# vgs
Since you are extending root LV, boot in rescue mode and follow the steps
Code:
# lvm lvextend -l +100%FREE /dev/media/root
# resize2fs -f /dev/media/root
# reboot

Last edited by Madhu Desai; 05-25-2013 at 12:44 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[LVM] Difference between vgimport e vgextend antolepore Linux - Software 1 07-13-2012 01:40 AM
Resizing LVM prasanta.82 Linux - Server 1 06-15-2011 11:56 PM
resizing PV does not work (lvm) after resizing partition deadeyes Red Hat 5 03-11-2011 11:19 AM
Resizing the LVM g_kapoor85 Linux - Software 3 03-21-2009 01:27 AM
Resizing / with LVM zivota Red Hat 2 07-12-2006 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:16 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