1838241 Members
3605 Online
110125 Solutions
New Discussion

invalid lv number

 
Amit Manna_6
Regular Advisor

invalid lv number

In a volume group a logical volume was created with 1.5 GB size. When removing the LV by mistake the raw logical volume was removed using rm command. Later on when trying to remove the logical volume it was giving a message "can't remove, invalid lv number". The lvol was removed using rm command. But it did now free the space. When lvdisplay command was tried it did'nt show the logical volume.

Can anybody pls help in this matter.

5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: invalid lv number

Are there any other logical volumes in this VG? If not, you could try running vgexport/vgimport.


Pete

Pete
Amit Manna_6
Regular Advisor

Re: invalid lv number

there are other logical volumes in this volume group.


Rita C Workman
Honored Contributor

Re: invalid lv number

Have you tried doing a vgcfgrestore for the volume group to get things back...and then remove the lvol properly?

Just a thought,
Rita
John Palmer
Honored Contributor

Re: invalid lv number

You can simply recreate the LV device files...

cd /dev/vg??

mknod rlvolx c 64 0xVV000?
mknod lvolx b 64 0xVV000?

where VV is the VG number (same as the group file) and ? is the relevant LV number. If you don't know it, make an informed guess from numbers that you don't have already (check with ll).

Then lvremove -f to remove the LV.

Regards,
John
John Palmer
Honored Contributor

Re: invalid lv number

You DON'T need to do a vgcfgrestore as all the information on the disks is currently correct. All you've done is removed the device files. As I stated earlier, you can just create them without even deactivating the VG, something I've done many times (also renaming them).

If you are uneasy about doing it then an alternative is to deactivate then export the VG (with a map), then reimport. Your 'rogue' LV will be the one not mentioned in your map.

Regards,
John