[SOLVED] LVM, Expanded the size of my physical volume, how do I expand the volume group?
Linux - GeneralThis 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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.