LinuxQuestions.org
Help answer threads with 0 replies.
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 09-12-2013, 02:19 PM   #1
pyr
LQ Newbie
 
Registered: Sep 2013
Posts: 2

Rep: Reputation: Disabled
LVM, Expanded the size of my physical volume, how do I expand the volume group?


Hi,

I have a raid5 system made up of three discs on which i have an LVM. This consists of one logical volume in one volume group made up out of one physical volume. I set up an LVM a few years ago as I learned that it would make it easier to resize my volumes in the future.

I have now replaced all my original discs in the raid by larger once and then want to use more space for my volume. The problem is that I started this operation without reading the manual, and now I ended up in a situation to which I can't find a solution.

As my disks were replaced I partitioned the entire disk as one partition. This means that the raid (/dev/md0) today is double the size it once was. (I have now understood that what I should have done was creating a second partition and a new raid configuration, create a new physical volume and add this to my volume group. Unfortunately I didn't) So now I have a physical volume (/dev/md0) that is 3.64 TB. But my volume group is just 1.82TB. I have not been able to find a way to expand the size of my volume group other than by adding new physical volumes. But what I need to expand it by size to include all the space available on the physical volume.

Can this be done?
As I have understood things vgextend only takes a new physical volume as argument and I don't have any new physical volume to add.

Here is the output from some commands that may help you to understand my problem:

# pvdisplay
--- Physical volume ---
PV Name /dev/md0
VG Name lvm-raid
PV Size 3.64 TB / not usable 1.82 TB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 476933
Free PE 0
Allocated PE 476933
PV UUID D1gp7S-Oqb0-4yQq-BmyK-FNHf-51vz-rJRerl

# vgdisplay
--- Volume group ---
VG Name lvm-raid
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 1.82 TB
PE Size 4.00 MB
Total PE 476933
Alloc PE / Size 476933 / 1.82 TB
Free PE / Size 0 / 0
VG UUID Do3tKS-OYkc-P90J-bM80-5UQk-TvrN-t0oe3B

# lvdisplay
--- Logical volume ---
LV Name /dev/lvm-raid/lvm0
VG Name lvm-raid
LV UUID 23xwns-hGDJ-ClhC-ZVYi-A4Yc-R3xn-oJVskL
LV Write Access read/write
LV Status available
# open 0
LV Size 1.82 TB
Current LE 476933
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

Regards
Pyr
 
Old 09-12-2013, 06:16 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
There is no "size" parameter associated with a volume group other than the sizes of the physical volumes that have been assigned to it. I suspect that you just need to run "pvresize /dev/md0" to update LVM with the new size of the physical volume. Then you should see space available to resize existing logical volumes or add new ones.
 
1 members found this post helpful.
Old 09-15-2013, 05:28 AM   #3
pyr
LQ Newbie
 
Registered: Sep 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Smile You solved it!

Quote:
Originally Posted by rknichols View Post
There is no "size" parameter associated with a volume group other than the sizes of the physical volumes that have been assigned to it. I suspect that you just need to run "pvresize /dev/md0" to update LVM with the new size of the physical volume. Then you should see space available to resize existing logical volumes or add new ones.
Thank you.
It seemed that I had misunderstood what I had to do. I thought that mv PV was already resized after changing the size of my raid-array.
I did as you suggested followed by an lvextend and now it looks like I can use my entire disk space. Thanks!
 
  


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
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
[SOLVED] Increase the Total Size of LVM Volume Group ? The Unincorporated Man Linux - Server 2 11-06-2011 11:25 PM
Can I increase the size of a physical volume in an lvm group? If so, how? MikeB23930 Fedora 2 07-21-2009 05:38 PM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
LVM Problem - vgimport - wrong number of physical volumes to import volume group Anything1 Linux - Software 0 09-06-2003 07:18 PM

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

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