Operating System - HP-UX
1826302 Members
4057 Online
109692 Solutions
New Discussion

vgreduce won't let me reduce a device

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

vgreduce won't let me reduce a device

I tried:
mv /etc/lvmtab /etc/lvmtab.bad
vgscan -av

it is not helpful. Please find attached messages. If you notice it, when I do pvdisplay on this device, it shows me "unavailable". I am not sure if data on the device /dev/dsk/c8t4d3 is valid or not. I just added this device by vgextend command, and now I wanted to remove it from vg01. Please let me know what I should do to remove the device from vg01.
=============================

# vgreduce /dev/vg01 /dev/dsk/c8t4d3
vgreduce: Physical volume "/dev/dsk/c8t4d3" could not be removed since some of
ts
physical extents are still in use.

# pvdisplay /dev/dsk/c8t4d3 | more
--- Physical volumes ---
PV Name /dev/dsk/c8t4d3
VG Name /dev/vg01
PV Status unavailable
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 4
Total PE 3072
Free PE 0
Allocated PE 3072
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
none
10 REPLIES 10
RAC_1
Honored Contributor

Re: vgreduce won't let me reduce a device

While you can do vgreduce -f to take care of problem, you need to understand that you will loose the data that was on that disk.

man vgreduce for details. (vgreduce -f vgxx)
There is no substitute to HARDWORK
Hanry Zhou
Super Advisor

Re: vgreduce won't let me reduce a device

RAC,

vgreduce -f /dev/vg01
doesn't help at all, everything looks same after I did this command.

"PV STATUS unavailable" what does that tell us?
none
Kent Ostby
Honored Contributor

Re: vgreduce won't let me reduce a device

A lot of times that can mean that you have a hardware problem on the disk.

Might want to test it:

dd if=/dev/rdsk/cXtYdZ of=/dev/null bs=64k

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Geoff Wild
Honored Contributor

Re: vgreduce won't let me reduce a device

Sounds like there may be a lock on the file system that was mounted on that disk...IE - a logfile was being written to, and someone unmounted the file system (after a kill -9 on the process)....

You may have to reboot to clear this...

You could try unmounting all on that vg, then vgchange -a n /dev/vg01

Then try to vgreduce -f it...

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Tim D Fulford
Honored Contributor

Re: vgreduce won't let me reduce a device

Hi

****LOOK AT THE OPUTPUT***
:

Cur LV 1
PE Size (Mbytes) 4
Total PE 3072
Free PE 0
Allocated PE 3072
:

Cur LV is 1, & it occupies the whole disk therefore 1 LV still resids on the disk. do

# vgdisplay -v /dev/dsk/c8t4d3 | more

And this will show you which LV is still in existance, the do lvremove /dev/vg01/lvYYY; vgredce /dev/dsk/c8t4d3; usual caveats about backups should apply.

Regards

Tim
-
Isralyn Manalac_1
Regular Advisor

Re: vgreduce won't let me reduce a device

Hi Hanry,

The vgreduce output has indicated that there are physical extents that are still in use. I suggest that you do an lvremove first, then a vgreduce. You need to execute pvdisplay (with the -v option) to determine which lvol/s had extents on that disk. It is necessary to have a data backup prior to doing these commands.

Good luck!

Regards,

Isralyn
hpuxsa
Frequent Advisor

Re: vgreduce won't let me reduce a device

you could try

vgreduce -l vg01 /dev/dsk/c8t4d3
The Real MD
Valued Contributor

Re: vgreduce won't let me reduce a device

Is the disk being mirrored at all?
Matthew Ghofrani
Regular Advisor

Re: vgreduce won't let me reduce a device

Do pvdisplay -v /dev/dsk/c..t..d..
Find out what lvols are using this disk.
If need be, lvol should be removed first, then you have no problem doing the vgreduce.
Life is full of bugs
Mark Nieuwboer
Esteemed Contributor
Solution

Re: vgreduce won't let me reduce a device

Hi,

You have made a 2 disk vg but not with a mirror. futher more you have extendend your lv so data is writen over but disk.
you have to reduce the lv size too the size of one disk with lvreduce.
after that you can do a vgreduce.
make sure you make a backup of your filesystems.

grtz. Mark