LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-30-2017, 02:02 PM   #1
achudacoff
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Rep: Reputation: Disabled
Extending volumes - lvextend help


Hello, I am running CentOS 7.2 in a VM. I started off with 20GB of disk space, but need to extend it.

I've increased the number from 20 to 45 in VMWare client, but now I have to go into the host environment to increase the size there.

I was following an article on how to do this and ran into a blocker with the lvextend command. (https://ma.ttias.be/increase-a-vmwar...oting/#respond)

The goal of this article was to create an additional volume (sda3) and extend sda2 into it. Here is what I have:

Code:
[root@localhost /]# pvscan
  PV /dev/sda2   VG cl              lvm2 [19.00 GiB / 0    free]
  PV /dev/sda3   VG cl              lvm2 [25.00 GiB / 25.00 GiB free]
  Total: 2 [43.99 GiB] / in use: 2 [43.99 GiB] / in no VG: 0 [0   ]
[root@localhost /]#
The command in this article states
Quote:
"lvextend /dev/VolGroupxx /dev/sdXX"
, but I am getting the following error:

Code:
[root@localhost /]# lvextend /dev/cl /dev/sda3
  "/dev/cl": Invalid path for Logical Volume.
  Run `lvextend --help' for more information.
[root@localhost /]#
Thanks in advance for your smart help.
 
Old 08-30-2017, 02:49 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You need to specify the Logical volume. cl is the volume group. Look at the output of the lvdisplay and then pick the one you want to extend.

lvextend /dev/cl/lv_to_be_extended /dev/sda3

Last edited by michaelk; 08-30-2017 at 02:54 PM.
 
Old 08-30-2017, 02:55 PM   #3
achudacoff
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
OK, that makes sense. This is what is in the cl directory:

Does it matter which one I select?

Code:
[root@localhost dev]# ll /dev/cl/
total 0
lrwxrwxrwx. 1 root root 7 Aug 30 05:36 root -> ../dm-0
lrwxrwxrwx. 1 root root 7 Aug 30 05:36 swap -> ../dm-1
[root@localhost dev]#
 
Old 08-30-2017, 02:55 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
/dev/cl is your PV (physical volume). You also need the name of the LV (logical volume). Run the "lvs" command to list logical volume names. The whole name should be /dev/<pv>/<lv>, something like: /dev/cl/foo.
 
Old 08-30-2017, 02:58 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
Use LV/PV commands, not examination of directory contents, to see what LVM considers to be the logical and the physical picture.

All Linux mount-points reside in some logical volume, which is then spread over one-or-more allocations taken from a physical group. Space in a physical group comes from designated partitions on physical drives.

The physical picture concerns itself with devices, not with where the space on those devices is apportioned. Likewise, the logical picture concerns itself with what the OS sees, not the physical resources from whence it comes.

Last edited by sundialsvcs; 08-30-2017 at 02:59 PM.
 
Old 08-30-2017, 03:25 PM   #6
achudacoff
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
Does this look right?

Code:
[root@localhost /]# lvs
  LV   VG Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root cl -wi-ao---- 17.00g
  swap cl -wi-ao----  2.00g
Code:
[root@localhost /]# pvs
  PV         VG Fmt  Attr PSize  PFree
  /dev/sda2  cl lvm2 a--  19.00g     0
  /dev/sda3  cl lvm2 a--  25.00g 25.00g
[root@localhost /]#
 
Old 08-30-2017, 03:54 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes, The logical volume you want to extend is root.
 
Old 08-30-2017, 03:56 PM   #8
gunrunner45
LQ Newbie
 
Registered: Aug 2017
Location: Tulsa
Distribution: Ubuntu, CentOS, Mint
Posts: 1

Rep: Reputation: Disabled
Try,

lvextend -L +25G /dev/cl/root

then

resize2fs /dev/cl/root
 
Old 08-30-2017, 04:07 PM   #9
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Also see man for -r
Lots of great tutorials on the www, for quick&easy learning

Welcome both to LQ!!!
 
Old 08-30-2017, 04:54 PM   #10
achudacoff
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for having me!

Getting closer.

Code:
[root@localhost /]# resize2fs /dev/cl/root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/cl/root
Couldn't find valid filesystem superblock.
[root@localhost /]#

Last edited by achudacoff; 08-30-2017 at 05:03 PM.
 
Old 08-30-2017, 05:08 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
CentOS 7 defaults to xfs. To resize xfs use xfs_growfs using its mount point.

xfs_growfs /dev/mapper/root

Last edited by michaelk; 08-30-2017 at 06:54 PM.
 
1 members found this post helpful.
Old 08-30-2017, 06:30 PM   #12
achudacoff
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Original Poster
Rep: Reputation: Disabled
And there it is!

Code:
[root@localhost /]# xfs_growfs /dev/cl/root
meta-data=/dev/mapper/cl-root    isize=512    agcount=4, agsize=1113856 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=4455424, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 4455424 to 10746880
[root@localhost /]#
Thanks guys and gals!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Extending pertition with lvextend failed ^andrea^ Linux - Server 11 05-06-2017 09:05 AM
extending volume group vs extending physical volume which is better ? Gil@LQ Linux - Server 2 08-19-2013 10:13 AM
Extending LVM with new raid volumes Kustom42 Linux - Server 3 08-15-2013 12:16 PM
regarding lvextend sushdba Linux - Newbie 3 06-17-2013 01:13 AM
lvextend? sachinh Linux - General 3 09-22-2009 07:25 AM

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

All times are GMT -5. The time now is 06:03 PM.

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