1833731 Members
2541 Online
110063 Solutions
New Discussion

lvremove failed

 
Torbjorn Westman
Frequent Advisor

lvremove failed

I want to remove a volume group and first I tried to remove the logical volumes corresponding to that volume group but without success...

$ lvremove /dev/vg01/lvol20
lvremove: Couldn't delete logical volume "/dev/vg01/lvol20":
The supplied lv number refers to a non-existent logical volume.
vgcfgbackup: Invalid LVMREC on Physical Volume /dev/rdsk/c0t8d0



Here are some info from other commands:

$ vgdisplay -v vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 3
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 2171
VGDA 2
PE Size (Mbytes) 4
Total PE 2170
Alloc PE 400
Free PE 1770
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/lvol20
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0

LV Name /dev/vg01/lvol99
LV Status available/syncd
LV Size (Mbytes) 1600
Current LE 400
Allocated PE 400
Used PV 1

LV Name /dev/vg01/lvol21
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0


--- Physical volumes ---
PV Name /dev/dsk/c0t8d0
PV Status unavailable
Total PE 2170
Free PE 1770
Autoswitch On


$ vgchange -a n vg01
vgchange: Couldn't deactivate volume group "vg01":
Device busy

$ fuser /dev/vg01/lvol20
/dev/vg01/lvol20:

$ fuser /dev/vg01/lvol99
/dev/vg01/lvol99:

$ fuser /dev/vg01/lvol21
/dev/vg01/lvol21:


$ strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t5d0
/dev/vg01
/dev/dsk/c0t8d0


$ lvdisplay -v /dev/vg01/lvol20
--- Logical volumes ---
LV Name /dev/vg01/lvol20
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation non-strict
IO Timeout (Seconds) default




Anyone who knows how I can remove this volume group ?
TW
35 REPLIES 35
Hai Nguyen_1
Honored Contributor

Re: lvremove failed

Try using SAM to remove it.

Hai
Pete Randall
Outstanding Contributor

Re: lvremove failed

From the man page for lvremove:

"Logical volumes must be closed before they can be removed. For
example, if the logical volume contains a file system, unmount the
file system before removing it."


Pete



Pete
Tom Geudens
Honored Contributor

Re: lvremove failed

Hi,
There seems to be something wrong with the LVM information on the disk.
First try to make things right with a
#vgcfgrestore vg01
then try the lvremove again ...

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Massimo Bianchi
Honored Contributor

Re: lvremove failed

Hi,
this is the problem

"PV Status unavailable "

To scratch it all,
first you need to do a vgcfgrestore on the disk, to replace correctly the information.

vgcfgrestore -n vg01 /dev/dsk/c0t8d0

then do a

vgchange -a y vg01

to have the system re-read the configuration.

Finally, umount the lvols, vgchange the vg and export it.

Massimo

Torbjorn Westman
Frequent Advisor

Re: lvremove failed

All filesystems in vg01 are unmounted.
TW
Tom Geudens
Honored Contributor

Re: lvremove failed

Hi again,
Oops, that should have been ...
#vgcfgrestore -n vg01 /dev/rdsk/c0t8d0

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Elena Leontieva
Esteemed Contributor

Re: lvremove failed

Patrick Wallek
Honored Contributor

Re: lvremove failed

If you just want to blow the VG away and don't care about it, try vgexport.

# vgexport vg01
Eugeny Brychkov
Honored Contributor

Re: lvremove failed

--- Physical volumes ---
PV Name /dev/dsk/c0t8d0
PV Status unavailable
Total PE 2170
Free PE 1770
Autoswitch On

PV_status=unavailable

