LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to reduce the size of volume group? (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-reduce-the-size-of-volume-group-921915/)

pinga123 01-03-2012 11:51 PM

Unable to reduce the size of volume group?
 
My volume group of size 200 gb.

out of which only 100 gb is used by 2 logical volumes /dev/vg00/lvol0 and /dev/vg00/lvol0 respectively (both are 50 gb each).

Whenever i use vgreduce command to reduce the size of volume group i get below error.
Code:

# vgreduce vg00 -a
  Physical volume "/dev/xvdb5" still in use

How can i reduce the volume group size to free up 100 gb?


Code:

# lvdisplay
  --- Logical volume ---
  LV Name                /dev/vg00/lvol0
  VG Name                vg00
  LV UUID                tji5FT-GuoG-jfLN-2KXg-Ra0a-6SQA-4RR4r7
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                50.00 GB
  Current LE            12800
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          253:0

  --- Logical volume ---
  LV Name                /dev/vg00/lvol1
  VG Name                vg00
  LV UUID                xdqsuf-jl1U-TY1h-0fIa-kywO-I6fu-7UVSHB
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                50.00 GB
  Current LE            12800
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          253:1

vgdisplay

Code:

# vgdisplay
  --- Volume group ---
  VG Name              vg00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  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              200.00 GB
  PE Size              4.00 MB
  Total PE              51199
  Alloc PE / Size      25600 / 100.00 GB
  Free  PE / Size      25599 / 100.00 GB
  VG UUID              NL5ws1-uaxQ-Wmtm-75GZ-WnQX-S7Vd-XeHJuS


blue_print 01-04-2012 12:20 AM

How many Physical volumes you have? It seems like all volumes in use! and what is the result of pvs command?

pinga123 01-04-2012 01:16 AM

Code:

# pvs
  PV        VG  Fmt  Attr PSize  PFree
  /dev/xvdb5 vg00 lvm2 a-  200.00G 100.00G


Satyaveer Arya 01-04-2012 01:23 AM

If the physical volume is still being used you will have to migrate the data to another physical volume using the pvmove command. Then use the vgreduce command to remove the physical volume:

This command will remove the physical volume /dev/hda1 or whatever from the volume group vg00.

Quote:

# vgreduce vg00 /dev/hda1
And then you can reduce the size of volume group.


All times are GMT -5. The time now is 02:28 PM.