Operating System - HP-UX
1752800 Members
5953 Online
108789 Solutions
New Discussion юеВ

vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

 
SOLVED
Go to solution
Sammy_2
Super Advisor

vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

A 150GB EMC LUN was assigned as a shared disk on 2node cluster. This LUN was part of 70GB lun before but SAN admin reallocated it and made it 150GB. I see old LVS. How do I get of
all the LVS (67 ghost LVS) in the ops. See steps below. I tried "pvcreate -f disk" but when I vgcreate a vg , I still see all those non-existent lvs.

# vgdisplay -v ops|more
--- Volume groups ---
VG Name /dev/ops
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 67
Max PV 13
Cur PV 1
Act PV 1
Max PE per PV 36684
VGDA 2
PE Size (Mbytes) 4
Total PE 36678
Alloc PE 0
Free PE 36678
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/ops/gblaidx01
..
..
..
--- Physical volumes ---
PV Name /dev/dsk/c9t0d3
PV Status available
Total PE 36678
Free PE 36678
Autoswitch On


# lvremove /dev/ops/gblaidx01

lvremove: Couldn't delete logical volume "/dev/ops/gblaidx01":
The supplied lv number refers to a non-existent logical volume.
Volume Group configuration for /dev/ops has been saved in /etc/lvmconf/ops.conf


# vgremove /dev/ops
Volume group "/dev/ops" has been successfully removed.
# pvcreate -f /dev/rdsk/c9t0d3
Physical volume "/dev/rdsk/c9t0d3" has been successfully created.

# vgcreate /dev/ops /dev/dsk/c9t0d3
Increased the number of physical extents per physical volume to 36684.
vgcreate: Volume group "/dev/ops" could not be created:
VGRA for the disk is too big for the specified parameters. Increase the
extent size or decrease max_PVs/max_LVs and try again.

# vgcreate -p 13 /dev/ops /dev/dsk/c9t0d3
Increased the number of physical extents per physical volume to 36684.
Volume group "/dev/ops" has been successfully created.
Volume Group configuration for /dev/ops has been saved in /etc/lvmconf/ops.conf

inbphes5:/tmp ==> vgdisplay -v /dev/ops|more
--- Volume groups ---
VG Name /dev/ops
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 67
Max PV 13
Cur PV 1
Act PV 1
Max PE per PV 36684
VGDA 2
PE Size (Mbytes) 4
Total PE 36678
Alloc PE 0
Free PE 36678
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/ops/gblaidx01
..
..
..
--- Physical volumes ---
PV Name /dev/dsk/c9t0d3
PV Status available
Total PE 36678
Free PE 36678
Autoswitch On

good judgement comes from experience and experience comes from bad judgement.
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

pvcreate -f


Pete

Pete
Sammy_2
Super Advisor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

I tried pvcreate -f but that does not help. in this case.
good judgement comes from experience and experience comes from bad judgement.
Devender Khatana
Honored Contributor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

Hi,

Allthough the old LV's are not consuming any space but VGRA contains information about them & this is what you want to remove I suppose. For that fill whole LUN with null's or zero's using dd & then issue pvcreate & vgcreats commands.

HTH,
Devender
Impossible itself mentions "I m possible"
Devender Khatana
Honored Contributor
Solution

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

Hi,

Do vgexport for that VG, pvremove for that LUN & then do this for that LUN 7 follow vg creation procedure, you should not find this back.

#vgexport /dev/ops
#pvremove /dev/dsk/cxtydz
#dd if=/dev/zero bs=256k of=/dev/rdsk/cxtydz

Wait as it will take long time.

Now recreate the VG.

#pvcreate /dev/rdsk/cxtydz
#mkdir /dev/ops
#mknod /dev/ops/group c 64 0x0?0000 (? should be unique in all VG's)
#vgcreate /dev/ops /dev/dsk/cxtydz
#vgdisplay -v /dev/ops |more to verify.

HTH,
Devender
Impossible itself mentions "I m possible"
HGN
Honored Contributor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

Hi

You can do a pvcreate -f on that disk.

Rgds

HGN
Sammy_2
Super Advisor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

THANKS a bunch Devender. I am currently trying your solution. Have run pvremove and now am dd'ing on 150gb lun so am waiting to check once it is done. I dont see anything on the screen so hoping that it is doing something.
will keep posted.
good judgement comes from experience and experience comes from bad judgement.
Devender Khatana
Honored Contributor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

Sammy,

I assume it went away after dd. Was everything else normal?

Regards,
Devender
Impossible itself mentions "I m possible"
Sammy_2
Super Advisor

Re: vgcreate a LUN shows old ghost LVs on that LUN ? How to get rid of LVs?

yes Devender, all went fine after dd. I thought dd was not working since it took over 3 hours on a 150 gb lun. Also, For some reason, I had skipped 0x010000 for minor number, and went to 0x020000. i redid my mknod with 0x010000 and all looks good. Also, had to do a pvreate -f again after dd .
great solution. once again, do appreciate your vaulable input.
good judgement comes from experience and experience comes from bad judgement.