please check what 'ioscan -fnCdisk' says for /dev/dsk/c0t8d0? If DEVICE and CLAIMED then check its readability with 'dd if=/dev/rdsk/c0t8d0 of=/dev/null bs=1024k' and if it will go ok then follow Massimo's advice. If it (dd) will not work then disk may be physically damaged, and if disk in ioscan will be NO_HW - the same, disk as a device is under suspicion.
What's this /dev/dsk/c0t8d0? Is it hot-pluggable disk? If yes, then please check if it's still in its slot. You will NOT be able to change lvmtab correctly without having this disk present (only vgscan may work, but it's not the best way to do it).
Generally - you need to ivestigate why c0t8d0 is unavailable
Eugeny
Torbjorn Westman
Frequent Advisor

Re: lvremove failed

vgexport: Volume group "vg01" is still active.
vgexport: Couldn't export volume group "vg01".



Note!
The physical disk has been replaced today!

syslog:
ul 24 11:01:55 gctiasu1 vmunix: SCSI: Read error -- dev: b 31 0x008000, errno: 126, resid: 2048,
Jul 24 11:02:05 gctiasu1 vmunix: SCSI: Read error -- dev: b 31 0x008000, errno: 126, resid: 2048,
Jul 24 11:22:03 gctiasu1 vmunix: SCSI: Read error -- dev: b 31 0x008000, errno: 126, resid: 2048,
Jul 24 11:22:13 gctiasu1 vmunix: SCSI: Read error -- dev: b 31 0x008000, errno: 126, resid: 2048,
Jul 24 11:31:20 gctiasu1 vmunix: SCSI: Read error -- dev: b 31 0x008000, errno: 126, resid: 2048,


This error message is also in syslog:
Jul 24 13:38:18 gctiasu1 vmunix: vxfs: mesg 024: vx_cutwait - /dev/vg01/lvol20 file system current usage table update error


TW
Massimo Bianchi
Honored Contributor

Re: lvremove failed

The physical disk has been replaced today!

:(

The technichan should have helped you out.
Now you have anew disk, with no data on it....

do the vgcfgrestore, as previously noted, and finally the vgexport.


I hope the SCSI errors belonged to BEFORE the replacement, not AFTER....

Massimo
Patrick Wallek
Honored Contributor

Re: lvremove failed

What did you do after you replaced the disk?

Did you do a

# vgcfgrestore -n vg01 /dev/rdsk/c0t8d0

# vgchange -a y vg01

# vgchange -a n vg01

That should allow you to do what you need to do.
Torbjorn Westman
Frequent Advisor

Re: lvremove failed

I dont know exactly what the technian did after the disk replacement.



I tried the commands now:

$ vgcfgrestore -n vg01 /dev/rdsk/c0t8d0
Volume Group configuration has been restored to /dev/rdsk/c0t8d0

$ vgchange -a y vg01
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c0t8d0":
A component of the path of the physical volume does not exist.
Volume group "vg01" has been successfully changed.

$ vgchange -a n vg01
vgchange: Couldn't deactivate volume group "vg01":
Device busy
TW
Torbjorn Westman
Frequent Advisor

Re: lvremove failed

"If you just want to blow the VG away and don't care about it, try vgexport.

# vgexport vg01"



Yes, I don't care about it and want to blow it away and want to use /dev/dsk/c0t8d0 to vg00 instead.


But:
$ vgexport vg01
vgexport: Volume group "vg01" is still active.
vgexport: Couldn't export volume group "vg01".

Are there any other ways to "deactivate" it other than with vgchange ?


TW
Massimo Bianchi
Honored Contributor

Re: lvremove failed

Hi,
can you reboot the server ?

I know it is a drastical solution, but i'm beginning to think that there is some dirty in the kernel memory structure...

vi /etc/lvmrc

set the value to 0

shutdown -r 0

When the server come up, all of your vg will not be active.

do the vgexport of vg01, now it should work.


after that,
vi /etc/lvmrc and set the variable to 1 (for next reboot), activate each pther vg by hand and finally issue a "mount -a".

Start your apps.

Waiting for better suggestions, though.....


Massimo
Torbjorn Westman
Frequent Advisor

Re: lvremove failed

"Hi,
can you reboot the server ? "


If the only way to solve the problem is that I have to it but I really hope to avoid....


TW
Patrick Wallek
Honored Contributor

Re: lvremove failed

Do an

# ioscan -fnC disk

and verify that c0t8d0 is CLAIMED and that the device files exist.

Also, what happens if you do a:

# pvdisplay /dev/dsk/c0t8d0
# diskinfo /dev/rdsk/c0t8d0

It sounds to me like there is still a problem with that disk.
Torbjorn Westman
Frequent Advisor

Re: lvremove failed

$ ioscan -fnCdisk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 8/4.5.0 sdisk CLAIMED DEVICE SEAGATE ST39173WC
/dev/dsk/c0t5d0 /dev/rdsk/c0t5d0
disk 1 8/4.8.0 sdisk CLAIMED DEVICE SEAGATE ST39173WC
/dev/dsk/c0t8d0 /dev/rdsk/c0t8d0
disk 2 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5701TA
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0

$ ll /dev/dsk/c0t8d0
brw-r----- 1 bin sys 31 0x008000 Aug 31 1999 /dev/dsk/c0t8d0

$ ll /dev/vg01
total 0
crw-r--r-- 1 root sys 64 0x010000 Sep 30 1999 group
brw-r----- 1 root sys 64 0x010001 Jan 28 13:05 lvol20
brw-r----- 1 root sys 64 0x010003 Jan 28 13:05 lvol21
brw-r----- 1 root sys 64 0x010002 Sep 30 1999 lvol99
crw-r----- 1 root sys 64 0x010001 Sep 30 1999 rlvol20
crw-r----- 1 root sys 64 0x010003 Oct 14 1999 rlvol21
crw-r----- 1 root sys 64 0x010002 Sep 30 1999 rlvol99

$ pvdisplay /dev/dsk/c0t8d0
--- Physical volumes ---
PV Name /dev/dsk/c0t8d0
VG Name /dev/vg01
PV Status unavailable
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 4
Total PE 2170
Free PE 1770
Allocated PE 400
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

$ diskinfo /dev/rdsk/c0t8d0
SCSI describe of /dev/rdsk/c0t8d0:
vendor: SEAGATE
product id: ST39173WC
type: direct access
size: 8891556 Kbytes
bytes per sector: 512
TW
RolandH
Honored Contributor

Re: lvremove failed

Hi,

"$ vgchange -a n vg01
vgchange: Couldn't deactivate volume group "vg01":
Device busy"

this looks very strange because you said that all lv are unmounted.

Can you do a fuser -c on the mountpoints even it means it is mounted or unmounted.

then a fuser -k /dev/vg01/lvol20 and the other ones.
Then try to repeat the commando $ vgchange -a n vg01

If that not help you should reboot your server.
No way.


Roland
Sometimes you lose and sometimes the others win
Ken Hubnik_2
Honored Contributor

Re: lvremove failed

Not sure ....but are you sure this disk was create in vg01 or vg00. What is in these directories /dev/vg00 and /dev/vg01. Your early post $ ll /dev/dsk/c0t8d0
brw-r----- 1 bin sys 31 0x008000 Aug 31 1999 /dev/dsk/c0t8d0

0x008000 may indicate that this disk is part of vg00 if usual standards were followed.
Ken Hubnik_2
Honored Contributor

Re: lvremove failed

Not sure ....but are you sure this disk was create in vg01 or vg00. What is in these directories /dev/vg00 and /dev/vg01. Your early post $ ll /dev/dsk/c0t8d0
brw-r----- 1 bin sys 31 0x008000 Aug 31 1999 /dev/dsk/c0t8d0

0x008000 may indicate that this disk is part of vg00 if usual standards were followed.
Ken Hubnik_2
Honored Contributor

Re: lvremove failed

Not sure ....but are you sure this disk was create in vg01 or vg00. What is in these directories /dev/vg00 and /dev/vg01. Your early post $ ll /dev/dsk/c0t8d0
brw-r----- 1 bin sys 31 0x008000 Aug 31 1999 /dev/dsk/c0t8d0

0x008000 may indicate that this disk is part of vg00 if usual standards were followed.
RolandH
Honored Contributor

Re: lvremove failed

Additional to the last post from Ken if it is like Ken said that this disk belongs already to vg00 you should do this.

#strings /etc/lvmtab
(is disk /dev/dsk/c0t8d0 listed at vg00 or vg01?)

# cp /etc/lvmtab /etc/lvmtab.OLD
# rm /etc/lvmtab
# vgscan vg00 ( recreates /etc/lvmtab )
# vgscan vg01
# strings /etc/lvmtab
( is something changed )


Roland
Sometimes you lose and sometimes the others win
RolandH
Honored Contributor

Re: lvremove failed

Some errors in my post before

#strings /etc/lvmtab
(is disk /dev/dsk/c0t8d0 listed at vg00 or vg01?)

# cp /etc/lvmtab /etc/lvmtab.OLD
# rm /etc/lvmtab
# vgscan ( recreates /etc/lvmtab )
# strings /etc/lvmtab
( is something changed )
Sometimes you lose and sometimes the others win