1837645 Members
3254 Online
110117 Solutions
New Discussion

Re: Remove an unused LV:

 
SOLVED
Go to solution
Tommy Wang
Occasional Advisor

Remove an unused LV:

Hi,
I am trying to remove an unused LV:
# lvremove -f /dev/vg03/lvol35
lvremove: Couldn't delete logical volume "/dev/vg03/lvol35":
The supplied lv number refers to a non-existent logical volume.
Volume Group configuration for /dev/vg03 has been saved in /etc/lvmconf/vg03.conf
#

This LV could not be used for new filesytem:
newfs (vxfs): Cannot open /dev/vg03/rlvol35 x x
xx /x newfs (vxfs): No such device or address

any help many thanks
6 REPLIES 6
eran maor
Honored Contributor

Re: Remove an unused LV:

Hi Kenny

i think that the problem is with the device file of this logical volume .

solution:
look at a prior printout of a vgdisplay of your vg03 volume group.
If you dont have one you can do the following:
vgdisplay -v /dev/vg03:
find all the disks that belong to the vg.
pvdisplay -v on each of the disks in the vg:
look at the distribution of physical volume section. This will list all
the valid lvols that belong to each disk. If lvol8 is not listed on any
of the disks then this means that this is a bogus lvol. If lvol35 is
found you have two choices at that point:

create device files in /dev/vg03 using minor numbers that currentlly
dont exist eg..
mknod /dev/vg03/test c 64 0x0000035 ( you need to check all the minor number's of your lvol but i think i shuold be 35 but check it )

mknod /dev/vg03/test1 c 64 0x00000a
mknod /dev/vg03/test2 c 64 0x00000b
dont forget to check to see if there are any missing minor number from
0-35. Then lvremove on each of the lvols untill you dont get the error.
clean up the left overs with the rm command.
the other thing you can do is export vg03
then vgimport the vg and then take a look in the /dev/vg03 directory and
see which minor number is present that was missing before..
If I had to gues I would say that this lvol never existed in the first
place.
love computers
Wieslaw Krajewski
Honored Contributor
Solution

Re: Remove an unused LV:

Hi,

It is very likely, that in the directory /dev/vg03 you have two special files:
lvol35 and rlvol35
that correspond to the non-existent logical volume.
Just remove them:

rm /dev/vg03/lvol35 /dev/vg03/rlvol35

Should help.

Rgds.
Permanent training makes master
Tommy Wang
Occasional Advisor

Re: Remove an unused LV:

Hello,
pvdisplay -v for those two disks, and found that lvol35 is not listed on any of the disks.
is that mesns that I can remove those two special files:
rm /dev/vg03/lvol35 /dev/vg03/rlvol35

many thanks
Michael Tully
Honored Contributor

Re: Remove an unused LV:

Hi Kenny,

I've looked at the attachment that you
provided and the other feedback that
you given. I see no reason that you cannot
remove those files seeing that they are
not connected to any physical device.

Run this command to remove the obsolete
files:

# rm /dev/vg03/lvol35 /dev/vg03/rlvol35

HTH
Michael
Anyone for a Mutiny ?
Tommy Wang
Occasional Advisor

Re: Remove an unused LV:

Thanks anybody, I found it looks good after removing those two files.
thanks again
Denver Osborn
Honored Contributor

Re: Remove an unused LV:

Yes, I'd remove them. If pvdisplay does not show the lv and lvdisplay probably does the same, remove them. It could be that those device files may have been restored from a backup.

Hope this helps,
-denver